W3C home > Mailing lists > Public > www-style@w3.org > January 2012

Re: [CSS21] Default table border width in collapsing border model

From: Gérard Talbot <www-style@gtalbot.org>
Date: Wed, 4 Jan 2012 10:54:14 -0800
Message-ID: <5d98f2a8eb33557eea2c89ba5264a110.squirrel@gtalbot.org>
To: "Christian Roth" <roth@visualclick.de>
Cc: "www-style Mailing List" <www-style@w3.org>

Le Mer 4 janvier 2012 9:07, Christian Roth a écrit :
> On 04.01.2012, at 17:17, Boris Zbarsky wrote:
>> In this testcase, that border segment has only one border along it: the
>> border of the table, right?
> Right.
>> What rendering were you expecting?  A 25px thick red line?
> Yes.

You misunderstand selector specificity here.

                background: transparent;
                border: 50px solid blue;
                padding: 10px;
                width: 100px;
                border-left: none;

td#c2 has a higher specificity than td rule. There is no border conflict
in the code above but only a specificity of rules to figure out.

6.4.3 Calculating a selector's specificity

count the number of ID attributes in the selector (= b)
count the number of other attributes and pseudo-classes in the selector (= c)
count the number of element names and pseudo-elements in the selector (= d)

So this gives:

td /* a=0 b=0 c=0 d=1 -> specificity = 0,0,0,1 */

td#c2 /* a=0, b=1, c=0, d=1 -> specificity = 0,1,0,1 */

So, the left border of cell in 2nd row has a border-style of none which is
computed as border-width 0px.

It is only after figuring out the specificity that border conflict
resolution in border collapse model can apply. And 3px (medium which is
the default left border of table) is going go win over 0px.

I may later include your example, test in the CSS 2.1 test suite for one
main reason.

regards, Gérard
CSS 2.1 Test suite RC6, March 23rd 2011

Contributions to CSS 2.1 test suite

Web authors' contributions to CSS 2.1 test suite
Received on Wednesday, 4 January 2012 18:54:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:09 UTC