MantisBT - NetSurf
View Issue Details
0002420NetSurfJavascriptpublic2016-01-31 19:302016-02-16 14:07
ReporterVincent Sanders 
Assigned ToMichael Drake 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.4 
Target Version3.4Fixed in Version3.4 
Fixed in CI build #3335
Reported in CI build #
URL of problem page
Summary0002420: creation of html elements in javascript uses the wrong prototype
Descriptionnote jmb discovered all of this, i am just writing it down so there is a record


because we concatenate bits of stuff together, one of which is the element name
and said element name is not the same as the corresponding bit of the IDL interface name

so: document.createElement("p") should create an HTMLParagraphElement instance

but, because we look for \xff\xffNETSURF_DUKTAPE_PROTOTYPE_HTMLPELEMENT, we generate an HTMLUnknownElement, instead

so, something, somewhere, needs to know that when asked for a "p", Bob responds with an HTMLParagraphElement

dir>directory
a>anchor
blockquote>quote
caption>tablecaption
col>tablecol
colgroup>tablecol
del>mod
dl>dlist
h{1,2,3,4,5,6}>heading
img>image
ins>mod
ol>olist
p>paragraph
q>quote
tbody>tablesection
td>tabledatacell
tfoot>tablesection
th>tableheadercell
thead>tablesection
tr>tablerow
ul>ulist

then, any other *known* element name, that has no other specialisation > htmlelement

_dom_html_document_create_element_internal seems to have a giant switch statement that does this conversion

we need a similar such mapping to get to the correct javascript class
TagsNo tags attached.
Attached Files

Notes
(0001236)
Vincent Sanders   
2016-02-16 14:07   
Confirmed fixed in 3.4 release

Issue History
2016-01-31 19:30Vincent SandersNew Issue
2016-01-31 19:30Vincent SandersStatusnew => assigned
2016-01-31 19:30Vincent SandersAssigned To => Daniel Silverstone
2016-02-01 15:22Michael DrakeFixed in CI build # => 3335
2016-02-01 15:22Michael DrakeAssigned ToDaniel Silverstone => Michael Drake
2016-02-01 15:22Michael DrakeStatusassigned => resolved
2016-02-01 15:22Michael DrakeResolutionopen => fixed
2016-02-16 14:07Vincent SandersNote Added: 0001236
2016-02-16 14:07Vincent SandersStatusresolved => closed
2016-02-16 14:07Vincent SandersFixed in Version => 3.4