W3C home > Mailing lists > Public > www-style@w3.org > March 2008

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

From: David Hyatt <hyatt@apple.com>
Date: Wed, 19 Mar 2008 13:39:25 -0500
To: Sergey Malkin <sergeym@windows.microsoft.com>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-id: <0C7F590D-526C-4C55-8779-718AE2D4598A@apple.com>

It's hard for me to tell what behavior in Safari you think is wrong.   
Could you elaborate?

dave

On Mar 19, 2008, at 1:32 PM, Sergey Malkin wrote:

>
> Several people already pointed out to me, that "div:first-line span"  
> is not valid for CSS and should be ignored. So behavior I expect is  
> incorrect, but behavior of Opera and Safari still seems wrong.
>
> Thanks,
> Sergey
>
> -----Original Message-----
> From: www-style-request@w3.org [mailto:www-style-request@w3.org] On  
> Behalf Of Sergey Malkin
> Sent: Wednesday, March 19, 2008 10:31 AM
> To: www-style@w3.org
> Subject: RE: [css2.1] :first-line behvior
>
>
> 5.12.1, "The :first-line pseudo element", says that in case of  
> nested blocks pseudo elements for all blocks should be nested inside  
> innermost block-level element:
>
> <div>
>   <p> Abc </p>
>   <p> Xyz </p>
> </div>
>
> should be processed as
>
> <div>
>   <p><div:first-line><p:first-line>Abc</p:first-line></div:first- 
> line></p>
>   <p><p:first-line>Abc</p:first-line></p>
> </div>
>
> In reality, I do not see any browser implementing this, div:first- 
> line is ignored. Test case I used was:
>
>   <html>
>   <style>
>     div             {font-family:Verdana;}
>     div:first-line  {font-family:Georgia;}
>     p               {color:green;}
>     p:first-line    {color:blue;}
>   </style>
>   <body>
>      <div><p>This is long paragraph that may be broken into several  
> lines.</p></div>
>   </body>
>   </html>
>
> Spec uses "should" for this behavior, and since CSSS1 and CSS2 did  
> not specify this case, authors should not rely on this behavior. So,  
> should this case just be removed from the spec and left unspecified?
>
> Another interesting case is selecting style like "div:first-line  
> span":
>
>   <html>
>   <style>
>     div             {font-family:Verdana;}
>     div:first-line  {font-family:Georgia;}
>     p               {color:green;}
>     p:first-line    {color:blue;}
>     div:first-line span {font-weight:bold;}
>   </style>
>   <body>
>   <div>
>      <p>This is long <span style="display:inline-block">paragraph  
> that may be broken into several </span>lines.</p>
>      <p>This is long <span style="display:inline-block">paragraph  
> that may be broken into several </span>lines.</p>
>   </div>
>   </body>
>   </html>
>
> Span style works only in Opera and only if span is set to  
> display:inline-block, but it will apply this rule to the span even  
> if it is on the second line and to both paragraphs. In Safari,  
> specifying display:inline-block causes p:first-line stop working  
> inside this span. Firefox just seems to ignore "div:first-line span"  
> style. I would expect bold to appear for the span if it appears on  
> first line, either inside inline-block or not, and for the first  
> paragraph only. Am I right?
>
> Thanks,
> Sergey
>
>
>
>
>
Received on Wednesday, 19 March 2008 18:40:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:02 GMT