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
Virtualize SlotAssignment in preparation for imperative slot API
https://bugs.webkit.org/show_bug.cgi?id=243649 Reviewed by Antti Koivisto. This patch introduces SlotAssignment abstract interface, which is implemented by NamedSlotAssignment (or ImperativeSlotAssignment in the future). The interface has mostly pure virtual functions except two that need to be inlined for NamedSlotAssignment to avoid a perf regression. * Source/WebCore/dom/Element.cpp: (WebCore::Element::childrenChanged): * Source/WebCore/dom/ShadowRoot.cpp: (WebCore::ShadowRoot::addSlotElementByName): * Source/WebCore/dom/ShadowRoot.h: * Source/WebCore/dom/SlotAssignment.cpp: (WebCore::slotNameFromAttributeValue): (WebCore::slotNameFromSlotAttribute): (WebCore::NamedSlotAssignment::findAssignedSlot): Renamed from SlotAssignment. (WebCore::NamedSlotAssignment::hasAssignedNodes): Ditto. (WebCore::NamedSlotAssignment::renameSlotElement): Ditto. (WebCore::NamedSlotAssignment::addSlotElementByName): Ditto. (WebCore::NamedSlotAssignment::removeSlotElementByName): Ditto. (WebCore::NamedSlotAssignment::resolveSlotsAfterSlotMutation): Ditto. (WebCore::NamedSlotAssignment::slotFallbackDidChange): Ditto. (WebCore::NamedSlotAssignment::didChangeSlot): Ditto. (WebCore::NamedSlotAssignment::didRemoveAllChildrenOfShadowHost): Added. (WebCore::NamedSlotAssignment::didMutateTextNodesOfShadowHost): Added. (WebCore::NamedSlotAssignment::hostChildElementDidChange): Renamed from SlotAssignment. (WebCore::NamedSlotAssignment::hostChildElementDidChangeSlotAttribute): Ditto. (WebCore::NamedSlotAssignment::assignedNodesForSlot): Ditto. (WebCore::NamedSlotAssignment::willRemoveAssignedNode): Ditto. (WebCore::NamedSlotAssignment::slotNameForHostChild const): Ditto. (WebCore::NamedSlotAssignment::findFirstSlotElement): Ditto. (WebCore::NamedSlotAssignment::assignSlots): Ditto. (WebCore::NamedSlotAssignment::assignToSlot): Ditto. * Source/WebCore/dom/SlotAssignment.h: (WebCore::SlotAssignment): Added. (WebCore::NamedSlotAssignment): Renamed from SlotAssignment. (WebCore::NamedSlotAssignment::defaultSlotName): Ditto. (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost): Now call a virtual function. (WebCore::ShadowRoot::didMutateTextNodesOfShadowHost): Ditto. Renamed from didChangeDefaultSlot. (WebCore::ShadowRoot::hostChildElementDidChange): Added UNLIKELY. (WebCore::ShadowRoot::hostChildElementDidChangeSlotAttribute): Now calls a single virtual function instead of directly calling didChangeSlot and tearing the render tree. * Source/WebCore/html/HTMLDetailsElement.cpp: (WebCore::DetailsSlotAssignment::hostChildElementDidChange): (WebCore::DetailsSlotAssignment::slotNameForHostChild const): * Source/WebCore/html/HTMLSummaryElement.cpp: (WebCore::HTMLSummaryElement::create): Canonical link: https://commits.webkit.org/253266@main
- Loading branch information
Showing
7 changed files
with
116 additions
and
60 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
Oops, something went wrong.