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

Re: Issue 138 proposed text

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 16 Jul 2010 11:49:35 -0700
Message-ID: <AANLkTinnYmpS7n66OwDqGx_iuCZ6cZAxgJJ3nOzD-pfs@mail.gmail.com>
To: "L. David Baron" <dbaron@dbaron.org>
Cc: www-style list <www-style@w3.org>
On Tue, Jul 13, 2010 at 9:37 PM, L. David Baron <dbaron@dbaron.org> wrote:
> On Thursday 2010-06-03 15:19 -0700, Tab Atkins Jr. wrote:
>> I suggest changing the last sentence to instead read:
>> "When such an inline box is affected by relative positioning, the
>> relative positioning affects all the boxes that were originally
>> contained within the inline box, including the block box causing the
>> break."
> This seems like it might be too strong.  It seems like it might
> imply that floats inside the inline box are affected by the relative
> positioning, even though the inline box is not in their containing
> block chain.  (See the test at
> http://dbaron.org/css/test/2010/css21-issue-138-simple-float-test ,
> which at least in Gecko and Chromium shows that floats are affected
> by the relative positioning of their containing block but not by an
> inline that is in their ancestor chain but inside their containing
> block.)

That's actually exactly what I was aiming for (that's what fantasai
and I were saying was preferred), but looking over this more closely,
I agree that that's crazy.  Boris' preferred rendering is the
appropriate way to handle this.

For reference, his testcase was:

<!DOCTYPE html>
<span style="position: relative; left: 100px">
  <span style="display: block">
  <span style="float: left">bbb</span>
  <span style="display: block">

And his expected rendering was:

bbb        ccc

This rendering can be explained as everything originally (pre-relpos)
being laid out as:


Then the relpos on the outermost span takes effect, shifting
everything over *except the float*.  The float stays where it is
because it is positioned solely in relation to its containing block,
not its parent, and in this case its containing block is the ICB.

You can make the float move with the rest; you just have to force the
outermost span to generate a containing block, such as by making it
block or inline-block, or by using abspos instead of relpos.

This appears to be the most consistent approach to me.  Dunno whether
it's best, but I don't want to try and resolve the issues that may
arise from treating floats inconsistently here.

> However, floats inside a block inside the inline probably should be,
> since their containing block is affected by the relative positioning
> (which is more the point of this issue).


> Would it be better to say simply that the relative positioning "also
> affects the block box contained by the inline" instead of "also
> affects the block box"?

That might be sufficient.  Boris, does that sound like it resolves
anything?  Or would you prefer a bit more of a rewrite that makes it
more explicit?

Received on Friday, 16 July 2010 18:50:29 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:48 UTC