0

Avoid constructing a DocumentFragment unnecessarily in DOMParser::parseFromStrin...

 1 month ago
source link: https://github.com/WebKit/WebKit/pull/17023
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Contributor

@cdumez cdumez

commented

Aug 24, 2023

edited by webkit-early-warning-system

903209c

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

79f4649


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK