[webkit-changes] [WebKit/WebKit] 609c58: The HTML fast parser may not parse HTML entities c...

Chris Dumez noreply at github.com
Thu Mar 23 18:21:41 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 609c58ee50173877e87adcd9e24ec2934db4e362
      https://github.com/WebKit/WebKit/commit/609c58ee50173877e87adcd9e24ec2934db4e362
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-03-23 (Thu, 23 Mar 2023)

  Changed paths:
    A LayoutTests/fast/parser/fast-html-parser-consume-entity-expected.txt
    A LayoutTests/fast/parser/fast-html-parser-consume-entity.html
    M Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp

  Log Message:
  -----------
  The HTML fast parser may not parse HTML entities correctly
https://bugs.webkit.org/show_bug.cgi?id=254370

Reviewed by Ryosuke Niwa.

The code was assuming consumeHTMLEntity() consumes all the input, which is not
necessarily the case. This fixes cases where the reference is only part of the
text.

This is a cherry-pick from Blink:
- https://chromium-review.googlesource.com/c/chromium/src/+/4305159

* LayoutTests/fast/parser/fast-html-parser-consume-entity-expected.txt: Added.
* LayoutTests/fast/parser/fast-html-parser-consume-entity.html: Added.
* Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp:
(WebCore::HTMLFastPathParser::scanHTMLCharacterReference):

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




More information about the webkit-changes mailing list