Skip to content

Avoid constructing a DocumentFragment unnecessarily in DOMParser::parseFromString()#17023

Merged
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
cdumez:260665_parseFromString_no_DocumentFragment
Aug 24, 2023
Merged

Avoid constructing a DocumentFragment unnecessarily in DOMParser::parseFromString()#17023
webkit-commit-queue merged 1 commit intoWebKit:mainfrom
cdumez:260665_parseFromString_no_DocumentFragment

Conversation

@cdumez
Copy link
Contributor

@cdumez cdumez commented Aug 24, 2023

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

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🛠 gtk
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🧪 gtk-wk2
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🧪 api-gtk
✅ 🛠 tv 🧪 mac-AS-debug-wk2
✅ 🛠 tv-sim
✅ 🛠 🧪 merge ✅ 🛠 watch
✅ 🛠 watch-sim

@cdumez cdumez self-assigned this Aug 24, 2023
@cdumez cdumez added the DOM For bugs specific to XML/HTML DOM elements (including parsing). label Aug 24, 2023
@cdumez cdumez marked this pull request as ready for review August 24, 2023 18:34
@cdumez cdumez requested a review from rniwa as a code owner August 24, 2023 18:34
Copy link
Member

@Constellation Constellation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me

@cdumez cdumez added the merge-queue Applied to send a pull request to merge-queue label Aug 24, 2023
…seFromString()

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
@webkit-commit-queue webkit-commit-queue force-pushed the 260665_parseFromString_no_DocumentFragment branch from 79f4649 to 903209c Compare August 24, 2023 19:43
@webkit-commit-queue
Copy link
Collaborator

Committed 267242@main (903209c): https://commits.webkit.org/267242@main

Reviewed commits have been landed. Closing PR #17023 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 903209c into WebKit:main Aug 24, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DOM For bugs specific to XML/HTML DOM elements (including parsing).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants