[webkit-changes] [WebKit/WebKit] 903209: Avoid constructing a DocumentFragment unnecessaril...

Chris Dumez noreply at github.com
Thu Aug 24 12:43:21 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 903209cb2740be645ffee7bd740aa4553e59e3d8
      https://github.com/WebKit/WebKit/commit/903209cb2740be645ffee7bd740aa4553e59e3d8
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-08-24 (Thu, 24 Aug 2023)

  Changed paths:
    M Source/WebCore/dom/DocumentFragment.cpp
    M Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp
    M Source/WebCore/html/parser/HTMLDocumentParserFastPath.h
    M Source/WebCore/xml/DOMParser.cpp

  Log Message:
  -----------
  Avoid constructing a DocumentFragment unnecessarily in DOMParser::parseFromString()
https://bugs.webkit.org/show_bug.cgi?id=260665

Reviewed by Yusuke Suzuki.

Avoid constructing a DocumentFragment unnecessarily in DOMParser::parseFromString().
Have the HTML fast parser construct the subtree under the <body> element directly
instead.

* Source/WebCore/dom/DocumentFragment.cpp:
(WebCore::DocumentFragment::parseHTML):
* Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp:
(WebCore::HTMLFastPathParser::HTMLFastPathParser):
(WebCore::HTMLFastPathParser::parseCompleteInput):
(WebCore::tryFastParsingHTMLFragmentImpl):
(WebCore::tryFastParsingHTMLFragment):
* Source/WebCore/html/parser/HTMLDocumentParserFastPath.h:
* Source/WebCore/xml/DOMParser.cpp:
(WebCore::DOMParser::parseFromString):

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




More information about the webkit-changes mailing list