Re: [css2.1] :first-line behvior

On Mar 20, 2008, at 9:01 AM, Boris Zbarsky wrote:

>
> Brad Kemper wrote:
>> Would you see anything wrong with allowing those selectors if the  
>> note about which properties are applicable was extended slightly  
>> to say that these were also the properties that could be used in  
>> the pseudo-element's descendant selectors?
>
> Wouldn't it require performing layout to determine the set of  
> matching style rules?  With said style rules being able to affect  
> layout.  Yes, they can do that even if you restrict to the  
> "allowed" properties.
>
> http://ln.hixie.ch/?count=1&start=1070385285 sort of talks about a  
> similar problem.
>
> Right now, with ::first-line as it stands the list of rules  
> applying to a node is fixed but its parent for inheritance purposes  
> might change due to layout changes.  This is a little easier to  
> deal with than what you're proposing.
>
> I'm also not sure what you propose for this situation:
>
> div { color: black; }
> div::first-line span { color: yellow; }
>
> <div><span>This is some long text that wraps onto multiple lines</ 
> span></div>
>
> What is the list of rules matching the span node?  If this concept  
> no longer exists (which is what you're proposing), which exact  
> suggestions are you proposing to the CSS processing model to make  
> it actually defined?  Which text is yellow?

My expectation for that example would be that as much of the span  
that occurred within the first line would be yellow, but that  
anything that occured outside the span (nothing in this case) or was  
not part of the first line would be black. So I guess the span would  
be implicitly closed at the end of the first line and a new,  
identical one would be opened.


>
> -Boris
>
> P.S.  Some of these issues do exist with ::first-line as it stands.

That's what I was thinking as I read your comments. It seems like you  
must already have strategies for dealing with it. I didn't completely  
follow why its currently a "a little easier to deal with" than what I  
was suggesting. Does this actually make it much worse? If you say it  
does then I will take your word for it, and drop this suggestion.

If getComputedStyle() doesn't work on first-line (because it is not  
part of the document tree), then I would not expect it to work on its  
descendants either.


> I should point out that in CSS2.1 ::first-line is not defined  
> clearly enough to implement interoperably.  Last I had checked, the  
> working group had admitted that it couldn't figure out how to  
> specify it so that it made sense but wasn't willing to remove it  
> because "it's too useful", thus pushing the problem of what the  
> heck to do with this abortion onto the UAs.
>

Received on Thursday, 20 March 2008 16:51:00 UTC