Open
Bug 537201
Opened 16 years ago
Updated 4 years ago
replaced element (img) as display:table-cell should have its borders collapsed and participate in table layout
Categories
(Core :: Layout: Tables, defect)
Core
Layout: Tables
Tracking
()
NEW
People
(Reporter: rvandam00, Unassigned)
References
(Blocks 1 open bug, )
Details
(Keywords: testcase)
Attachments
(1 file)
|
940 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.16) Gecko/2009121602 Ubuntu/8.04 (hardy) Firefox/3.0.16
Build Identifier: Firefox/3.5.6
If an <img> has 'display: table-cell' and the surrounding 'display: table' element has 'border-collapse: collapse' then any borders on the <img> fail to collapse and the img 'cell' is rendered one pixel shorter and lower than the neighboring cells.
Occurs in at least Firefox/3.0.16 in Ubuntu 8.04 and Firefox/3.5.6 in Windows XP.
Several versions of Safari, Chrome, and Opera also all fail to collapse the borders on the img but only Firefox renders the cell off by one pixel.
Wrapping the img in a <div></div> (and applying table-cell to that div) renders correctly.
Reproducible: Always
http://www.w3.org/TR/CSS21/tables.html#table-display says:
Replaced elements with these 'display' values are treated as their given display types during layout. For example, an image that is set to 'display: table-cell' will fill the available cell space, and its dimensions might contribute towards the table sizing algorithms, as with an ordinary cell.
I'm not entirely sure what that means, though.
These tests also fail:
http://test.csswg.org/suites/css2.1/20100917/html4/table-cell-002.htm
http://test.csswg.org/suites/css2.1/20100917/xhtml1/table-cell-002.xht
Blocks: css2.1-tests
Status: UNCONFIRMED → NEW
Component: Style System (CSS) → Layout: Tables
Ever confirmed: true
QA Contact: style-system → layout.tables
Summary: <img> renders poorly if set to display: table-cell and border-collapse: collapse → replaced element (img) as display:table-cell should have its borders collapsed and participate in table layout
Comment 3•16 years ago
|
||
I believe the upshot is that for display:table-cell images we should be using the intrinsic sizing, etc, of the image, and make the border-collapse stuff happen on the image. Which means border-collapse needs to move out of nsTableCellFrame, or nsTableCellFrame needs to be able to have an arbitrary inner or something.
Note that there are further issues with display:table-row images. I doubt anyone implements them per spec, nor that the test suite tests them...
Comment 4•11 years ago
|
||
Test
http://test.csswg.org/suites/css2.1/latest/html4/table-cell-002.htm
The 4px difference seems (just a hunch) to be due to baseline-alignment of the image.
Updated•4 years ago
|
Severity: minor → S4
You need to log in
before you can comment on or make changes to this bug.
Description
•