Re: [CSS21] display:run-in clarifications

On Tue, Sep 1, 2009 at 2:16 PM, Boris Zbarsky<bzbarsky@mit.edu> wrote:
> Another two issue with run-ins where behavior is inconsistent: inheritance
> and first-line/first-letter.  Consider this testcase:
>
> <!DOCTYPE html>
> <html>
> <head>
>  <style>
>    #foo:first-line { color: blue; }
>  </style>
> </head>
> <body>
>  <div style="color: red">
>    <span style="display:run-in;">
>      bbb
>    </span>
>    <div id="foo" style="color: green">
>      ccc
>    </div>
>  </div>
> </body>
> </html>
>
> Without the first-line style, the behavior in Opera, Webkit, and IE8 is the
> same: the run-in runs in and is colored red.  This makes sense to me; I was
> going to implement the same.
>
> With the first-line style, the behavior in Opera is that the run-in does not
> run in (and is colored red), while that in Webkit is that the run-in runs in
> and is colored blue.  In IE8, the run-in runs in and is colored red.  The
> IE8 behavior is the one that makes the most sense to me here.
>
> For the same test but with first-letter instead of first-line, the Opera and
> IE8 behavior is to ignore the first-letter styling altogether while the
> Webkit behavior is to give me a blue 'b' followed by two red 'b's. The
> Webkit behavior is the one that makes sense to me here.

I'm not sure I understand your reasoning here, Boris.

In the positioning case, you want an abspos child of the run-in to
treat the following block (that the run-in ran into) as a positioning
ancestor.  This implies that the run-in is treated as a child of the
following block for CSS purposes.

In the ::first-line case, you want the run-in to inherit only from its
parent rather than the ::first-line child of the following block.
This implies that either the run-in is treated as a sibling of the
following block, or that it is treated as a child of the following
block but precedes *all* other children, including generated
pseudo-children like ::first-line.

However, in the ::first-letter case you want the ::first-letter to
apply to the run-in.  This seems to imply that the run-in is treated
as a normal child of the following block and generated pseudo-children
of the following-block can appear in/before it.

What rule are you using to make these decisions?

~TJ

Received on Tuesday, 1 September 2009 19:31:46 UTC