Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c6bb2f7d1851a6e24ead5e519b3536eeaa30c143
      
https://github.com/WebKit/WebKit/commit/c6bb2f7d1851a6e24ead5e519b3536eeaa30c143
  Author: Anne van Kesteren <[email protected]>
  Date:   2026-09-12 (Sat, 12 Sep 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_url_file=plain-text-unsafe-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/resources/plain-text-unsafe.dat
    M Source/WebCore/html/parser/HTMLTokenizer.cpp
    M Source/WebCore/html/parser/HTMLTokenizer.h
    M Source/WebCore/html/parser/HTMLTreeBuilder.cpp
    M Source/WebCore/html/parser/MarkupTokenizerInlines.h

  Log Message:
  -----------
  U+0000 NULL should be replaced with U+FFFD in the RCDATA and RAWTEXT states
https://bugs.webkit.org/show_bug.cgi?id=323874

Reviewed by Chris Dumez.

Per specification only the data state emits U+0000 NULL, for tree construction 
to ignore or
replace; RCDATA, RAWTEXT, script data and PLAINTEXT all emit U+FFFD. The 
tokenizer instead
skipped NULL in the RCDATA and RAWTEXT states unless the insertion mode was 
"text", which
stands in for the tokenizer state and only holds while parsing a document. When 
parsing a
fragment NULL was therefore dropped with a textarea, title, style, xmp, iframe, 
noembed, or
noframes context element.

Only skip NULL in the data state, which leaves forceNullCharacterReplacement 
meaning just
"in foreign content", and fold it into the new shouldSkipNullCharacters().

Canonical link: https://commits.webkit.org/320986@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to