Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement revamped scoped custom element registry
https://bugs.webkit.org/show_bug.cgi?id=286870 Reviewed by NOBODY (OOPS!). This PR implements a number of API changes we proposed in whatwg/html#10854. Since the new API's behavior is sufficiently different from the old proposal, this PR opts to write a new set of tests instead of retrofitting the old tests to match the new behavior. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/Construct.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/Construct.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/CustomElementRegistry-define.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/CustomElementRegistry-define.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/CustomElementRegistry-initialize.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/CustomElementRegistry-initialize.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/CustomElementRegistry-upgrade.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/CustomElementRegistry-upgrade.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/Document-createElement.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/Document-createElement.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/Document-importNode.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/Document-importNode.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/Element-customElements-exceptions.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/Element-customElements-exceptions.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/Element-customElements.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/Element-customElements.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/Element-innerHTML.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/Element-innerHTML.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/ShadowRoot-init-customElements.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/ShadowRoot-init-customElements.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/ShadowRoot-innerHTML.tentative-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/revamped-scoped-registry/ShadowRoot-innerHTML.tentative.html: Added. * LayoutTests/imported/w3c/web-platform-tests/custom-elements/scoped-registry/ShadowRoot-createElement.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/scoped-registry/ShadowRoot-importNode.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/scoped-registry/ShadowRoot-init-registry.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/scoped-registry/ShadowRoot-innerHTML-upgrade.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/scoped-registry/ShadowRoot-innerHTML.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/scoped-registry/constructor-reentry-with-different-definition.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/scoped-registry/scoped-registry-define-upgrade-criteria.tentative-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/custom-elements/scoped-registry/scoped-registry-define-upgrade-order.tentative-expected.txt: * Source/WebCore/CMakeLists.txt: * Source/WebCore/DerivedSources-input.xcfilelist: * Source/WebCore/DerivedSources-output.xcfilelist: * Source/WebCore/DerivedSources.make: * Source/WebCore/Headers.cmake: * Source/WebCore/Sources.txt: * Source/WebCore/WebCore.xcodeproj/project.pbxproj: * Source/WebCore/dom/Attr.cpp: (WebCore::Attr::cloneNodeInternal): * Source/WebCore/dom/Attr.h: * Source/WebCore/dom/CDATASection.cpp: (WebCore::CDATASection::cloneNodeInternal): * Source/WebCore/dom/CDATASection.h: * Source/WebCore/dom/Comment.cpp: (WebCore::Comment::cloneNodeInternal): * Source/WebCore/dom/Comment.h: * Source/WebCore/dom/ContainerNode.cpp: (WebCore::ContainerNode::cloneChildNodes): * Source/WebCore/dom/ContainerNode.h: * Source/WebCore/dom/CustomElementReactionQueue.cpp: (WebCore::CustomElementReactionQueue::tryToUpgradeElement): * Source/WebCore/dom/CustomElementRegistry.cpp: (WebCore::upgradeElementsInShadowIncludingDescendants): (WebCore::CustomElementRegistry::upgrade): (WebCore::CustomElementRegistry::initialize): (WebCore::CustomElementRegistry::addToScopedCustomElementRegistryMap): * Source/WebCore/dom/CustomElementRegistry.h: (WebCore::CustomElementRegistry::registryForElement): (WebCore::CustomElementRegistry::registryForNodeOrTreeScope): * Source/WebCore/dom/CustomElementRegistry.idl: * Source/WebCore/dom/Document.cpp: (WebCore::createUpgradeCandidateElement): (WebCore::createHTMLElementWithNameValidation): (WebCore::Document::createElementForBindings): (WebCore::Document::importNode): (WebCore::createFallbackHTMLElement): (WebCore::Document::createElement): (WebCore::Document::createElementNS): (WebCore::Document::cloneNodeInternal): (WebCore::TreeScope::createElementForBindings): Deleted. (WebCore::TreeScope::createElement): Deleted. (WebCore::TreeScope::createElementNS): Deleted. * Source/WebCore/dom/Document.h: (WebCore::Document::setSawElementsInKnownNamespaces): Deleted. * Source/WebCore/dom/Document.idl: * Source/WebCore/dom/DocumentFragment.cpp: (WebCore::DocumentFragment::cloneNodeInternal): * Source/WebCore/dom/DocumentFragment.h: * Source/WebCore/dom/DocumentType.cpp: (WebCore::DocumentType::cloneNodeInternal): * Source/WebCore/dom/DocumentType.h: * Source/WebCore/dom/Element.cpp: (WebCore::Element::cloneNodeInternal): (WebCore::Element::cloneShadowTreeIfPossible): (WebCore::Element::cloneElementWithChildren): (WebCore::Element::cloneElementWithoutChildren): (WebCore::Element::cloneElementWithoutAttributesAndChildren): (WebCore::Element::insertedIntoAncestor): (WebCore::Element::removedFromAncestor): (WebCore::Element::customElementRegistry const): * Source/WebCore/dom/Element.h: * Source/WebCore/dom/Element.idl: * Source/WebCore/dom/ElementCreationOptions.h: Copied from Source/WebCore/dom/ShadowRootInit.h. * Source/WebCore/dom/ElementCreationOptions.idl: Copied from Source/WebCore/dom/ShadowRootInit.idl. * Source/WebCore/dom/ImportNodeOptions.h: Copied from Source/WebCore/dom/ShadowRootInit.h. * Source/WebCore/dom/ImportNodeOptions.idl: Copied from Source/WebCore/dom/ShadowRootInit.idl. * Source/WebCore/dom/Node.cpp: (WebCore::Node::cloneNode): * Source/WebCore/dom/Node.h: (WebCore::Node::usesNullCustomElementRegistry const): (WebCore::Node::setUsesNullCustomElementRegistry const): (WebCore::Node::clearUsesNullCustomElementRegistry const): * Source/WebCore/dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::cloneNodeInternal): * Source/WebCore/dom/ProcessingInstruction.h: * Source/WebCore/dom/ShadowRoot.cpp: (WebCore::ShadowRoot::insertedIntoAncestor): (WebCore::ShadowRoot::removedFromAncestor): (WebCore::ShadowRoot::registryForBindings const): (WebCore::ShadowRoot::cloneNodeInternal): * Source/WebCore/dom/ShadowRoot.h: * Source/WebCore/dom/ShadowRoot.idl: * Source/WebCore/dom/ShadowRootInit.h: * Source/WebCore/dom/ShadowRootInit.idl: * Source/WebCore/dom/Text.cpp: (WebCore::Text::cloneNodeInternal): * Source/WebCore/dom/Text.h: * Source/WebCore/dom/TreeScope.cpp: (WebCore::TreeScope::setCustomElementRegistry): (WebCore::TreeScope::importNode): Deleted. * Source/WebCore/dom/TreeScope.h: (WebCore::TreeScope::customElementRegistry const): * Source/WebCore/editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): (WebCore::ApplyStyleCommand::applyInlineStyleChange): * Source/WebCore/editing/BreakBlockquoteCommand.cpp: (WebCore::BreakBlockquoteCommand::doApply): * Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp: (WebCore::InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock): (WebCore::InsertParagraphSeparatorCommand::doApply): * Source/WebCore/editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::startAppendingNode): * Source/WebCore/editing/ModifySelectionListLevel.cpp: (WebCore::IncreaseSelectionListLevelCommand::doApply): * Source/WebCore/editing/SplitElementCommand.cpp: (WebCore::SplitElementCommand::doApply): * Source/WebCore/editing/TextManipulationController.cpp: (WebCore::TextManipulationController::updateInsertions): * Source/WebCore/editing/markup.cpp: (WebCore::createFragmentFromText): * Source/WebCore/html/AttachmentAssociatedElement.cpp: (WebCore::AttachmentAssociatedElement::cloneAttachmentAssociatedElementWithoutAttributesAndChildren): * Source/WebCore/html/AttachmentAssociatedElement.h: * Source/WebCore/html/HTMLAttributeNames.in: * Source/WebCore/html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::cloneElementWithoutAttributesAndChildren): * Source/WebCore/html/HTMLImageElement.h: * Source/WebCore/html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::cloneElementWithoutAttributesAndChildren): * Source/WebCore/html/HTMLInputElement.h: * Source/WebCore/html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::cloneElementWithoutAttributesAndChildren): * Source/WebCore/html/HTMLScriptElement.h: * Source/WebCore/html/HTMLSourceElement.cpp: (WebCore::HTMLSourceElement::cloneElementWithoutAttributesAndChildren): * Source/WebCore/html/HTMLSourceElement.h: * Source/WebCore/html/HTMLTemplateElement.cpp: (WebCore::HTMLTemplateElement::cloneNodeInternal): (WebCore::HTMLTemplateElement::attachAsDeclarativeShadowRootIfNeeded): Deleted used code. * Source/WebCore/html/HTMLTemplateElement.h: * Source/WebCore/html/HTMLTemplateElement.idl: * Source/WebCore/html/parser/HTMLConstructionSite.cpp: (WebCore::HTMLConstructionSite::insertHTMLTemplateElement): (WebCore::HTMLConstructionSite::createElement): (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): * Source/WebCore/html/shadow/SliderThumbElement.cpp: (WebCore::SliderThumbElement::cloneElementWithoutAttributesAndChildren): * Source/WebCore/html/shadow/SliderThumbElement.h: * Source/WebCore/html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::create): (WebCore::TextTrackCue::getCueAsHTML): (WebCore::TextTrackCue::rebuildDisplayTree): * Source/WebCore/html/track/VTTCue.cpp: (WebCore::VTTCue::createCueRenderingTree): * Source/WebCore/html/track/WebVTTElement.cpp: (WebCore::WebVTTElement::cloneElementWithoutAttributesAndChildren): * Source/WebCore/html/track/WebVTTElement.h: * Source/WebCore/inspector/agents/InspectorDOMAgent.cpp: * Source/WebCore/page/LocalDOMWindow.cpp: (WebCore::LocalDOMWindow::ensureCustomElementRegistry): * Source/WebCore/svg/SVGScriptElement.cpp: (WebCore::SVGScriptElement::cloneElementWithoutAttributesAndChildren): * Source/WebCore/svg/SVGScriptElement.h: * Source/WebCore/svg/SVGUseElement.cpp: (WebCore::SVGUseElement::cloneTarget const): (WebCore::cloneDataAndChildren): * Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::XMLDocumentParser::startElementNs): * Source/WebKitLegacy/mac/DOM/DOMDocument.mm:
- Loading branch information