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

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?


[snipped]


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

Rego,

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.

[1]
"
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
http://www.w3.org/TR/CSS21/visuren.html#inline-boxes

More reading:

[CSS2] first-line-selector-011.htm
http://lists.w3.org/Archives/Public/public-css-testsuite/2013Jun/0000.html
[CSS2] first-line-selector-011.htm
http://lists.w3.org/Archives/Public/public-css-testsuite/2013Jun/0001.html
[CSS2] first-line-selector-011.htm
http://lists.w3.org/Archives/Public/public-css-testsuite/2013Jun/0002.html

The test I proposed:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/first-line-selector-011-GT.html

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

http://www.gtalbot.org/BrowserBugsSection/css21testsuite/first-line-selector-011-GT-Rego.html

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

Gérard

Received on Sunday, 7 December 2014 23:02:59 UTC