CSS2 Border collapse resolution algorithm implementation error

RESOLVED FIXED

Status

()

RESOLVED FIXED
15 years ago
4 years ago

People

(Reporter: lachlan.hunt, Unassigned)

Tracking

(Blocks: 1 bug)

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113

For some combinations of border styles for table cells, when border-collapse:
collapse; is set, the incorrect border style is rendered, according to step 3 of
the CSS2 border conflict resolution algorithm [1].
  eg. When a cell with 'inset' is above and/or before cell with 'outset',
Mozilla incorrectly renders 'inset', however 'outset' should take precedence. 
There are also a few other combinations with similar results.

[1] http://www.w3.org/TR/CSS2/tables.html#border-conflict-resolution

Reproducible: Always
Steps to Reproduce:
1. Create the following table:
<table>
    <caption>Test 9.08: inset/groove</caption>
    <tr>
        <td>groove</td><td>groove</td><td>groove</td>
    </tr>
    <tr>
        <td>groove</td><td class="inner">inset</td><td>groove</td>
    </tr>
    <tr>
        <td>groove</td><td>groove</td><td>groove</td>
    </tr>
</table>

2. Apply this style:
table { border-collapse: collapse; }
td { border: 5px groove blue; color: blue; }
td.inner { border: 5px inset aqua; color: aqua; }

Actual Results:  
For the middle cell, the right and bottom borders incorrectly render as 'inset',
but the top and left corectly render as 'groove'

Expected Results:  
It should have rendered all borders as 'groove'
(Reporter)

Comment 1

15 years ago
Created attachment 143958 [details]
Test case showing all possible border-style collapse combintations

In this test case, the following tests show this error:
6.07, 7.06, 8.09 and 9.08
Bernd, any idea what's up here?  Looking at styleToPriority in nsTableFrame.cpp,
it looks like groove and outset incorrectly have the same priority, but
otherwise the ordering is fine....

Comment 3

15 years ago
first of all in css 2.1 the inset - > rigde and outset -> groove identity changed
http://www.w3.org/TR/2004/CR-CSS21-20040225/tables.html#border-conflict-resolution
so we need to change that anyway.
Umm.. when did that identity ever hold?  Not in CSS2, certainly. See comment 0.

Yeah, that code is probably what's causing the problems...  we should fix that
and make sure that all entries in styleToPriority are distinct (except maybe the
"bg" styles").
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 6

15 years ago
see some historical reference
http://lists.w3.org/Archives/Public/www-style/1999Jan/0007.html

so they needed 5 years to fix it, sounds like we are not that bad.
Oh, interesting... So we need to change that and then fix the priorities (eg
inset and ridge should still have different priorities, since otherwise we'll
screw up colors as we do in the attached testcase).
Except of course we look up the _output_ of GetStyleInfo in styleToPriority. 
Which is bad, because in that output we have (once we fix it) inset == ridge and
outset == groove.  But the priority order for conflict resolution is 'ridge',
'outset', 'groove', 'inset'.  Yay.  So inset == ridge, but ridge > outset > inset.

Updated

15 years ago
Blocks: 203686

Comment 9

14 years ago
fixed by the checkin for bug 229883
Status: NEW → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.