Re: [CSS21] display:run-in clarifications - run-in and :first-line

Bert Bos wrote:
> In other words: CSS needs to say something definite about the situation, 
> but it doesn't matter much *what* it says.

Agreed.  At least it doesn't matter much for authors.

> Option A) The run-in heading is *not* affected by the paragraph's 
> first-line pseudo-element. The inheritance hierarchies are:

> Option B) The run-in heading *is* affected by the paragraph's first-line 
> pseudo-element. The inheritance hierarchies are:

> Option C) First-line pseudo-elements do not apply to blocks with run-in 
> headers. The inheritance hierarchies are simply:

Here's what implementations seem to do:

Opera:  No support for multiple ancestor first-lines as far as I can 
tell; only the innermost block's first-line style is used.  If this is 
styled, the run-in does not run in.  So no way to test the behavior in 
question.

Webkit (trunk): seems to be mostly your option B, except of course that 
the paragraph's first-line pseudo-element inherits from the paragraph 
itself (as required by the spec for first-line, last I checked).  Thus 
the inheritance hierarchy becomes:

     ancestor elements (3)
       the paragraph element (2)
         ancestors' first-line pseudo-elements (5)
           the paragraph's fitarst-line pseudo-element (4)
             the heading element (1)
               [content from the run-in heading]

That is, the run-in is simply treated as a child of the paragraph in 
Webkit in this situation, for inheritance purposes (or rather, a child 
of the first-line, which is a child of the paragraph).  At least for 
color.  I didn't test exciting things like how 'display' inherits.  If 
no first-line styles are specified, it's treated as a child of the 
paragraph's parent for inheritance purposes.

I guess this would be option B'.

IE8: Only one first-line is used; if it's set on the paragraph that's 
used; if not the paragraph's parent's first-line is used.  The run-in 
inherits from the latter but not the former.  This seems to be option A, 
I think.

I honestly don't have a good feel for what the right thing here is to do 
or what the other options are.  Since Gecko only implements "innermost" 
first-line, like Opera, option A is indistinguishable from one in which 
we just never inherit from first-line period in Gecko at the moment.

-Boris

Received on Wednesday, 2 September 2009 21:55:59 UTC