-
Notifications
You must be signed in to change notification settings - Fork 707
[css-text] What are the language-defined segment breaks for HTML? #5147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think the key to that question is to look at the definition of segment break, rather than for usage of the specific term. HTML clearly treats CR, LF, and CRLF in the source as segment breaks. But it converts them to LF before passing to the DOM, which is then passed to CSS for formatting, and I'm not entirely clear what DOM thinks. I think it ends up defaulting to just having LF as a segment break. |
https://html.spec.whatwg.org/multipage/parsing.html#preprocessing-the-input-stream says that the input of the HTML parser must go through https://infra.spec.whatwg.org/#normalize-newlines which replaces CRLF and lone CR with LF. But the way this is written is all about moving code points around, it doesn’t attribute them much meaning. https://html.spec.whatwg.org/#newlines defines a "newline" term
Presumably "in HTML" there means before preprocessing.
Having normative spec based on defaulting, on the absence of a definition that says to do otherwise, is what I think is not great. As an implementer I don’t feel confident that there is indeed no such definition for HTML, rather than I failed to find it. |
@SimonSapin OK, we made some rewrites in that section that hopefully should make this interaction more clear. https://drafts.csswg.org/css-text-3/#white-space-processing Let us know if it addresses your issue! |
The new text starting with "In the case of HTML" in 1014e0a looks good, but curiously I don’t find it in https://drafts.csswg.org/css-text-3/. This commit is also not listed in https://drafts.csswg.org/history/css-text-3/ |
Seems to have made it to the server at this point, so closing out. :) |
https://drafts.csswg.org/css-text/#white-space
https://drafts.csswg.org/css-text/#segment-break
I understand that CSS wants to build abstractions in order to potentially support any document language, but making it the responsibility of those languages to specifically hook into those abstractions is not great as they might… not.
CTRL+F for "segment break" in the single-page version of https://html.spec.whatwg.org/ does not find anything. Does this mean that HTML does not have any language-specific segment break?
If css-text is not the right place to define this normatively it’d be helpful to point this out in a note.
The text was updated successfully, but these errors were encountered: