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

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/cdata-in-integration-point-fragment-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/cdata-in-integration-point-fragment.html
    M 
LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/html5lib_url_file=plain-text-unsafe-expected.txt
    M Source/WebCore/html/parser/HTMLTreeBuilder.cpp
    M Source/WebCore/html/parser/HTMLTreeBuilder.h

  Log Message:
  -----------
  U+0000 NULL should be replaced with U+FFFD when fragment parsing in foreign 
content
https://bugs.webkit.org/show_bug.cgi?id=323867

Reviewed by Chris Dumez.

The tokenizer's forceNullCharacterReplacement flag is computed from the 
adjusted current
node after each token is processed. When fragment parsing the adjusted current 
node is the
context element from the start, but the first characters are tokenized before 
any token
reaches the tree builder, so NULL in the first character run was dropped 
instead of being
replaced with U+FFFD.

Compute the flags when the fragment tree builder is constructed as well. This 
also fixes
shouldAllowCDATA, so a CDATA section at the start of the fragment is no longer 
parsed as a
bogus comment.

The extracted helper is ALWAYS_INLINE because constructTree() calls it for 
every token.

Tests upstream: https://github.com/web-platform-tests/wpt/pull/62593

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



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

Reply via email to