</dl> doesn't close <dt>

RESOLVED FIXED in mozilla0.9.6

Status

()

Core
HTML: Parser
RESOLVED FIXED
16 years ago
16 years ago

People

(Reporter: Michael Robinson, Assigned: harishd)

Tracking

({testcase})

Trunk
mozilla0.9.6
x86
Windows 98
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fix in hand], URL)

Attachments

(3 attachments)

(Reporter)

Description

16 years ago
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4) Gecko/20010913
BuildID:    2001091303

Text is alined incorrectly.  As the "nesting" of lists and items increases, the
text should be indented further to the right.  All text is left justified in the
table of contents.


Reproducible: Always
Steps to Reproduce:
1. Open the sample URL

Actual Results:  All items in the top of the page are left aligned

Expected Results:  Lines should have been indented to various levels, depending
on how deeply the list had been nested.

<DL>
<DT>A line
    <DL>
    <DT>Should be indented, but not
    </DL>
</DL>

If this source is opened in composer, the following would be seen:
<DL>
<DT>A line
    <DL>
    <DT>Should be indented, but not</DT>
    </DL>
</DT></DL>

If the following source is used instead, "correct" behavior is seen:
<DL>
<DT>A line</DT>
    <DL>
    <DT>Should be indented, but not</DT>
    </DL>
</DL>

Comment 1

16 years ago
Confirmed.

DT has an optional endtag, so the markup is legal I think. I believe that the
parser should be closing the DT when it hits the DL, and it is not. Here is the
content mode dump without closing the first DT:

  body@03792D20 refcount=3<
    Text@03812940 refcount=3<\n>
    dl@03812890 refcount=3<
      dt@038127A0 refcount=3<
        Text@03812740 refcount=3<A line\n >
        dl@038126A0 refcount=3<
          dt@03796730 refcount=3<
            Text@03795300 refcount=3<Should be indented, but not>
          >
        >
        Text@037951F0 refcount=3<\n>
      >
    >

And now if the DT is closed:

  body@03796850 refcount=3<
    Text@03810720 refcount=3<\n>
    dl@03814E80 refcount=3<
      dt@03814D90 refcount=3<
        Text@03814D30 refcount=3<A line>
      >
      dl@03814C90 refcount=3<
        dt@03814C30 refcount=3<
          Text@03814BD0 refcount=3<Should be indented, but not>
        >
      >
    >
    Text@038149E0 refcount=3<\n>
 
Over to parser for a closer look.
Assignee: attinasi → harishd
Status: UNCONFIRMED → NEW
Component: Layout → Parser
Ever confirmed: true

Comment 2

16 years ago
Created attachment 49997 [details]
testcase comparing with and without endtag for the DT
Keywords: testcase
Summary: lists [dl] with nested lists and tags [dt] missing closing tags [/dt] formatted incorrectly → </dl> doesn't close <dt>
(Assignee)

Comment 3

16 years ago
Created attachment 53340 [details]
Another testcase with style [ suggesting DT can contain DL! - in IE ]
(Assignee)

Comment 4

16 years ago
Marc: It shouldn't be too difficult for me to close out DT on hitting DL but IE
doesn't seem to handle that way. Anyway, I'll attach a fix stop DT containing DL.
(Assignee)

Comment 5

16 years ago
Created attachment 53350 [details] [diff] [review]
patch v1.0 [ stop DT from containing DL ]
(Assignee)

Updated

16 years ago
Severity: trivial → normal
Whiteboard: [fix in hand]
Target Milestone: --- → mozilla0.9.6
Comment on attachment 53350 [details] [diff] [review]
patch v1.0 [ stop DT from containing DL ]

r=heikki. You should probably add a comment in the code saying what bug you are fixing.
Attachment #53350 - Flags: review+

Comment 7

16 years ago
Comment on attachment 53350 [details] [diff] [review]
patch v1.0 [ stop DT from containing DL ]

sr=attinasi
Attachment #53350 - Flags: superreview+
(Assignee)

Comment 8

16 years ago
fix is in.
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.