CSS2 Border collapse resolution algorithm implementation error




15 years ago
4 years ago


(Reporter: lachlan.hunt, Unassigned)


(Blocks: 1 bug)

Windows XP

Firefox Tracking Flags

(Not tracked)



(1 attachment)



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:
    <caption>Test 9.08: inset/groove</caption>
        <td>groove</td><td class="inner">inset</td><td>groove</td>

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'

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
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").
Ever confirmed: true

Comment 6

15 years ago
see some historical reference

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.


15 years ago
Blocks: 203686

Comment 9

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