Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5778396ee19cedd3b67401af44bb2af02f99745b
      
https://github.com/WebKit/WebKit/commit/5778396ee19cedd3b67401af44bb2af02f99745b
  Author: Chris Dumez <[email protected]>
  Date:   2026-04-07 (Tue, 07 Apr 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/newline-normalization-cr-then-lf-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/newline-normalization-cr-then-lf.html
    M Source/WebCore/html/parser/HTMLTokenizer.cpp

  Log Message:
  -----------
  Batch plain-text characters in HTML tokenizer quoted attribute value states
https://bugs.webkit.org/show_bug.cgi?id=311620

Reviewed by Darin Adler.

Apply the same batching optimization from 310687@main (DataState) to
AttributeValueDoubleQuotedState and AttributeValueSingleQuotedState.

After appending a character, scan ahead in the current 8-bit substring
for runs of plain text (stopping at the closing quote, '&', '\r', '\n',
or '\0'). Append the entire run at once via the span overload of
appendToAttributeValue() and advance the source with
advancePastMultiple8(), avoiding per-character tokenizer loop overhead.

Performance results on attribute-heavy benchmark
(Parser/html-parser-attribute-heavy, 3000 elements with long inline
styles, data URIs, and URLs):
  Baseline: 58.0 ms median
  Patched:  53.0 ms median → ~9% faster

On the tag-heavy HTML spec (Parser/html-parser):
  Baseline: 207.0 ms median
  Patched:  204.5 ms median → ~1% faster

* 
LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/newline-normalization-cr-then-lf-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/html/syntax/parsing/newline-normalization-cr-then-lf.html:
 Added.
No behavior change compared to shipping but I'm extending test coverage since I 
found a bug while working
on this PR that wasn't caught by WPT tests.

* Source/WebCore/html/parser/HTMLTokenizer.cpp:
(WebCore::isQuotedAttributeValueSpecialCharacter):
(WebCore::findPlainTextInQuotedAttributeValue):
(WebCore::HTMLTokenizer::processToken):

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



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

Reply via email to