W3C home > Mailing lists > Public > www-style@w3.org > December 2014

Re: First formatted line doubt (::first-line and ::first-letter)

From: Gérard Talbot <www-style@gtalbot.org>
Date: Sun, 07 Dec 2014 18:02:24 -0500
To: Manuel Rego Casasnovas <rego@igalia.com>
Cc: W3C www-style mailing list <www-style@w3.org>, Public CSS test suite mailing list <public-css-testsuite@w3.org>
Message-ID: <0f19c12716ebd43b2666f261174e4c2b@gtalbot.org>
Le 2014-12-07 08:57, Manuel Rego Casasnovas a écrit :
> Hi,
> I'm checking the following W3C test and I think it's wrong:
> https://test.csswg.org/shepherd/testcase/first-line-selector-011/spec/css21/name/first-line-selector-011/
> SPAN is inline-block so according to the spec [1], it shouldn't be the
> first formatted line of the DIV, so the text should be red.
> The actual result varies depending on the browser:
> * Internet Explorer and Firefox: Text is green.
> * Safari and Chrome: Text is red.
> The specific text from the spec:
> "The first line of a table-cell or inline-block cannot be the first
> formatted line of an ancestor element. Thus, in <DIV><P STYLE="display:
> inline-block">Hello<BR>Goodbye</P> etcetera</DIV> the first formatted
> line of the DIV is not the line "Hello"."
> I'm wondering what would be the first formatted line in the spec 
> example
> (probably the spec could be updated to be more explicit regarding it).
> I think that it should be "etcetera" or none, as P is inline-block and
> should be ignored.
> Andy thoughts?


> Thanks,
>   Rego
> [1] http://www.w3.org/TR/CSS2/selector.html#pseudo-element-selectors


I think that, since inline-blocks are atomic inline-level elements[1], 
then the whole inline-block content is participating in, should 
participate in the first formatted line.

Inline-level boxes that are not inline boxes (such as replaced 
inline-level elements, inline-block elements, and inline-table elements) 
are called atomic inline-level boxes because they participate in their 
inline formatting context as a *_single opaque box_*.
9.2.2 Inline-level elements and inline boxes

More reading:

[CSS2] first-line-selector-011.htm
[CSS2] first-line-selector-011.htm
[CSS2] first-line-selector-011.htm

The test I proposed:

I have created a quick and slightly modified test for you:


in which the A (immediately preceding the inline-block) and the Z 
(immediately following the inline-block) "mark", indicate the boundaries 
(start and end of) of the first line.

Of course, my understanding and interpretation of inline-block versus 
first formatted line could be wrong ... but I think Firefox and Opera 
12.16 (and IE, you say) share the same implementation with regards to 
inline-block and first formatted line pseudo-element.

+CC: Public CSS test suite mailing list

Received on Sunday, 7 December 2014 23:03:03 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:49 UTC