Bug 276431

Summary: [CSS] Tokenizer should distinguish newline from whitespace
Product: WebKit Reporter: Matthieu Dubet <m_dubet>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: karlcow, webkit-bug-importer
Priority: P2 Keywords: EasyFix, GoodFirstBug, InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Matthieu Dubet
Reported 2024-07-10 10:08:20 PDT
https://drafts.csswg.org/css-syntax/#tokenizer-definitions newline U+000A LINE FEED. Note that U+000D CARRIAGE RETURN and U+000C FORM FEED are not included in this definition, as they are converted to U+000A LINE FEED during preprocessing. whitespace A newline, U+0009 CHARACTER TABULATION, or U+0020 SPACE. But currently we just consider newline as a whitespace character. CSSParserToken CSSTokenizer::whiteSpace(UChar /*cc*/) { auto startOffset = m_input.offset(); m_input.advanceUntilNonWhitespace(); // FIXME: This does not preserve whitespace type (like tabs). auto whitespaceCount = 1 + (m_input.offset() - startOffset); return CSSParserToken(whitespaceCount); } template<typename CharacterType> constexpr bool isASCIIWhitespace(CharacterType character) { return character == ' ' || character == '\n' || character == '\t' || character == '\r' || character == '\f'; }
Attachments
Radar WebKit Bug Importer
Comment 1 2024-07-10 10:35:56 PDT
zak ridouh
Comment 2 2024-07-23 18:46:19 PDT
EWS
Comment 3 2024-08-10 09:43:03 PDT
Committed 282084@main (de28c5277420): <https://commits.webkit.org/282084@main> Reviewed commits have been landed. Closing PR #31139 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.