Open zcorpan opened 7 years ago
Probably anything that goes trough https://drafts.csswg.org/css-syntax/#tokenization … except I suppose text nodes that happen to be in a <style>
element. Stylo also does replacement (of surrogates to U+FFFD) there when parsing a stylesheet, but I don’t think that case can be as neatly expressed though use of CSSOMString
.
Does the CSS parser have entry points yet for code points or scalar values?
https://drafts.csswg.org/css-syntax/#input-byte-stream
When parsing a stylesheet, the stream of Unicode code points that comprises the input to the tokenization stage might be initially seen by the user agent as a stream of bytes
Might, not necessarily.
To decode the stream of bytes into a stream of code points, UAs must use the decode algorithm defined in [ENCODING], with the fallback encoding determined as follows.
Code points, even though decode emits scalar values. I think this implicit “upcasting” is fine.
https://drafts.csswg.org/css-syntax/#input-preprocessing
The input stream consists of the code points pushed into it as the input byte stream is decoded.
This is the other entry point. The wording should be tweaked so that it doesn’t imply that these code point necessarily come directly from decoding a byte stream. CC @tabatkins
"Might" seems rather bad. Can't we just have an explicit entry point for bytes and one for code points? (And yes, as defined a scalar value is a code point: https://infra.spec.whatwg.org/#scalar-value.)
See https://github.com/w3c/csswg-drafts/pull/1266
I think all
media
attributes as well as img/sourcesizes
should beCSSOMString
s since they use CSS syntax.cc @SimonSapin