[Shadow DOM] Implement Element::shadowRoot with prefix
authormorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2012 07:20:18 +0000 (07:20 +0000)
committermorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2012 07:20:18 +0000 (07:20 +0000)
commitd5bdedc7b3183fbf5cbec66f6b922cc4d987d322
tree47825e936aa25b085ce3fe5d53b3dbd8fd37a439
parent47807563e259fb0ebc2812d43bfd3c4423a8f876
[Shadow DOM] Implement Element::shadowRoot with prefix
https://bugs.webkit.org/show_bug.cgi?id=102912

Reviewed by Dimitri Glazkov.

- Added Element::shadowRoot() which return the youngest author shadow root.
- Renamed existing Node::shadowRoot() to containingShadowRoot() to avoid name shadowing.
  The name shadowRoot() is confusing anyway so this is good opportunity to rename it.

Test: fast/dom/shadow/shadow-aware-shadow-root.html

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkSelector):
* css/StyleScopeResolver.cpp:
(WebCore::StyleScopeResolver::scopeFor):
(WebCore::StyleScopeResolver::addHostRule):
* dom/Element.cpp:
(WebCore::Element::shadowRoot):
(WebCore):
* dom/Element.h:
(Element):
* dom/Element.idl:
* dom/ElementShadow.cpp:
(WebCore::ElementShadow::setShouldCollectSelectFeatureSet):
* dom/Node.cpp:
(WebCore::Node::rendererIsEditable):
(WebCore::Node::shadowHost):
(WebCore::Node::shadowAncestorNode):
(WebCore::Node::containingShadowRoot):
* dom/Node.h:
(Node):
* dom/Range.cpp:
(WebCore::Range::shadowRoot):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::insertedInto):
(WebCore::ShadowRoot::removedFrom):
* dom/ShadowRoot.h:
(WebCore::ShadowRoot::isAccessible):
* editing/TextIterator.cpp:
(WebCore::TextIterator::handleReplacedElement):
* editing/htmlediting.cpp:
(WebCore::indexForVisiblePosition):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::scopedAttributeChanged):
(WebCore::HTMLStyleElement::registerWithScopingNode):
(WebCore::HTMLStyleElement::removedFrom):
* html/shadow/ContentDistributor.cpp:
(WebCore::ContentDistributor::distribute):
* html/shadow/HTMLContentElement.cpp:
(WebCore::HTMLContentElement::parseAttribute):
(WebCore::HTMLContentElement::insertedInto):
(WebCore::HTMLContentElement::removedFrom):
* html/shadow/HTMLShadowElement.cpp:
(WebCore::HTMLShadowElement::insertedInto):
(WebCore::HTMLShadowElement::removedFrom):
* html/shadow/InsertionPoint.cpp:
(WebCore::InsertionPoint::attach):
(WebCore::InsertionPoint::detach):
(WebCore::InsertionPoint::isActive):
(WebCore::InsertionPoint::childrenChanged):
(WebCore::InsertionPoint::insertedInto):
(WebCore::InsertionPoint::removedFrom):
(WebCore::InsertionPoint::setResetStyleInheritance):
* page/EventHandler.cpp:
(WebCore::instanceAssociatedWithShadowTreeElement):
* svg/SVGElement.cpp:
(WebCore::SVGElement::correspondingElement):
(WebCore::collectInstancesForSVGElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/fast/dom/shadow/shadow-aware-shadow-root-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/shadow/shadow-aware-shadow-root.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/SelectorChecker.cpp
Source/WebCore/css/StyleScopeResolver.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Element.idl
Source/WebCore/dom/ElementShadow.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/dom/Range.cpp
Source/WebCore/dom/ShadowRoot.cpp
Source/WebCore/dom/ShadowRoot.h
Source/WebCore/editing/TextIterator.cpp
Source/WebCore/editing/htmlediting.cpp
Source/WebCore/html/HTMLStyleElement.cpp
Source/WebCore/html/shadow/ContentDistributor.cpp
Source/WebCore/html/shadow/HTMLContentElement.cpp
Source/WebCore/html/shadow/HTMLShadowElement.cpp
Source/WebCore/html/shadow/InsertionPoint.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/svg/SVGElement.cpp