Skip to content

[css-syntax] what a whitespace character is #3590

@tabatkins

Description

@tabatkins

(migrated from the mailing list)

fantasai said:

On 08/24/2015 06:22 AM, L. David Baron wrote:

I think that:

(a) we should have interop on the ::first-letter whitespace
skipping characters, and it should be specified

(b) ::blank, or whatever we call it, should use the same definition
of whitespace, since I don't want two definitions of "text
that's only whitespace" in selectors

It might also be worth a slightly closer examination of what other
things should have a common behavior with this. (Might other
browsers use the same function for ::first-letter and other things
that are present in Web standards?)

Sounds reasonable to me. I think historically CSS syntactic white space
and CSS collapsible white space have differed on handling form feed:
http://www.w3.org/TR/CSS2/syndata.html#tokenization (incl. form feed)
http://www.w3.org/TR/CSS2/text.html#white-space-prop (no form feed)

But I think this is an error, since even HTML4 includes form feed
where it defines white space collapsing:
http://www.w3.org/TR/html4/struct/text.html#h-9.1

I think we should align on the set
U+0020 SPACE
U+0009 CHARACTER TABULATION (tab)
U+000A LINE FEED (LF)
U+000C FORM FEED (FF)
U+000D CARRIAGE RETURN (CR)
since, with the exception of the white space collapsing section, both
the CSS2+ and HTML4+ specs (and Gecko) agree on this definition.
http://www.w3.org/TR/CSS2/syndata.html#tokenization
http://www.w3.org/TR/css-syntax-3/#input-preprocessing
http://www.w3.org/TR/html4/struct/text.html#h-9.1
https://html.spec.whatwg.org/multipage/infrastructure.html#space-character

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions