Skip to content

[css-pseudo] Clarify spec text in "Finding the First Formatted Line" section #2120

@mrego

Description

@mrego

Spec: https://drafts.csswg.org/css-pseudo/#first-text-line

The spec says:

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".

It'd be nice to clarify what the first line is in that example. It only says that it's not the line "Hello", but what about the line "Goodbye etcetera" or only the word "etcetera".
Also there's no browser interoperability if you add for example:

<style>div::first-line { color: cyan; background: magenta; }</style>

Output in Chromium/WebKit vs Firefox/Edge

All browsers do weird things. 😄

For example for first-letter the text is clearer:

In CSS the first letter of a table-cell or inline-block cannot be the first letter of an ancestor element. Thus, in <DIV><P STYLE="display: inline-block">Hello<BR>Goodbye</P> etcetera</DIV> the first letter of the DIV is not the letter "H". In fact, the DIV doesn’t have a first letter.

It says that it's not the "H" and that there's no first letter in that example. So things are 100% clear.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions