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

On 1/4/12 12:07 PM, Christian Roth wrote:
>
> 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.

Why?

>> If so, I think you may be misreading 17.6.2.1: the "winning" border style is used as-is, without any admixture from other border styles....
>
> That is the part I do not understand. Is the "initial left [...] border width of the table" that needs to be calculated per 17.6.2 not used (as the initial and then further computed value) for a table border that does not explicitly specify a width (as in my case)?

Your testcase has two borders overlapping the segment:

1)  The table border, which has specified width "medium", specified 
color "red", and specified style "solid".

2)  The cell border, whih has specified width "50px", specified color 
"blue", and specified style "none".

Agreed so far?

> I read this passage as effectively saying: "For tables using the collapsing border model, the initial border-left-width of the table is half of the first cell's collapsed border (i.e., not 'medium')."

I believe the text you're looking at is talking about the way the layout 
should work, not what the computed values should be.

That is, 50px is the width used for layout here, but what's _painted_ is 
whatever wins the algorithm from 17.6.2.1, which is "medium red solid".

I do agree this is maybe not written very clearly.

Note that you can easily get this in other ways too.  Consider a table 
with two columns in which the first row has a border between the two 
cells that's 20px wide and the second row has a border between the two 
cells that 10px wide.  That's exactly the situation we have here.

> Obviously, I am wrong here. But then, I do not understand what for an initial table border width needs to be calculated at all

To actually lay out the table box.

> and where it matters in the rendering.

It matter in terms the sizing of the table's border-box and how that 
interacts with the surrounding content.  Compare the renderings of these 
two testcases:

   <!DOCTYPE html>
   Some text
   <table style="display: inline-table; border-collapse: collapse">
     <tr>
       <td style="border-left: 1px solid blue">Row 1</td>
     </tr>
     <tr>
       <td style="border-left: 20px solid blue">Row 2</td>
     </tr>
   </table>

and

   <!DOCTYPE html>
   Some text
   <table style="display: inline-table; border-collapse: collapse">
     <tr>
       <td style="border-left: 20px solid blue">Row 2</td>
     </tr>
     <tr>
       <td style="border-left: 1px solid blue">Row 1</td>
     </tr>
   </table>

> Also, why cannot the initial table border width be the (full) width of the first cell's collapsed border

This part I have no idea on.  I haven't really looked into this stuff 
that much, sorry...

> As it is, even the first cell's border would already spill in the margin area of the table

I believe this is expected behavior for collapsed borders, yes.

-Boris

Received on Wednesday, 4 January 2012 17:29:08 UTC