W3C home > Mailing lists > Public > www-style@w3.org > August 2009

Re: [CSS21] display:run-in clarifications

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Mon, 31 Aug 2009 11:45:28 -0400
Message-ID: <4A9BF018.7060105@mit.edu>
To: Bert Bos <bert@w3.org>
CC: www-style@w3.org
Bert Bos wrote:
> In the above, "siblings" and "children" include both normal elements
> and :before/:after pseudo-elements.

Makes the [1] reference a little confusing, but other than that, looks good.

> We haven't defined yet what :before/:after on a replaced element means 
> (according to the note in 12.1). Do we expect
>     IMG:before {content: "Boo!"; display: block}
> to show a block element above the image?

You're right; this is currently undefined.  We could define it both ways 
here, or try to define the whole thing on boxes instead of elements, I 
guess...  The latter seems like it might be simpler in this case.  :(

> In that case, rule c is correct 
> as it is, because that block inhibits its parent from being run-in. If 
> we expect ':before' to simply not apply to replaced elements, then rule 
> c is correct as well.

Doesn't look like that to me.  Consider the following HTML markup:

     <div>Some fallback content</div>

Since this is all being defined on _elements_, not boxes, the <object> 
in fact has a display:block child and so would inhibit its parent from 
being run in per the existing rule c, even if the <object> is 
display:inline.  That seems wrong to me...

> The added condition is "inline or run-in" instead of just "inline" 

Oh, good catch.

Though this brings up another issue.  A "display:run-in" child should 
inhibit run-in behavior in all cases (so should be added to part (a) 
here).  Indeed, either it doesn't run in (and then is a block and should 
inhibit run-in behavior) or it does run in (and then is followed by a 
block or list-item which would inhibit run-in behavior anyway).

> ---------------------------------------------------------------------------
> [Definition:] An element or pseudo-element C inhibits run-in behavior if 
> one of the following is true. (Note that the definition is 
> recursive.)
>    a. C is not floating and not absolutely positioned[3] and the
>       computed value of its 'display' is one of 'block', 'list-item'
>       or 'table'.
>    b. C has a computed value for 'display' of 'inline' or 'run-in' and
>       it has one or more children that inhibit run-in behavior.
>       (Where "children" includes both normal elements and :before/:after
>       pseudo-elements.)
> ---------------------------------------------------------------------------

I like this, if we add 'run-in' to the list in part (a) and deal with 
the replaced element issue....

Received on Monday, 31 August 2009 15:46:14 UTC

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