Open Bug 735633 Opened 13 years ago Updated 3 years ago

border-collapsed borders count for table column width computation as split between left/right side of the border, pixel-rounded in favor of left, leading to surprising width results

Categories

(Core :: Layout: Tables, defect, P5)

defect

Tracking

()

People

(Reporter: mingos.nospam, Unassigned)

References

()

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; rv:11.0) Gecko/20100101 Firefox/11.0 Build ID: 20120312181643 Steps to reproduce: Created a table with empty cells; one of the empty cells has a border around it, the others don't: http://jsfiddle.net/WACLY/6/ Actual results: The cell with a border is displayed (which is logical and expected), but makes the empty cell without a border that comes before it appear as well, while hiding all the others. See the fiddle for visual and textual feedback: http://jsfiddle.net/WACLY/6/ Expected results: The cell right before the one with the border should have a zero width as well. OR All empty cells should be displayed. I'm not sure which one is the correct behaviour as I was unable to find info on this in the W3C spec.
Also, this only happens with border-collapse: collapse.
Could you make a standalone file that can be attached here?
Firefox(11.0-14.0a1) gets same results as IE9(Windows7) and IE10CP(Windows8CP).
this is still like on report [CONFIRMED] but i can't confirm if this is a spec or a bug some additonal information: IE 11 -> same than FF Chrome -> shows all cells Opera -> shows less than FF
Status: UNCONFIRMED → NEW
Component: Untriaged → Layout: Tables
Ever confirmed: true
OS: Windows 7 → All
Product: Firefox → Core
Hardware: x86 → All
Version: 11 Branch → Trunk
The basic phenomenon here is that excess width in tables is distributed proportionally to the existing width. See: https://hg.mozilla.org/mozilla-central/file/e7806c9c83f3/layout/tables/BasicTableLayoutStrategy.cpp#l680 http://dbaron.org/css/intrinsic/#distributetocols I agree that the case described as "Firefox goes crazy" is a bug. I haven't looked into any of the other differences.
Oh, I see -- this is using border-collapse:collapse, which means that we're attributing half of the border to the cell on one side and half to the other, rounded to pixels, with preference for giving more to the cell on the top or left side of the border. This means that the left border of the cell "with a border" actually counts for the cell to its left.
Priority: -- → P5
Summary: Table layout corner case bug: some cells are displayed, some are hidden → border-collapsed borders count for table column width computation as split between left/right side of the border, pixel-rounded in favor of left, leading to surprising width results
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: