Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Prototype streaming for declarative shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=245817 Reviewed by Chris Dumez. Add a very experimental internal settings to make declarative shadow DOM stream by attaching shadow root when the start tag of a template element is parsed instead of when the end tag is parsed as proposed. Having this internal setting allow us to analyze the performance characteristics of both approaches. * Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml: Added a new internal settings. We don't use experimental features since this feature needs to be disabled by default in WKTR. * Source/WebCore/html/HTMLTemplateElement.cpp: (WebCore::HTMLTemplateElement::fragmentForInsertion const): Added. This is an abstraction around regular template and template element, which is a parser macro for shadow root. (WebCore::HTMLTemplateElement::content const): Assert that nobody calls this version unless we're dealing with a regular template element (i.e. not a declarative shadow DOM). (WebCore::HTMLTemplateElement::setDeclarativeShadowRoot): Added. (WebCore::HTMLTemplateElement::attachAsDeclarativeShadowRootIfNeeded): Exit early if we had attached the shadow root with the start tag. * Source/WebCore/html/HTMLTemplateElement.h: * Source/WebCore/html/parser/HTMLConstructionSite.cpp: (WebCore::insert): (WebCore::HTMLConstructionSite::insertHTMLTemplateElement): Added. This implements the main logic of streaming declarative shadow DOM, which attaches shadow root as soon as the start tag is parsed. (WebCore::HTMLConstructionSite::ownerDocumentForCurrentNode): * Source/WebCore/html/parser/HTMLConstructionSite.h: * Source/WebCore/html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::processTemplateStartTag): Canonical link: https://commits.webkit.org/255020@main
- Loading branch information
Showing
6 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters