Closed Bug 26488 Opened 25 years ago Closed 25 years ago

misplaced caption incorrectly inserted into the content model

Categories

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

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: karnaze, Assigned: harishd)

References

()

Details

<table border> <CAPTION ALIGN=BOTTOM>Table 5 has a scrolling tbody.</CAPTION> <tbody> <tr><td>cell-00</tr> Harish, I stumbled on this while looking at test4. The 2nd caption is getting placed inside a table cell. It should probably be thrown out since there can only be one caption. <tr><td>cell-10</tr> </tbody> <tfoot> <tr><td colspan=2 style="font-size: 8pt; font-weight: bold">FOOTER </tfoot> <CAPTION ALIGN=BOTTOM>Table 5 has a scrolling tbody.</CAPTION> </table>
I agree that the second CAPTION should be thrown away. But the question is ..by whom? I don't think that the parser should keep track of the number of CAPTION tags...however, I think, it's apt for the table code to deal with it. Comments?
The table code should always wrap anonymous table elements around table elements it encounters that don't have the proper parentage (because this can happen in xml and in html by remapping using display types). The parser is supposed to prevent this in the simplest cases of html and thus provide backward compatibility. So, in this case, I don't think the table code can provide the correct backward compatibility.
This is the content model I get with Feb 18th build. The model seems to be correct. docshell=0249D240 html@02C2E3DC refcount=3< head@02C2E36C refcount=2< > body@02B248CC refcount=3< table@02B559BC border=1 refcount=6< caption@02B5578C align=Bottom refcount=3< Text@02B55570 refcount=3<caption 1> > tbody@02B554CC refcount=3< tr@02B5545C refcount=3< td@02B553A0 refcount=4< Text@02B552D0 refcount=3<\n cell-00zxzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\n > > > > caption@02B5516C align=Bottom refcount=2< Text@02B55080 refcount=2<caption 2> > > Text@02B52F70 refcount=3<\n\n\n> > >
The problem with that content model is that per my 2/7 comments, the example looks different than Nav4.x. The table code is correctly wrapping a table around the 2nd caption because it is in the content model, whereas Nav4.x just appears to throw it out. I made a slight mistake in the example I gave and put the text "Harish, I stumbled ...." inside the example, but it reveals another case where the parser is not 100% compatible with Nav. Nav throws the "Harish, I stumbled ...." text outside the table whereas we do not. Either fix this bug or mark wontfix, but the table code will never be able to give Nav behavior and support CSS2 at the same time.
Target Milestone: M15
Chris, I've fixed the throwing-content-outside-the-table problem. However, I see some wierdness in layout. In the example that you provided, the caption appears on the top (!), on initial load, but gets set to the bottom if you resize the window. Also, I see some text overlapping inside the TABLE. I'm going to mark this fixed. But I would like you to take a look in the problem that I mentioned. Thanx.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
updated qa contact.
QA Contact: janc → bsharma
Verified on: build: 2001-05-21-11-Mtrunk platform: WinNT The test case passes.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.