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

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.

            td
            {
                background: transparent;
                border: 50px solid blue;
                padding: 10px;
                width: 100px;
            }
            td#c2
            {
                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
http://www.w3.org/TR/CSS21/cascade.html#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
http://test.csswg.org/suites/css2.1/20110323/html4/toc.html

Contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

Web authors' contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html

Received on Wednesday, 4 January 2012 18:54:47 UTC