Re: [CSS21] display:run-in clarifications

On Tue, Sep 1, 2009 at 7:54 PM, Boris Zbarsky<bzbarsky@mit.edu> wrote:
> Tab Atkins Jr. wrote:
>> At what point are the ::first-line and ::first-letter pseudoelements
>> created?
>
> Undefined, but at least for first-line the things contained inside it
> clearly have to be determined at layout time.  How this interacts with
> inheritance from first-line is a still-open issue last I checked.

Ah, yeah, true.  So they're created sometimes during the used value
computations in practice?  Since they can change font-size/etc., they
have to sort of live in the middle of that computation rather than
lying purely on one end or the other.

>> Would it be after inheritance (basically causing a second
>> round of inheritance cascade) or before?  If the former, they'll act
>> on the run-in.  If the latter, they won't (as the run-in won't be part
>> of the block they apply to yet).
>
> Note that it's not really defined when the run-in is placed inside the block
> either.  As far as I can tell webkit handles this at layout time by mutating
> the box tree accordingly.  Gecko would likely handle this at box tree
> construction time.
>
> In any case, since styles can change dynamically the ordering question is
> not exactly sensical.  If I build the box tree and lay it out and then then
> dynamically change the first-line color, then do we cound the run-in as
> inheriting from the first-line at that point?  If not, why not?  It's
> certainly inside the block at that point.  Though we could take as our
> conceptual model one that rebuilds the box tree from scratch on any
> mutation, of course.  Point is, ordering of these operations will depend on
> that sort of thing, and is not all that relevant to the question of what the
> final rendering should be like.

I think it's sensical that you'd keep the ::first-line where it was
originally placed, even after mutations.  A more difficult question is
what to do when a ::first-line is *introduced* via a script after
pageload.  (You may view the two cases as equivalent.)

Doesn't ::first-line break itself so that it wraps at the lowest
possible level?  Or was that just a proposal to try and solve the
inheritance issue?  I ask this both from a spec and implementation
POV.

~TJ

Received on Wednesday, 2 September 2009 02:25:09 UTC