[Webkit-unassigned] [Bug 26151] Value of element.innerHTML incorrect when using XML style close tags.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 3 09:38:10 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=26151





------- Comment #4 from itaylor at crowdfactory.com  2009-06-03 09:38 PDT -------
Thanks very much for your speedy reply on this issue.  You are right.  

I was using an XHTML doctype and assumed that meant that the valid XML syntax
for self closed tags was valid in XHTML as well.

Some information on the subject.

http://dusan.fora.si/blog/self-closing-tags
http://stackoverflow.com/questions/97522/what-are-all-the-valid-self-closing-tags-in-xhtml-as-implemented-by-the-major-br

That said, there is a difference here between how Webkit handles this case and
how other browsers do. 

I've written a more nuanced test, that shows the difference.
<div id='outer'>
        <li><div id='foo'/></li>
        <li><div id='bar'></div></li>
</div>
<script>
        var foo = document.getElementById("foo").innerHTML;
        var bar = document.getElementById("bar").innerHTML;
        alert("foo was: "+ foo + "\nbar was: "+bar);    
</script>               

This will output the following in IE/Firefox
foo was: 
bar was:
But Webkit Outputs
foo was: 
        <li><div id="bar"></div></li>

bar was: 
It looks like WebKit is using a different element scope to look for the
"missing" end of the self closed tag than IE/Firefox. The <li> element contains
the search for the "missing" end tag in IE/FF, but in Webkit it does not.  I
can open a different bug if you'd prefer.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list