W3C home > Mailing lists > Public > www-style@w3.org > May 2010

Re: [CSSWG] Minutes and Resolutions 2010-04-21

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 21 May 2010 16:25:35 -0700
Message-ID: <AANLkTimRxplRhcvzvn4OWeEnNQpqvGHLvk5Kzbv2k8BN@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: "www-style@w3.org" <www-style@w3.org>
On Fri, May 21, 2010 at 2:03 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 5/21/10 4:48 PM, Tab Atkins Jr. wrote:
>>
>> It means exactly what it sounds like, at least in my mental model of
>> how things work.  A box doesn't lose its box-tree siblings just
>> because it's positioned.  It doesn't participate in their flow, but it
>> still has a familial relationship with them.
>
> Really?
>
> In that case, what's your mental model of the box tree in this case:
>
>  <div style="display: table">
>    <div style="display: table-cell"/>
>    <div style="position: absolute"/>
>    <div style="display: table-row"/>
>  </div>
>
> What are the siblings of the absolutely positioned box?  What is its parent?
>  What are the siblings' parents?  Why does any of that make any sense?

Excellent question.  To the spec!  (Or rather, the proposed spec text
from fantasai.)

By rule 2.1, the markup is repaired by wrapping the first div, and
only the first div, in an anonymous table row.

"If a child C of a 'table' or 'inline-table' box is not a proper table
child, then generate an anonymous 'table-row' box around C and all
consecutive siblings of C that are not proper table children."

So the repaired box-tree, after resolving that algorithm, looks like:

<div display:table>
  <anon display:table-row>
    <div display:table-cell/>
  </anon>
  <div position:absolute/>
  <div display:table-row/>
</div>

(In case it is not clear, the <anon> doesn't wrap the abspos because
the definition of "consecutive siblings" given in the proposed spec
text specifically ignores abspos elements.)

The abspos box's siblings are the anonymous table-row and the third
div.  Its parent is the outer div.  The parents of the other siblings
should be obvious from the pretend-tree I illustrated.

We then follow my proposed guidelines.  The first rule that matches is
the third one, "following table row", so the auto position is the top
left corner of the border box of the third div (argh, copypaste type
in my previous email!).

This is a complex enough case that I'm not too worried about the
answer being intuitive, merely precisely specified.  I don't think the
answer is crazy, though; it's one of a few "reasonable" positions.

~TJ
Received on Friday, 21 May 2010 23:26:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:27 GMT