Open Bug 295289 Opened 19 years ago Updated 2 years ago

[BC] border-collapse rule precedence based on border width rounded off to pixels

Categories

(Core :: Layout: Tables, defect)

x86
All
defect

Tracking

()

People

(Reporter: martin.thomson, Unassigned)

References

Details

(Keywords: testcase)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050509 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b2) Gecko/20050509 Firefox/1.0+

When using border-collapse: collapse, if a table is assigned a different style
for its border, then that border style is not always applied.  It would appear
that the border style is only applied if it is wider than that applied to the
cell.  

Reproducible: Always

Steps to Reproduce:
1. Create a table with border-collapse: collapse, and different border style for
the table as a whole and the individual cells.
2. Vary the width of the table border and cell borders.
3. Vary other parameters...

Actual Results:  
The table border style only appears if the table border is thicker than the cell
borders.

For example, a dashed cell border of the same width counts as "less wide".

Expected Results:  
I would expect that the table border style is applied to the table "block"
regardless of the style of any cell borders.  That would probably require that
cell borders on the edges of the table are not rendered.

This behaviour is inconsistent with that of Internet Explorer.
Related to Core bug 203686?
Keywords: testcase
-> Layout: Tables
Component: General → Layout: Tables
Product: Firefox → Core
QA Contact: general → layout.tables
Version: unspecified → Trunk
I'm not seeing anything in the testcase that doesn't behave according to
http://www.w3.org/TR/CSS21/tables.html#border-conflict-resolution

am I missing something?
Whiteboard: INVALID
Ahh, my bad - I should have read all the standard again for this one.  This
behaviour is a nuisance, I would have inverted the list in point 4 there.  I
guess there isn't anything to be done.  (I'll chalk another one up on the IE bug
list as well.)

So I shall try again.  This should show a black table border:

table { border: 2.1px solid black; } td { border: 2px solid red; }

The cell still wins out.  Looks like it got rounded off a little early.  Even if
fractions of pixels don't make sense in reality, it might still make sense to
support such a feature.

(Interesting, I wonder what happens when this goes to print and pixels are
trainslated into points and fractions of points... print preview still shows a
fully red table, but no surprise there)
> The cell still wins out.  Looks like it got rounded off a little early.

hmm.  It actually gets rounded off to another unit (twips IIRC, 1 pixel = 16
twips) first.  If that number is equivalent to 2.5 or more pixels, then that
rule gets precedence.  You can see this with DOM Inspector if you look at the
"Computed Style" pane.

Anyway, resummarizing, marking NEW for consideration and lowering severity.
Severity: normal → minor
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 2000 → All
Summary: Table border that does not match cell borders renders inconsistently with border-collapse → border-collapse rule precedence based on border width rounded off to pixels
Whiteboard: INVALID
Depends on: pixels
Attached file testcase
This can make the table style randomly dependent on the text size.
Change the text size to see the effect (you need to hit reload (bug?)).
Summary: border-collapse rule precedence based on border width rounded off to pixels → [BC] border-collapse rule precedence based on border width rounded off to pixels
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: