Remove concept of younger and older shadow trees
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 May 2013 03:43:12 +0000 (03:43 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 May 2013 03:43:12 +0000 (03:43 +0000)
commit8422b41fd3fc33b045b9683fc072e6d4f8193ef5
treeb8cb3c5e2456768f5884e9c53a2cd50c1aa1b5fb
parentacc9dec22e90acda89ad429137952e3e227b5c6c
Remove concept of younger and older shadow trees
https://bugs.webkit.org/show_bug.cgi?id=115570

Reviewed by Andreas Kling.

Source/WebCore:

Younger and older shadow trees are an obscure corner of the Shadow DOM spec.

Support only one shadow tree per element. This simplifies many things.

* dom/ComposedShadowTreeWalker.cpp:
(WebCore::ComposedShadowTreeWalker::traverseChild):
(WebCore::ComposedShadowTreeWalker::traverseSiblingInCurrentTree):
(WebCore):
(WebCore::ComposedShadowTreeWalker::traverseParent):
(WebCore::ComposedShadowTreeWalker::traverseParentInCurrentTree):
(WebCore::ComposedShadowTreeWalker::traverseParentBackToShadowRootOrHost):
* dom/ComposedShadowTreeWalker.h:
(WebCore::ComposedShadowTreeWalker::assertPrecondition):
(ComposedShadowTreeWalker):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument):
(WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree):
(WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument):
(WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree):
(WebCore::ChildFrameDisconnector::collectFrameOwners):
(WebCore::assertConnectedSubrameCountIsConsistent):
* dom/Document.cpp:
(WebCore::Document::buildAccessKeyMap):
* dom/Element.cpp:
(WebCore::Element::authorShadowRoot):
(WebCore::Element::userAgentShadowRoot):
(WebCore::Element::ensureUserAgentShadowRoot):
* dom/Element.h:
(Element):
(WebCore::Element::hasAuthorShadowRoot):
* dom/Element.idl:
* dom/ElementShadow.cpp:
(WebCore::ElementShadow::addShadowRoot):

Allow only one ShadowRoot per ElementShadow. Remove linked list handling.

(WebCore::ElementShadow::removeAllShadowRoots):
(WebCore::ElementShadow::attach):
(WebCore::ElementShadow::detach):
(WebCore::ElementShadow::childNeedsStyleRecalc):
(WebCore::ElementShadow::needsStyleRecalc):
(WebCore::ElementShadow::recalcStyle):
(WebCore::ElementShadow::removeAllEventListeners):
* dom/ElementShadow.h:
(WebCore::ElementShadow::shadowRoot):
(ElementShadow):
(WebCore::ElementShadow::host):
(WebCore::Node::shadowRoot):
(WebCore):
* dom/Node.cpp:
(WebCore):
(WebCore::Node::showNodePathForThis):
(WebCore::traverseTreeAndMark):
(WebCore::showSubTreeAcrossFrame):
* dom/Node.h:
(Node):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::insertedInto):
* dom/ShadowRoot.h:
(ShadowRoot):

    Remove LinkedList base.

* dom/TreeScopeAdopter.cpp:
(WebCore::TreeScopeAdopter::moveTreeToNewScope):
(WebCore::TreeScopeAdopter::moveTreeToNewDocument):
* html/shadow/ContentDistributor.cpp:
(WebCore::ContentDistributor::distribute):
(WebCore::ContentDistributor::invalidate):
(WebCore::ContentDistributor::ensureSelectFeatureSet):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::unbind):
(WebCore::InspectorDOMAgent::buildObjectForNode):
* page/FocusController.cpp:
(WebCore::FocusNavigationScope::FocusNavigationScope):
(WebCore::FocusNavigationScope::focusNavigationScopeOwnedByShadowHost):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::uploadButton):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::updateReferencedText):
(WebCore::SVGTRefElement::detachTarget):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::clearResourceReferences):
(WebCore::SVGUseElement::buildShadowAndInstanceTree):
(WebCore::SVGUseElement::buildShadowTree):
* testing/Internals.cpp:
(WebCore::Internals::ensureShadowRoot):
(WebCore::Internals::shadowRoot):
(WebCore):
* testing/Internals.h:
(Internals):
* testing/Internals.idl:

LayoutTests:

* editing/text-iterator/basic-iteration-expected.txt:
* editing/text-iterator/script-tests/basic-iteration.js:
(addShadowTreeWithDivElement):
* fast/forms/resources/common-spinbutton-change-and-input-events.js:
(testSpinButtonChangeAndInputEvents):
* fast/forms/resources/common-spinbutton-click-in-iframe.js:
(getSpinButton):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149549 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/text-iterator/basic-iteration-expected.txt
LayoutTests/editing/text-iterator/script-tests/basic-iteration.js
LayoutTests/fast/forms/resources/common-spinbutton-change-and-input-events.js
LayoutTests/fast/forms/resources/common-spinbutton-click-in-iframe.js
Source/WebCore/ChangeLog
Source/WebCore/css/StyleScopeResolver.cpp
Source/WebCore/dom/ComposedShadowTreeWalker.cpp
Source/WebCore/dom/ComposedShadowTreeWalker.h
Source/WebCore/dom/ContainerNodeAlgorithms.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Element.idl
Source/WebCore/dom/ElementShadow.cpp
Source/WebCore/dom/ElementShadow.h
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/dom/ShadowRoot.cpp
Source/WebCore/dom/ShadowRoot.h
Source/WebCore/dom/TreeScopeAdopter.cpp
Source/WebCore/html/shadow/ContentDistributor.cpp
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/page/FocusController.cpp
Source/WebCore/rendering/RenderFileUploadControl.cpp
Source/WebCore/svg/SVGTRefElement.cpp
Source/WebCore/svg/SVGUseElement.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl