Bug 26170 - Closing <li> should close nested <div>
Summary: Closing <li> should close nested <div>
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-03 12:00 PDT by Ian Taylor
Modified: 2010-09-21 11:32 PDT (History)
2 users (show)

See Also:


Attachments
A test case showing the innerHTML value on a self closed xml tag. (869 bytes, text/plain)
2009-06-03 12:01 PDT, Ian Taylor
no flags Details
The same file but submitted as application/xhtml+xml (869 bytes, application/xhtml+xml)
2009-06-03 12:02 PDT, Ian Taylor
no flags Details
A test case showing the innerHTML value on a self closed xml tag. (869 bytes, text/html)
2009-06-03 12:04 PDT, Ian Taylor
no flags Details
test case for landing (1.31 KB, patch)
2010-09-21 04:09 PDT, Adam Barth
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Taylor 2009-06-03 12:00:03 PDT
While self-closed tags are not a supported part of XHTML in any of the three major browsers, the failure condition in WebKit differs from that of IE and Firefox.  

It appears as though Webkit's search for a close tag for the "missing" close tag of the self closed tag is scoped differently than IE and Firefox.

I've attached a test case that reproduces the behavior.
(see bug 26151 for more discussion of self-closed tags)
Comment 1 Ian Taylor 2009-06-03 12:01:15 PDT
Created attachment 30917 [details]
A test case showing the innerHTML value on a self closed xml tag.
Comment 2 Ian Taylor 2009-06-03 12:02:53 PDT
Created attachment 30918 [details]
The same file but submitted as application/xhtml+xml
Comment 3 Ian Taylor 2009-06-03 12:04:44 PDT
Created attachment 30919 [details]
A test case showing the innerHTML value on a self closed xml tag.
Comment 4 Alexey Proskuryakov 2009-06-04 01:15:32 PDT
This has nothing to do with "self-closing" tags - every browser treats <div/> exactly like <div> in HTML.

I can confirm that this source is parsed differently than in Firefox and than HTML5 postulates - "<div id='foo'/>Hello</li>" should be equivalent to "<div id='foo'>Hello</div></li>", not "<div id='foo'>Hello</li></div>". Re-titling accordingly.
Comment 5 Adam Barth 2010-09-21 04:09:19 PDT
Created attachment 68215 [details]
test case for landing
Comment 6 Alexey Proskuryakov 2010-09-21 10:22:21 PDT
Comment on attachment 68215 [details]
test case for landing

/me is happy today.
Comment 7 WebKit Commit Bot 2010-09-21 11:32:50 PDT
Comment on attachment 68215 [details]
test case for landing

Clearing flags on attachment: 68215

Committed r67969: <http://trac.webkit.org/changeset/67969>
Comment 8 WebKit Commit Bot 2010-09-21 11:32:55 PDT
All reviewed patches have been landed.  Closing bug.