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

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

From: Manuel Rego Casasnovas <rego@igalia.com>
Date: Sun, 07 Dec 2014 14:57:40 +0100
Message-ID: <54845CD4.60308@igalia.com>
To: www-style list <www-style@w3.org>

I'm checking the following W3C test and I think it's wrong:

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?

On top of that the following test seems wrong too:

The 2nd SPAN is floated so it seems to me that ::first-line
pseudo-element shouldn't apply and the text should be red.
Again the results are different depending on the browser:
* Firefox: Text is green.
* Internet Explorer, Safari and Chrome: Text is red.

The spec text:
"The "first formatted line" of an element may occur inside a block-level
descendant in the same flow (i.e., a block-level descendant that is not
positioned and not a float)"

What do you think?


[1] http://www.w3.org/TR/CSS2/selector.html#pseudo-element-selectors
Received on Sunday, 7 December 2014 13:58:09 UTC

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