Bug 24338 - Close tags for li, dd, dt do not close previous unclosed tags
Summary: Close tags for li, dd, dt do not close previous unclosed tags
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2009-03-03 16:56 PST by James Robinson
Modified: 2010-09-21 04:02 PDT (History)
1 user (show)

See Also:

Testcase for <dd> <dt> and <li> (285 bytes, text/html)
2009-03-03 16:58 PST, James Robinson
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Robinson 2009-03-03 16:56:50 PST
According to the rules for an end tag of "dd", "dt" or "li" at:
implicit end tags should be generated for previously unclosed tags until the matching "dd"/"dt"/"li" is found.  In the case where there's a structure like:


where XX is one of these tags WebKit nests the second XX and its children inside the first <div>.  It should close out the first <div> at the first </XX> tag.
Comment 1 James Robinson 2009-03-03 16:58:54 PST
Created attachment 28246 [details]
Testcase for <dd> <dt> and <li>

The DOM structure is wrong for all three pairs of tags.  The rendering for <dt> looks valid, but the rendering for <dd> has incorrect indentation and the rendering for <li>s has overlapping numbers.

FF3 has the correct DOM structure in all three cases and renders the <dd>s correctly but makes the same rendering mistake on <li>s.
Comment 2 Emilio López 2009-03-08 16:36:40 PDT
Here is a real-life example of this bug.


Firefox closes the div correctly and doesn't trigger the bug.
Comment 3 Adam Barth 2010-09-21 04:02:10 PDT
This bug is fixed by the HTML5 parser.