Closed Bug 179071 Opened 22 years ago Closed 22 years ago

[FIX]<dl> closes out <dd>

Categories

(Core :: DOM: HTML Parser, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.3alpha

People

(Reporter: plh, Assigned: bzbarsky)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2b) Gecko/20021016
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2b) Gecko/20021016

Mozilla builds an invalid DOM tree from a valid XHTML document. The
problem shows up when viewing the DOM specifications and can be seen
easily using the DOM inspector. If you look at the descriptions of
interfaces in the specs, you'll see that they are composed using nested
DLs. The DLs are nested inside the DD children. From time to time, a
"sub" DL is represented in the DOM tree as the child of the DL element
instead of its DD:
Original HTML document:
<dl>
 <dt>Interface DOMConfiguration</dt>
 <dd>
   <p>The DOMConfiguration interface ...</p>
   <dl>
    <dt>Issue DOMConfiguration-1</dt>
    <dd> bla bla </dd>
   </dl>
 </dd>
</dl>

Mozilla DOM tree:
<dl>
 <dt>Interface DOMConfiguration</dt>
 <dd>
   <p>The DOMConfiguration interface ...</p>
 </dd>
 <dl>
  <dt>Issue DOMConfiguration-1</dt>
  <dd> bla bla </dd>
 </dl>
</dl>

This creates an error in the rendering since the margin-left is not what
it should be. For example, have a look at the DOM Level 3 Core specification and
the description of the DOMConfiguration interface: The issues
(DOMConfiguration-1 and DOMConfiguration-2) must have the same left margin as
the previous paragraphs but don't unfortunately. The DOM inspector will
show more of these when you look at the DL children. Moving the DL node
back to his appropriate place using the DOM inspector fixes the rendered
document btw.


Reproducible: Always

Steps to Reproduce:
1.load the document
2.scroll down to the DOMConfiguration interface
3.

Actual Results:  
invalid layout given the initial XHTML structure due to the invalid DOM tree in
memory

Expected Results:  
build a valid HTML DOM tree
Yep... the inner <dl> closes out the <dd>... we have tons of bugs on this
Harish; any chance of fixing it?  ;)
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Whiteboard: DUPEME
This broke as a result of fixing bug 100466 -- <dt> can't contain <dl>, but <dd>
certainly can.
See bug 145108, bug 173500 (which points out this same line of code!), bug
172782, bug 154304, bug 172917, bug 106503.  I suspect at least half of these,
maybe more, are this problem.
Attached patch proposed patchSplinter Review
Taking bug.  This patch fixes the three bugs in the dep list as well.
Assignee: harishd → bzbarsky
Blocks: dl, 172782, 172917
Priority: -- → P1
Summary: invalid DOM tree from a valid XHTML document → [FIX]<dl> closes out <dd>
Target Milestone: --- → mozilla1.3alpha
Boris: Could you please run the regression test in htmlparser/tests.
Please take a look at the README -
http://lxr.mozilla.org/mozilla/source/htmlparser/tests/html/README.

Let me know if you're having problems and I can run it for you.
Whiteboard: DUPEME
Comment on attachment 105709 [details] [diff] [review]
proposed patch

Regression test PASSED.
r=harishd
Attachment #105709 - Flags: review+
Attachment #105709 - Flags: superreview?(heikki)
Attachment #105709 - Flags: superreview?(heikki) → superreview+
Fix checked in.  Thanks for the bug report, Philippe!
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
*** Bug 173500 has been marked as a duplicate of this bug. ***
*** Bug 187514 has been marked as a duplicate of this bug. ***
Blocks: 122567
Blocks: 131877
Blocks: 158795
Blocks: 166131
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: