Closed
Bug 76726
Opened 24 years ago
Closed 23 years ago
centered table caption is not bounded by left side of container on overflow.
Categories
(Core :: Layout: Tables, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: alexeyc2003, Assigned: bernd_mozilla)
Details
(Keywords: testcase)
Attachments
(6 files)
OS: Win2K Build: 2001041804 when a centered caption width is bigger than width of it's container it is not bounded by container's left side and gets misaligned with table.
Reporter | ||
Comment 1•24 years ago
|
||
Reporter | ||
Comment 2•24 years ago
|
||
Reporter | ||
Comment 3•23 years ago
|
||
CCing Bernd Mielke maybe he knows how to fix this.
The patch passes the regression tests.
Comment 7•23 years ago
|
||
r=karnaze
Comment 8•23 years ago
|
||
This patch seems reasonable if the behavior is appropriate. Ought the caption's width be pinned to the width of the containing block, instead? cc'ing hixie, who might have an opinion.
Comment 9•23 years ago
|
||
I doubt that is a complete fix, but I guess it's an improvement of sorts. For a complete discussion on the way captions are _supposed_ to work, see: http://www.w3.org/TR/REC-CSS2/tables.html#q5
Reporter | ||
Comment 10•23 years ago
|
||
Quoting CSS2 spec: "A caption that is above or below a table box also behaves like a block box for width calculations; the width is computed with respect to the width of the table box's containing block." In the testcase the caption has explicitly specified width through CSS. I think shrinking down width of a block, which has it explicitly specified, to the width of containing block is wrong? That's what Ian been teaching us anyways in his Evil horisontal growth tests.
Reporter | ||
Comment 11•23 years ago
|
||
Reporter | ||
Comment 12•23 years ago
|
||
What's interesting in the testcase added above, the left border of the contained <div> elements seems to be collapsed? Also although specified <div> and <table> widths are the same, for some reason <div> appears longer than <table>? Now that one beats me. I'm using win32 build 2001081208
Assignee | ||
Comment 13•23 years ago
|
||
Chris, the caption - inner table widths magics are at http://lxr.mozilla.org/mozilla/source/layout/html/table/src/nsTableOuterFrame.cpp#1500 The patch solely removes computation of the negative margins and are in my oppinion the right thing in order to get table and caption moving together as required by the spec. >I doubt that is a complete fix, but I guess it's an improvement of sorts. For >a complete discussion on the way captions are _supposed_ to work, see: > http://www.w3.org/TR/REC-CSS2/tables.html#q5 IMHO, this is a complete fix for this particular bug. This is ground work for bug 3166. A simple querry shows that we have currently 9 bugs with caption in the subject, I can't fix them all at once :-(. BTW, I disagree that the css spec provides a complete discussion, bug 60365 may be just an example of the problems with the spec especially when combined with html4. Hixie, could you be less vague and give a clear statement: should the caption shrink or not to the containing block width? Your vague statement seems to me blocks the sr and my checkin (and I doubt that the tree will become greener than it is now ;-))
Reporter | ||
Comment 14•23 years ago
|
||
Reporter | ||
Comment 15•23 years ago
|
||
The above testcase is even more bizzare and beats me. Ian might have idea of what's happening there and how many bugs it uncovers. Both testcases validate as HTML 4.01 Strict. Either way, Bernd, I think your patch should work for the caption in the above testcase as well? Could you check just in case? :o)
Assignee | ||
Comment 16•23 years ago
|
||
Comment 17•23 years ago
|
||
Bernd: Basically, the table element generates an anonymous box that contains the table box itself and the caption's box. The table and caption boxes retain their own content, padding, margin, and border areas, and the dimensions of the rectangular anonymous box are the smallest required to contain both. Vertical margins collapse where the table box and caption box touch. A caption that is above or below a table box also behaves like a block box for width calculations; the width is computed with respect to the width of the table box's containing block (which is the anonymous box I mentioned above). So the outer size of the caption, assuming it has width set to 'auto', will be the outer size of the table (by 'outer size' I mean margin-edge to margin-edge). The difference in our handling of overflow for rtl vs ltr is a bug in block code (the tables are doing it right). I think.
Assignee | ||
Comment 18•23 years ago
|
||
So the outer size of the caption, assuming it has width set to 'auto', will be the outer size of the table (by 'outer size' I mean margin-edge to margin-edge) Hixie really?: <body> <table style="margin-left:auto; margin-right:auto"> <caption> will then the caption be as wide as the page - minus body margins?
Comment 19•23 years ago
|
||
No, because the box that contains the table and caption will be the smallest possible to contain both, which will be exactly the intrinsic width of the table, since 'auto' margins can be pushed down to zero. +-----------------------+ |+---------------------+| || caption || |+---------------------+| |+---------------------+| || table || || || |+---------------------+| +-----------------------+ This is a contradiction in the spec, though, since the non-normative example a bit lower down relies on the opposite behaviour.
Whiteboard: WG
Reporter | ||
Comment 20•23 years ago
|
||
can we get sr please? the patch does the job of fixing this particular bug and does display the right behaviour.
Assignee | ||
Comment 21•23 years ago
|
||
yeah, I should have asked you for this :-). The box size issue described by Hixie is the central issue in bug 60365, which is also assigned to me, so it will not get lost.
Keywords: qawanted
Summary: centered caption is not bounded by left side of container. → Table caption does not center when TABLE's ALIGN attribute is set to 'center'
Whiteboard: WG
Reporter | ||
Comment 22•23 years ago
|
||
Bernd, this has nothing to do with align attribute or centering, this is about overflow behaviour. I think you just confused these 2 bugs and changed bug fields by mistake. I'm reversing them to previous state. I'm sorry my testcases uncover other unrelated bugs with block elements, and this gets sidetracked. But as far as this particular bug, it's testcase and the caption element in it are concerned: 1. Both table and caption do center correctly through CSS. So it's not a matter of centering. 2. Both table and caption are given explicit width through CSS and both abide it. No problem there either. 3. Caption horisontal overflow behaviour was erroneous and the patch fixes it. Ian said tables are displaying correct behaviour with the patch.
Keywords: qawanted
Summary: Table caption does not center when TABLE's ALIGN attribute is set to 'center' → centered table caption is not bounded by left side of container on overflow.
Comment 23•23 years ago
|
||
sr=waterson
Assignee | ||
Comment 24•23 years ago
|
||
Thanks Alexey for restoring the bug status, this was a mozilla bug corrupting the data fields when more then one bugzilla window is open. Seems that I should upgrade...
Assignee | ||
Comment 25•23 years ago
|
||
fix checked in, bug 96394 has the remaining block issue.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 27•23 years ago
|
||
Bugs have been filed for other issues that my last testcase has uncovered, here they are: bug 96394 bug 96463 bug 96655 bug 96658 bug 96670
You need to log in
before you can comment on or make changes to this bug.
Description
•