Changeset 154106 in webkit
- Timestamp:
- Aug 15, 2013 9:52:40 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 deleted
- 52 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r154084 r154106 1167 1167 dom/Element.cpp 1168 1168 dom/ElementRareData.cpp 1169 dom/ElementShadow.cpp1170 1169 dom/EntityReference.cpp 1171 1170 dom/ErrorEvent.cpp -
trunk/Source/WebCore/ChangeLog
r154103 r154106 1 2013-08-15 Antti Koivisto <antti@apple.com> 2 3 <https://webkit.org/b/119834> Remove ElementShadow 4 5 Reviewed by Anders Carlsson. 6 7 It is 1:1 with ShadowRoot and has virtually no functionality. What little there is can be moved to ShadowRoot or Element. 8 9 * CMakeLists.txt: 10 * GNUmakefile.list.am: 11 * Target.pri: 12 * WebCore.exp.in: 13 * WebCore.xcodeproj/project.pbxproj: 14 * css/StyleResolver.cpp: 15 (WebCore::StyleResolver::locateCousinList): 16 * css/StyleScopeResolver.cpp: 17 (WebCore::StyleScopeResolver::styleSharingCandidateMatchesHostRules): 18 (WebCore::StyleScopeResolver::matchHostRules): 19 * dom/ComposedShadowTreeWalker.cpp: 20 (WebCore::nodeCanBeDistributed): 21 (WebCore::ComposedShadowTreeWalker::traverseChild): 22 * dom/ContainerNode.cpp: 23 (WebCore::childAttachedAllowedWhenAttachingChildren): 24 * dom/ContainerNodeAlgorithms.cpp: 25 (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument): 26 (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument): 27 (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree): 28 (WebCore::assertConnectedSubrameCountIsConsistent): 29 * dom/ContainerNodeAlgorithms.h: 30 (WebCore::ChildFrameDisconnector::collectFrameOwners): 31 * dom/DOMAllInOne.cpp: 32 * dom/Document.cpp: 33 * dom/Element.cpp: 34 (WebCore::Element::~Element): 35 (WebCore::Element::attach): 36 (WebCore::Element::detach): 37 (WebCore::Element::shadowRoot): 38 (WebCore::Element::didAffectSelector): 39 (WebCore::Element::addShadowRoot): 40 (WebCore::Element::removeShadowRoot): 41 42 Move addShadowRoot and removeShadowRoot here from ElementShadow. 43 44 (WebCore::Element::createShadowRoot): 45 (WebCore::Element::authorShadowRoot): 46 (WebCore::Element::userAgentShadowRoot): 47 (WebCore::Element::ensureUserAgentShadowRoot): 48 (WebCore::Element::childrenChanged): 49 (WebCore::Element::removeAllEventListeners): 50 * dom/Element.h: 51 (WebCore::isShadowHost): 52 * dom/ElementRareData.h: 53 (WebCore::ElementRareData::clearShadowRoot): 54 (WebCore::ElementRareData::shadowRoot): 55 (WebCore::ElementRareData::setShadowRoot): 56 (WebCore::ElementRareData::~ElementRareData): 57 * dom/ElementShadow.cpp: Removed. 58 * dom/ElementShadow.h: Removed. 59 * dom/EventDispatcher.cpp: 60 * dom/EventPathWalker.cpp: 61 (WebCore::EventPathWalker::moveToParent): 62 * dom/Node.cpp: 63 (WebCore::Node::needsShadowTreeWalkerSlow): 64 * dom/NodeRenderingContext.cpp: 65 * dom/NodeRenderingContext.h: 66 * dom/ShadowRoot.cpp: 67 (WebCore::ShadowRoot::attach): 68 (WebCore::ShadowRoot::detach): 69 70 Move attached() tests from ElementShadow. 71 72 (WebCore::ShadowRoot::childrenChanged): 73 (WebCore::ShadowRoot::removeAllEventListeners): 74 75 Move here from ElementShadow. 76 77 * dom/ShadowRoot.h: 78 (WebCore::Node::shadowRoot): 79 * dom/TreeScopeAdopter.cpp: 80 * html/ColorInputType.cpp: 81 (WebCore::ColorInputType::createShadowSubtree): 82 * html/FileInputType.cpp: 83 (WebCore::FileInputType::createShadowSubtree): 84 (WebCore::FileInputType::disabledAttributeChanged): 85 (WebCore::FileInputType::multipleAttributeChanged): 86 * html/HTMLFormControlElement.cpp: 87 * html/HTMLImageElement.cpp: 88 (WebCore::HTMLImageElement::canStartSelection): 89 * html/HTMLInputElement.cpp: 90 (WebCore::HTMLInputElement::updateType): 91 * html/HTMLKeygenElement.cpp: 92 * html/HTMLMediaElement.cpp: 93 * html/HTMLTextAreaElement.cpp: 94 * html/InputType.cpp: 95 * html/RangeInputType.cpp: 96 (WebCore::RangeInputType::handleMouseDownEvent): 97 (WebCore::RangeInputType::createShadowSubtree): 98 * html/TextFieldInputType.cpp: 99 (WebCore::TextFieldInputType::createShadowSubtree): 100 * html/ValidationMessage.cpp: 101 * html/shadow/ContentDistributor.cpp: 102 (WebCore::ContentDistributor::distribute): 103 (WebCore::ContentDistributor::ensureDistribution): 104 * html/shadow/ContentDistributor.h: 105 (WebCore::ContentDistributor::isValid): 106 * html/shadow/InsertionPoint.cpp: 107 (WebCore::InsertionPoint::childrenChanged): 108 (WebCore::InsertionPoint::insertedInto): 109 (WebCore::InsertionPoint::removedFrom): 110 (WebCore::resolveReprojection): 111 * html/shadow/InsertionPoint.h: 112 (WebCore::shadowRootOfParentForDistribution): 113 * html/shadow/SliderThumbElement.cpp: 114 * inspector/InspectorDOMAgent.cpp: 115 (WebCore::InspectorDOMAgent::unbind): 116 (WebCore::InspectorDOMAgent::buildObjectForNode): 117 * page/FocusController.cpp: 118 (WebCore::FocusNavigationScope::focusNavigationScopeOwnedByShadowHost): 119 * rendering/RenderFileUploadControl.cpp: 120 (WebCore::RenderFileUploadControl::uploadButton): 121 * rendering/RenderTheme.cpp: 122 * style/StyleResolveTree.cpp: 123 (WebCore::Style::resolveTree): 124 * svg/SVGTRefElement.cpp: 125 (WebCore::SVGTRefElement::updateReferencedText): 126 (WebCore::SVGTRefElement::detachTarget): 127 * svg/SVGUseElement.cpp: 128 (WebCore::SVGUseElement::clearResourceReferences): 129 (WebCore::SVGUseElement::buildShadowAndInstanceTree): 130 (WebCore::SVGUseElement::buildShadowTree): 131 * testing/Internals.cpp: 132 (WebCore::Internals::ensureShadowRoot): 133 (WebCore::Internals::shadowRoot): 134 1 135 2013-08-15 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 136 -
trunk/Source/WebCore/GNUmakefile.list.am
r154084 r154106 2906 2906 Source/WebCore/dom/ElementRareData.cpp \ 2907 2907 Source/WebCore/dom/ElementRareData.h \ 2908 Source/WebCore/dom/ElementShadow.cpp \2909 Source/WebCore/dom/ElementShadow.h \2910 2908 Source/WebCore/dom/ElementTraversal.h \ 2911 2909 Source/WebCore/dom/Entity.h \ -
trunk/Source/WebCore/Target.pri
r154084 r154106 402 402 dom/Element.cpp \ 403 403 dom/ElementRareData.cpp \ 404 dom/ElementShadow.cpp \405 404 dom/EntityReference.cpp \ 406 405 dom/ErrorEvent.cpp \ … … 1612 1611 dom/DatasetDOMStringMap.h \ 1613 1612 dom/Element.h \ 1614 dom/ElementShadow.h \1615 1613 dom/ElementTravesal.h \ 1616 1614 dom/Entity.h \ -
trunk/Source/WebCore/WebCore.exp.in
r154088 r154106 1636 1636 __ZNK7WebCore6Widget9frameRectEv 1637 1637 __ZNK7WebCore7Element10screenRectEv 1638 __ZNK7WebCore7Element10shadowRootEv 1638 1639 __ZNK7WebCore7Element12getAttributeERKN3WTF12AtomicStringE 1639 1640 __ZNK7WebCore7Element12getAttributeERKNS_13QualifiedNameE 1640 1641 __ZNK7WebCore7Element12hasAttributeERKN3WTF12AtomicStringE 1641 1642 __ZNK7WebCore7Element13pseudoElementENS_8PseudoIdE 1642 __ZNK7WebCore7Element6shadowEv1643 1643 __ZNK7WebCore7IntRect10intersectsERKS0_ 1644 1644 __ZNK7WebCore7IntRect8containsERKS0_ -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r154084 r154106 1644 1644 578DA20F1520EBA3006141C1 /* InspectorTypeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 573D134614CE39FF0057ABCA /* InspectorTypeBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1645 1645 57B791A314C6A62900F202D1 /* ContentDistributor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57B7919F14C6A62900F202D1 /* ContentDistributor.cpp */; }; 1646 57B791A414C6A62900F202D1 /* ContentDistributor.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B791A014C6A62900F202D1 /* ContentDistributor.h */; };1646 57B791A414C6A62900F202D1 /* ContentDistributor.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B791A014C6A62900F202D1 /* ContentDistributor.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1647 1647 57B791A914C6A63300F202D1 /* HTMLContentElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57B791A714C6A63300F202D1 /* HTMLContentElement.cpp */; }; 1648 1648 57B791AA14C6A63300F202D1 /* HTMLContentElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 57B791A814C6A63300F202D1 /* HTMLContentElement.h */; }; 1649 1649 57CF497414EE36D700ECFF14 /* InsertionPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57CF497214EE36D700ECFF14 /* InsertionPoint.cpp */; }; 1650 1650 57CF497514EE36D700ECFF14 /* InsertionPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 57CF497314EE36D700ECFF14 /* InsertionPoint.h */; }; 1651 57CF4C8614F7597A00ECFF14 /* ElementShadow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 57CF4C8414F7597A00ECFF14 /* ElementShadow.cpp */; };1652 57CF4C8714F7597A00ECFF14 /* ElementShadow.h in Headers */ = {isa = PBXBuildFile; fileRef = 57CF4C8514F7597A00ECFF14 /* ElementShadow.h */; };1653 1651 5905ADBF1302F3CE00F116DF /* XMLTreeViewer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5905ADBD1302F3CE00F116DF /* XMLTreeViewer.cpp */; }; 1654 1652 5905ADC01302F3CE00F116DF /* XMLTreeViewer.h in Headers */ = {isa = PBXBuildFile; fileRef = 5905ADBE1302F3CE00F116DF /* XMLTreeViewer.h */; }; … … 8049 8047 57CF497214EE36D700ECFF14 /* InsertionPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InsertionPoint.cpp; sourceTree = "<group>"; }; 8050 8048 57CF497314EE36D700ECFF14 /* InsertionPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InsertionPoint.h; sourceTree = "<group>"; }; 8051 57CF4C8414F7597A00ECFF14 /* ElementShadow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ElementShadow.cpp; sourceTree = "<group>"; };8052 57CF4C8514F7597A00ECFF14 /* ElementShadow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementShadow.h; sourceTree = "<group>"; };8053 8049 5905ADBD1302F3CE00F116DF /* XMLTreeViewer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XMLTreeViewer.cpp; sourceTree = "<group>"; }; 8054 8050 5905ADBE1302F3CE00F116DF /* XMLTreeViewer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLTreeViewer.h; sourceTree = "<group>"; }; … … 20319 20315 4FAB48641643A66D00F70C07 /* ElementRareData.cpp */, 20320 20316 637B7ADE0E8767B800E32194 /* ElementRareData.h */, 20321 57CF4C8414F7597A00ECFF14 /* ElementShadow.cpp */,20322 57CF4C8514F7597A00ECFF14 /* ElementShadow.h */,20323 20317 E4D58EBA17B8F12800CBDCA8 /* ElementTraversal.h */, 20324 20318 A8EA7EBA0A1945D000A8EF5F /* Entity.h */, … … 21767 21761 63F5D4F70E8C4B7100C0BD04 /* ElementRareData.h in Headers */, 21768 21762 FBDB619F16D6036500BB3394 /* ElementRuleCollector.h in Headers */, 21769 57CF4C8714F7597A00ECFF14 /* ElementShadow.h in Headers */,21770 21763 A8CFF6BE0A156118000A4234 /* EllipsisBox.h in Headers */, 21771 21764 F55B3DBC1251F12D003EF269 /* EmailInputType.h in Headers */, … … 25004 24997 4FFC022D1643B726004E1638 /* ElementRareData.cpp in Sources */, 25005 24998 FBDB619B16D6032A00BB3394 /* ElementRuleCollector.cpp in Sources */, 25006 57CF4C8614F7597A00ECFF14 /* ElementShadow.cpp in Sources */,25007 24999 A8CFF6CB0A1561CD000A4234 /* EllipsisBox.cpp in Sources */, 25008 25000 F55B3DBB1251F12D003EF269 /* EmailInputType.cpp in Sources */, -
trunk/Source/WebCore/css/StyleResolver.cpp
r153927 r154106 59 59 #include "DocumentStyleSheetCollection.h" 60 60 #include "ElementRuleCollector.h" 61 #include "ElementShadow.h"62 61 #include "FontFeatureValue.h" 63 62 #include "FontValue.h" … … 492 491 && currentNode->isElementNode() && !parentElementPreventsSharing(toElement(currentNode)) 493 492 #if ENABLE(SHADOW_DOM) 494 && !toElement(currentNode)-> shadow()493 && !toElement(currentNode)->authorShadowRoot() 495 494 #endif 496 495 ) { -
trunk/Source/WebCore/css/StyleScopeResolver.cpp
r152353 r154106 34 34 #include "ContentDistributor.h" 35 35 #include "ContextFeatures.h" 36 #include "ElementShadow.h"37 36 #include "HTMLNames.h" 38 37 #include "HTMLStyleElement.h" … … 200 199 return false; 201 200 202 ElementShadow* shadow = element->shadow();203 if (!shadow)204 return false;205 206 201 // FIXME(99827): https://bugs.webkit.org/show_bug.cgi?id=99827 207 202 // add a new flag to ElementShadow and cache whether any@host @-rules are 208 203 // applied to the element or not. So we can avoid always traversing 209 204 // shadow roots. 210 if (ShadowRoot* shadowRoot = shadow->shadowRoot()) {205 if (ShadowRoot* shadowRoot = element->shadowRoot()) { 211 206 if (atHostRuleSetFor(shadowRoot)) 212 207 return true; … … 218 213 { 219 214 if (m_atHostRules.isEmpty()) 220 return;221 222 ElementShadow* shadow = element->shadow();223 if (!shadow)224 215 return; 225 216 … … 228 219 // applied to the element or not. So we can quickly exit this method 229 220 // by using the flag. 230 if (ShadowRoot* shadowRoot = shadow->shadowRoot()) {221 if (ShadowRoot* shadowRoot = element->shadowRoot()) { 231 222 if (RuleSet* ruleSet = atHostRuleSetFor(shadowRoot)) 232 223 matchedRules.append(ruleSet); -
trunk/Source/WebCore/dom/ComposedShadowTreeWalker.cpp
r150464 r154106 31 31 #include "ContentDistributor.h" 32 32 #include "Element.h" 33 #include "ElementShadow.h"34 33 #include "HTMLContentElement.h" 35 34 #include "InsertionPoint.h" … … 38 37 namespace WebCore { 39 38 40 static inline ElementShadow* shadowFor(const Node* node)41 {42 if (node && node->isElementNode())43 return toElement(node)->shadow();44 return 0;45 }46 47 39 static inline bool nodeCanBeDistributed(const Node* node) 48 40 { … … 55 47 return false; 56 48 57 if (parent->isElementNode() && toElement(parent)->shadow ())49 if (parent->isElementNode() && toElement(parent)->shadowRoot()) 58 50 return true; 59 51 … … 98 90 ASSERT(node); 99 91 if (canCrossUpperBoundary()) { 100 ElementShadow* shadow = shadowFor(node); 101 return shadow ? traverseLightChildren(shadow->shadowRoot(), direction) 92 return node->shadowRoot() ? traverseLightChildren(node->shadowRoot(), direction) 102 93 : traverseLightChildren(node, direction); 103 94 } -
trunk/Source/WebCore/dom/ContainerNode.cpp
r154047 r154106 1075 1075 return true; 1076 1076 1077 if (node->isElementNode() && toElement(node)->shadow ())1077 if (node->isElementNode() && toElement(node)->shadowRoot()) 1078 1078 return true; 1079 1079 -
trunk/Source/WebCore/dom/ContainerNodeAlgorithms.cpp
r149549 r154106 28 28 29 29 #include "Element.h" 30 #include "ElementShadow.h"31 30 #include "HTMLFrameOwnerElement.h" 32 31 … … 47 46 return; 48 47 49 if (ElementShadow* shadow = toElement(node)->shadow()) { 50 if (RefPtr<ShadowRoot> root = shadow->shadowRoot()) { 51 if (node->inDocument() && root->host() == node) 52 notifyNodeInsertedIntoDocument(root.get()); 53 } 48 if (RefPtr<ShadowRoot> root = toElement(node)->shadowRoot()) { 49 if (node->inDocument() && root->host() == node) 50 notifyNodeInsertedIntoDocument(root.get()); 54 51 } 55 52 } … … 83 80 node->document()->setCSSTarget(0); 84 81 85 if (ElementShadow* shadow = toElement(node)->shadow()) { 86 if (RefPtr<ShadowRoot> root = shadow->shadowRoot()) { 87 if (!node->inDocument() && root->host() == node) 88 notifyNodeRemovedFromDocument(root.get()); 89 } 82 if (RefPtr<ShadowRoot> root = toElement(node)->shadowRoot()) { 83 if (!node->inDocument() && root->host() == node) 84 notifyNodeRemovedFromDocument(root.get()); 90 85 } 91 86 } … … 101 96 return; 102 97 103 if (ElementShadow* shadow = toElement(node)->shadow()) { 104 if (RefPtr<ShadowRoot> root = shadow->shadowRoot()) 105 notifyNodeRemovedFromTree(root.get()); 106 } 107 } 108 109 void ChildFrameDisconnector::collectFrameOwners(ElementShadow* shadow) 110 { 111 if (ShadowRoot* root = shadow->shadowRoot()) 112 collectFrameOwners(root); 98 if (RefPtr<ShadowRoot> root = toElement(node)->shadowRoot()) 99 notifyNodeRemovedFromTree(root.get()); 113 100 } 114 101 … … 122 109 count++; 123 110 124 if (ElementShadow* shadow = toElement(node)->shadow()) { 125 if (ShadowRoot* root = shadow->shadowRoot()) 126 count += assertConnectedSubrameCountIsConsistent(root); 127 } 111 if (ShadowRoot* root = toElement(node)->shadowRoot()) 112 count += assertConnectedSubrameCountIsConsistent(root); 128 113 } 129 114 -
trunk/Source/WebCore/dom/ContainerNodeAlgorithms.h
r143089 r154106 28 28 #include "InspectorInstrumentation.h" 29 29 #include "NodeTraversal.h" 30 #include "ShadowRoot.h" 30 31 #include <wtf/Assertions.h> 31 32 … … 276 277 private: 277 278 void collectFrameOwners(Node* root); 278 void collectFrameOwners(ElementShadow*);279 279 void disconnectCollectedFrameOwners(); 280 280 … … 298 298 collectFrameOwners(child); 299 299 300 ElementShadow* shadow = root->isElementNode() ? toElement(root)->shadow() : 0;300 ShadowRoot* shadow = root->isElementNode() ? toElement(root)->shadowRoot() : 0; 301 301 if (shadow) 302 302 collectFrameOwners(shadow); -
trunk/Source/WebCore/dom/DOMAllInOne.cpp
r149262 r154106 70 70 #include "DocumentType.cpp" 71 71 #include "Element.cpp" 72 #include "ElementShadow.cpp"73 72 #include "EntityReference.cpp" 74 73 #include "ErrorEvent.cpp" -
trunk/Source/WebCore/dom/Document.cpp
r154047 r154106 60 60 #include "Editor.h" 61 61 #include "Element.h" 62 #include "ElementShadow.h"63 62 #include "ElementTraversal.h" 64 63 #include "EntityReference.h" -
trunk/Source/WebCore/dom/Element.cpp
r154054 r154106 36 36 #include "ClientRect.h" 37 37 #include "ClientRectList.h" 38 #include "ContainerNodeAlgorithms.h" 38 39 #include "CustomElementRegistry.h" 39 40 #include "DOMTokenList.h" … … 175 176 data->setPseudoElement(BEFORE, 0); 176 177 data->setPseudoElement(AFTER, 0); 177 data->clearShadow();178 removeShadowRoot(); 178 179 } 179 180 … … 1427 1428 1428 1429 // When a shadow root exists, it does the work of attaching the children. 1429 if ( ElementShadow* shadow = this->shadow()) {1430 if (ShadowRoot* shadowRoot = this->shadowRoot()) { 1430 1431 parentPusher.push(); 1431 shadow ->attach(context);1432 shadowRoot->attach(context); 1432 1433 } else if (firstChild()) 1433 1434 parentPusher.push(); … … 1496 1497 } 1497 1498 1498 if ( ElementShadow* shadow = this->shadow())1499 shadow ->detach(context);1499 if (ShadowRoot* shadowRoot = this->shadowRoot()) 1500 shadowRoot->detach(context); 1500 1501 1501 1502 // Do not remove the element's hovered and active status … … 1571 1572 } 1572 1573 1573 ElementShadow* Element::shadow() const 1574 { 1575 return hasRareData() ? elementRareData()->shadow() : 0; 1576 } 1577 1578 ElementShadow& Element::ensureShadow() 1579 { 1580 return ensureElementRareData().ensureShadow(); 1574 ShadowRoot* Element::shadowRoot() const 1575 { 1576 return hasRareData() ? elementRareData()->shadowRoot() : 0; 1581 1577 } 1582 1578 … … 1584 1580 { 1585 1581 setNeedsStyleRecalc(); 1582 } 1583 1584 void Element::addShadowRoot(PassRefPtr<ShadowRoot> newShadowRoot) 1585 { 1586 ASSERT(!shadowRoot()); 1587 1588 ShadowRoot* shadowRoot = newShadowRoot.get(); 1589 ensureElementRareData().setShadowRoot(newShadowRoot); 1590 1591 shadowRoot->setParentOrShadowHostNode(this); 1592 shadowRoot->setParentTreeScope(treeScope()); 1593 shadowRoot->distributor().didShadowBoundaryChange(this); 1594 1595 ChildNodeInsertionNotifier(this).notify(shadowRoot); 1596 1597 // Existence of shadow roots requires the host and its children to do traversal using ComposedShadowTreeWalker. 1598 setNeedsShadowTreeWalker(); 1599 1600 // FIXME(94905): ShadowHost should be reattached during recalcStyle. 1601 // Set some flag here and recreate shadow hosts' renderer in 1602 // Element::recalcStyle. 1603 if (attached()) 1604 lazyReattach(); 1605 1606 InspectorInstrumentation::didPushShadowRoot(this, shadowRoot); 1607 } 1608 1609 void Element::removeShadowRoot() 1610 { 1611 RefPtr<ShadowRoot> oldRoot = shadowRoot(); 1612 if (!oldRoot) 1613 return; 1614 InspectorInstrumentation::willPopShadowRoot(this, oldRoot.get()); 1615 document()->removeFocusedNodeOfSubtree(oldRoot.get()); 1616 1617 if (oldRoot->attached()) 1618 oldRoot->detach(Element::AttachContext()); 1619 1620 elementRareData()->clearShadowRoot(); 1621 1622 oldRoot->setParentOrShadowHostNode(0); 1623 oldRoot->setParentTreeScope(document()); 1624 1625 ChildNodeRemovalNotifier(this).notify(oldRoot.get()); 1626 1627 oldRoot->distributor().invalidateDistribution(this); 1586 1628 } 1587 1629 … … 1592 1634 1593 1635 #if ENABLE(SHADOW_DOM) 1594 if (RuntimeEnabledFeatures::authorShadowDOMForAnyElementEnabled()) 1595 return ensureShadow().addShadowRoot(this, ShadowRoot::AuthorShadowRoot); 1636 if (RuntimeEnabledFeatures::authorShadowDOMForAnyElementEnabled()) { 1637 addShadowRoot(ShadowRoot::create(document(), ShadowRoot::AuthorShadowRoot)); 1638 return shadowRoot(); 1639 } 1596 1640 #endif 1597 1641 … … 1603 1647 return 0; 1604 1648 } 1605 return ensureShadow().addShadowRoot(this, ShadowRoot::AuthorShadowRoot); 1649 addShadowRoot(ShadowRoot::create(document(), ShadowRoot::AuthorShadowRoot)); 1650 1651 return shadowRoot(); 1606 1652 } 1607 1653 1608 1654 ShadowRoot* Element::authorShadowRoot() const 1609 1655 { 1610 ElementShadow* elementShadow = shadow(); 1611 if (!elementShadow) 1612 return 0; 1613 ShadowRoot* shadowRoot = elementShadow->shadowRoot(); 1656 ShadowRoot* shadowRoot = this->shadowRoot(); 1614 1657 if (shadowRoot->type() == ShadowRoot::AuthorShadowRoot) 1615 1658 return shadowRoot; … … 1619 1662 ShadowRoot* Element::userAgentShadowRoot() const 1620 1663 { 1621 if (ElementShadow* elementShadow = shadow()) { 1622 if (ShadowRoot* shadowRoot = elementShadow->shadowRoot()) { 1623 ASSERT(shadowRoot->type() == ShadowRoot::UserAgentShadowRoot); 1624 return shadowRoot; 1625 } 1626 } 1627 1664 if (ShadowRoot* shadowRoot = this->shadowRoot()) { 1665 ASSERT(shadowRoot->type() == ShadowRoot::UserAgentShadowRoot); 1666 return shadowRoot; 1667 } 1628 1668 return 0; 1629 1669 } … … 1633 1673 ShadowRoot* shadowRoot = userAgentShadowRoot(); 1634 1674 if (!shadowRoot) { 1635 shadowRoot = ensureShadow().addShadowRoot(this, ShadowRoot::UserAgentShadowRoot); 1675 addShadowRoot(ShadowRoot::create(document(), ShadowRoot::UserAgentShadowRoot)); 1676 shadowRoot = userAgentShadowRoot(); 1636 1677 didAddUserAgentShadowRoot(shadowRoot); 1637 1678 } … … 1756 1797 checkForSiblingStyleChanges(this, renderStyle(), false, beforeChange, afterChange, childCountDelta); 1757 1798 1758 if ( ElementShadow * shadow = this->shadow())1759 shadow ->invalidateDistribution();1799 if (ShadowRoot* shadowRoot = this->shadowRoot()) 1800 shadowRoot->invalidateDistribution(); 1760 1801 } 1761 1802 … … 1763 1804 { 1764 1805 ContainerNode::removeAllEventListeners(); 1765 if ( ElementShadow* shadow = this->shadow())1766 shadow ->removeAllEventListeners();1806 if (ShadowRoot* shadowRoot = this->shadowRoot()) 1807 shadowRoot->removeAllEventListeners(); 1767 1808 } 1768 1809 -
trunk/Source/WebCore/dom/Element.h
r154054 r154106 44 44 class Element; 45 45 class ElementRareData; 46 class ElementShadow;47 46 class HTMLDocument; 48 47 class ShareableElementData; … … 433 432 void didAffectSelector(AffectedSelectorMask); 434 433 435 ElementShadow* shadow() const; 436 ElementShadow& ensureShadow(); 434 ShadowRoot* shadowRoot() const; 437 435 PassRefPtr<ShadowRoot> createShadowRoot(ExceptionCode&); 438 436 ShadowRoot* authorShadowRoot() const; … … 764 762 virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren(); 765 763 766 QualifiedName m_tagName; 764 void addShadowRoot(PassRefPtr<ShadowRoot>); 765 void removeShadowRoot(); 766 767 767 bool rareDataStyleAffectedByEmpty() const; 768 768 bool rareDataChildrenAffectedByHover() const; … … 795 795 bool isJavaScriptURLAttribute(const Attribute&) const; 796 796 797 QualifiedName m_tagName; 797 798 RefPtr<ElementData> m_elementData; 798 799 }; 799 800 800 801 inline Element* toElement(Node* node) 801 802 { … … 963 964 inline bool isShadowHost(const Node* node) 964 965 { 965 return node && node->isElementNode() && toElement(node)->shadow ();966 return node && node->isElementNode() && toElement(node)->shadowRoot(); 966 967 } 967 968 -
trunk/Source/WebCore/dom/ElementRareData.h
r153926 r154106 25 25 #include "ClassList.h" 26 26 #include "DatasetDOMStringMap.h" 27 #include "ElementShadow.h"28 27 #include "NamedNodeMap.h" 29 28 #include "NodeRareData.h" 30 29 #include "PseudoElement.h" 30 #include "ShadowRoot.h" 31 31 #include "StyleInheritedData.h" 32 32 #include <wtf/OwnPtr.h> … … 97 97 void setChildIndex(unsigned index) { m_childIndex = index; } 98 98 99 void clearShadow() { m_shadow = nullptr; } 100 ElementShadow* shadow() const { return m_shadow.get(); } 101 ElementShadow& ensureShadow() 102 { 103 if (!m_shadow) 104 m_shadow = ElementShadow::create(); 105 return *m_shadow; 106 } 99 void clearShadowRoot() { m_shadowRoot = nullptr; } 100 ShadowRoot* shadowRoot() const { return m_shadowRoot.get(); } 101 void setShadowRoot(PassRefPtr<ShadowRoot> shadowRoot) { m_shadowRoot = shadowRoot; } 107 102 108 103 NamedNodeMap* attributeMap() const { return m_attributeMap.get(); } … … 172 167 OwnPtr<DatasetDOMStringMap> m_dataset; 173 168 OwnPtr<ClassList> m_classList; 174 OwnPtr<ElementShadow> m_shadow;169 RefPtr<ShadowRoot> m_shadowRoot; 175 170 OwnPtr<NamedNodeMap> m_attributeMap; 176 171 … … 220 215 inline ElementRareData::~ElementRareData() 221 216 { 222 ASSERT(!m_shadow );217 ASSERT(!m_shadowRoot); 223 218 ASSERT(!m_generatedBefore); 224 219 ASSERT(!m_generatedAfter); -
trunk/Source/WebCore/dom/EventDispatcher.cpp
r150714 r154106 28 28 29 29 #include "ContainerNode.h" 30 #include "ElementShadow.h"31 30 #include "EventContext.h" 32 31 #include "EventDispatchMediator.h" -
trunk/Source/WebCore/dom/EventPathWalker.cpp
r149628 r154106 53 53 ASSERT(m_node); 54 54 ASSERT(m_distributedNode); 55 if ( ElementShadow* shadow = shadowOfParent(m_node)) {56 if (InsertionPoint* insertionPoint = shadow ->distributor().findInsertionPointFor(m_distributedNode)) {55 if (ShadowRoot* shadowRoot = m_node->parentElement() ? m_node->parentElement()->shadowRoot() : 0) { 56 if (InsertionPoint* insertionPoint = shadowRoot->distributor().findInsertionPointFor(m_distributedNode)) { 57 57 m_node = insertionPoint; 58 58 m_isVisitingInsertionPointInReprojection = true; -
trunk/Source/WebCore/dom/Node.cpp
r154047 r154106 50 50 #include "Element.h" 51 51 #include "ElementRareData.h" 52 #include "ElementShadow.h"53 52 #include "ElementTraversal.h" 54 53 #include "Event.h" … … 1049 1048 bool Node::needsShadowTreeWalkerSlow() const 1050 1049 { 1051 return (isShadowRoot() || (isElementNode() && (isInsertionPoint() || isPseudoElement() || toElement(this)->hasPseudoElements() || toElement(this)->shadow ())));1050 return (isShadowRoot() || (isElementNode() && (isInsertionPoint() || isPseudoElement() || toElement(this)->hasPseudoElements() || toElement(this)->shadowRoot()))); 1052 1051 } 1053 1052 -
trunk/Source/WebCore/dom/NodeRenderingContext.cpp
r154047 r154106 29 29 #include "ContainerNode.h" 30 30 #include "ContentDistributor.h" 31 #include "ElementShadow.h"32 31 #include "FlowThreadController.h" 33 32 #include "HTMLContentElement.h" -
trunk/Source/WebCore/dom/NodeRenderingContext.h
r154047 r154106 42 42 class RenderObject; 43 43 class RenderStyle; 44 class ElementShadow;45 44 46 45 class NodeRenderingContext { -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r154047 r154106 29 29 30 30 #include "ContentDistributor.h" 31 #include "ElementShadow.h"32 31 #include "ElementTraversal.h" 33 32 #include "HistogramSupport.h" … … 42 41 struct SameSizeAsShadowRoot : public DocumentFragment, public TreeScope { 43 42 unsigned countersAndFlags[1]; 43 ContentDistributor distributor; 44 44 }; 45 45 … … 149 149 void ShadowRoot::attach(const Element::AttachContext& context) 150 150 { 151 if (attached()) 152 return; 151 153 StyleResolver& styleResolver = document()->ensureStyleResolver(); 152 154 styleResolver.pushParentShadowRoot(this); … … 160 162 } 161 163 if (child->isElementNode()) 162 toElement(child)->attach(c ontext);164 toElement(child)->attach(childrenContext); 163 165 } 164 166 … … 171 173 void ShadowRoot::detach(const Element::AttachContext& context) 172 174 { 175 if (!attached()) 176 return; 173 177 Element::AttachContext childrenContext(context); 174 178 childrenContext.resolvedStyle = 0; … … 191 195 192 196 ContainerNode::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); 193 owner()->invalidateDistribution();197 invalidateDistribution(); 194 198 } 195 199 … … 207 211 } 208 212 209 } 213 void ShadowRoot::removeAllEventListeners() 214 { 215 DocumentFragment::removeAllEventListeners(); 216 for (Node* node = firstChild(); node; node = NodeTraversal::next(node)) 217 node->removeAllEventListeners(); 218 } 219 220 } -
trunk/Source/WebCore/dom/ShadowRoot.h
r154047 r154106 29 29 30 30 #include "ContainerNode.h" 31 #include "ContentDistributor.h" 31 32 #include "Document.h" 32 33 #include "DocumentFragment.h" … … 36 37 37 38 namespace WebCore { 38 39 class ElementShadow;40 39 41 40 class ShadowRoot FINAL : public DocumentFragment, public TreeScope { … … 63 62 64 63 Element* host() const { return toElement(parentOrShadowHostNode()); } 65 ElementShadow* owner() const { return host() ? host()->shadow() : 0; }66 64 67 65 String innerHTML() const; … … 79 77 80 78 PassRefPtr<Node> cloneNode(bool, ExceptionCode&); 79 80 ContentDistributor& distributor() { return m_distributor; } 81 void invalidateDistribution() { m_distributor.invalidateDistribution(host()); } 82 83 void removeAllEventListeners(); 81 84 82 85 private: … … 97 100 unsigned m_resetStyleInheritance : 1; 98 101 unsigned m_type : 1; 102 103 ContentDistributor m_distributor; 99 104 }; 100 105 … … 115 120 } 116 121 122 inline ShadowRoot* Node::shadowRoot() const 123 { 124 if (!isElementNode()) 125 return 0; 126 return toElement(this)->shadowRoot(); 127 } 128 117 129 } // namespace 118 130 -
trunk/Source/WebCore/dom/TreeScopeAdopter.cpp
r149549 r154106 29 29 #include "Document.h" 30 30 #include "ElementRareData.h" 31 #include "ElementShadow.h"32 31 #include "NodeRareData.h" 33 32 #include "NodeTraversal.h" -
trunk/Source/WebCore/html/ColorInputType.cpp
r153541 r154106 36 36 #include "Chrome.h" 37 37 #include "Color.h" 38 #include "ElementShadow.h"39 38 #include "HTMLDataListElement.h" 40 39 #include "HTMLDivElement.h" … … 118 117 void ColorInputType::createShadowSubtree() 119 118 { 120 ASSERT(element()->shadow ());119 ASSERT(element()->shadowRoot()); 121 120 122 121 Document* document = element()->document(); -
trunk/Source/WebCore/html/FileInputType.cpp
r150805 r154106 25 25 #include "Chrome.h" 26 26 #include "DragData.h" 27 #include "ElementShadow.h"28 27 #include "Event.h" 29 28 #include "File.h" … … 314 313 void FileInputType::createShadowSubtree() 315 314 { 316 ASSERT(element()->shadow ());315 ASSERT(element()->shadowRoot()); 317 316 element()->userAgentShadowRoot()->appendChild(element()->multiple() ? UploadButtonElement::createForMultiple(element()->document()): UploadButtonElement::create(element()->document()), IGNORE_EXCEPTION); 318 317 } … … 320 319 void FileInputType::disabledAttributeChanged() 321 320 { 322 ASSERT(element()->shadow ());321 ASSERT(element()->shadowRoot()); 323 322 UploadButtonElement* button = static_cast<UploadButtonElement*>(element()->userAgentShadowRoot()->firstChild()); 324 323 if (button) … … 328 327 void FileInputType::multipleAttributeChanged() 329 328 { 330 ASSERT(element()->shadow ());329 ASSERT(element()->shadowRoot()); 331 330 UploadButtonElement* button = static_cast<UploadButtonElement*>(element()->userAgentShadowRoot()->firstChild()); 332 331 if (button) -
trunk/Source/WebCore/html/HTMLFormControlElement.cpp
r153783 r154106 27 27 28 28 #include "Attribute.h" 29 #include "ElementShadow.h"30 29 #include "Event.h" 31 30 #include "EventHandler.h" -
trunk/Source/WebCore/html/HTMLImageElement.cpp
r153970 r154106 179 179 bool HTMLImageElement::canStartSelection() const 180 180 { 181 if (shadow ())181 if (shadowRoot()) 182 182 return HTMLElement::canStartSelection(); 183 183 -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r153826 r154106 36 36 #include "Document.h" 37 37 #include "Editor.h" 38 #include "ElementShadow.h"39 38 #include "EventNames.h" 40 39 #include "ExceptionCode.h" … … 536 535 } 537 536 538 if ( ElementShadow* elementShadow = shadowOfParentForDistribution(this))539 elementShadow->invalidateDistribution();537 if (ShadowRoot* shadowRoot = shadowRootOfParentForDistribution(this)) 538 shadowRoot->invalidateDistribution(); 540 539 541 540 setChangedSinceLastFormControlChangeEvent(false); -
trunk/Source/WebCore/html/HTMLKeygenElement.cpp
r153926 r154106 28 28 #include "Attribute.h" 29 29 #include "Document.h" 30 #include "ElementShadow.h"31 30 #include "FormDataList.h" 32 31 #include "HTMLNames.h" -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r153942 r154106 41 41 #include "DiagnosticLoggingKeys.h" 42 42 #include "DocumentLoader.h" 43 #include "ElementShadow.h"44 43 #include "ElementTraversal.h" 45 44 #include "Event.h" -
trunk/Source/WebCore/html/HTMLTextAreaElement.cpp
r151282 r154106 32 32 #include "Document.h" 33 33 #include "Editor.h" 34 #include "ElementShadow.h"35 34 #include "Event.h" 36 35 #include "EventHandler.h" -
trunk/Source/WebCore/html/InputType.cpp
r153647 r154106 38 38 #include "DateTimeInputType.h" 39 39 #include "DateTimeLocalInputType.h" 40 #include "ElementShadow.h"41 40 #include "EmailInputType.h" 42 41 #include "ExceptionCode.h" -
trunk/Source/WebCore/html/RangeInputType.cpp
r151719 r154106 34 34 35 35 #include "AXObjectCache.h" 36 #include "ElementShadow.h"37 36 #include "ExceptionCodePlaceholder.h" 38 37 #include "HTMLDivElement.h" … … 159 158 if (event->button() != LeftButton || !targetNode) 160 159 return; 161 ASSERT(element()->shadow ());160 ASSERT(element()->shadowRoot()); 162 161 if (targetNode != element() && !targetNode->isDescendantOf(element()->userAgentShadowRoot())) 163 162 return; … … 257 256 void RangeInputType::createShadowSubtree() 258 257 { 259 ASSERT(element()->shadow ());258 ASSERT(element()->shadowRoot()); 260 259 261 260 Document* document = element()->document(); -
trunk/Source/WebCore/html/TextFieldInputType.cpp
r150140 r154106 36 36 #include "Chrome.h" 37 37 #include "Editor.h" 38 #include "ElementShadow.h"39 38 #include "FormDataList.h" 40 39 #include "Frame.h" … … 226 225 void TextFieldInputType::createShadowSubtree() 227 226 { 228 ASSERT(element()->shadow ());227 ASSERT(element()->shadowRoot()); 229 228 230 229 ASSERT(!m_innerText); -
trunk/Source/WebCore/html/ValidationMessage.cpp
r153927 r154106 34 34 #include "CSSPropertyNames.h" 35 35 #include "CSSValueKeywords.h" 36 #include "ElementShadow.h"37 36 #include "ExceptionCodePlaceholder.h" 38 37 #include "HTMLBRElement.h" -
trunk/Source/WebCore/html/shadow/ContentDistributor.cpp
r154047 r154106 28 28 #include "ContentDistributor.h" 29 29 30 #include "ElementShadow.h"31 30 #include "ElementTraversal.h" 32 31 #include "HTMLContentElement.h" … … 77 76 ASSERT(needsDistribution()); 78 77 ASSERT(m_nodeToInsertionPoint.isEmpty()); 79 ASSERT(!host->containingShadowRoot() || host->containingShadowRoot()-> owner()->distributor().isValid());78 ASSERT(!host->containingShadowRoot() || host->containingShadowRoot()->distributor().isValid()); 80 79 81 80 m_validity = Valid; … … 131 130 ASSERT(shadowRoot); 132 131 133 Vector< ElementShadow*, 8> elementShadows;132 Vector<ShadowRoot*, 8> shadowRoots; 134 133 for (Element* current = shadowRoot->host(); current; current = current->shadowHost()) { 135 ElementShadow* elementShadow = current->shadow();136 if (! elementShadow->distributor().needsDistribution())134 ShadowRoot* currentRoot = current->shadowRoot(); 135 if (!currentRoot->distributor().needsDistribution()) 137 136 break; 138 139 elementShadows.append(elementShadow); 137 shadowRoots.append(currentRoot); 140 138 } 141 139 142 for (size_t i = elementShadows.size(); i > 0; --i)143 elementShadows[i - 1]->distributor().distribute(elementShadows[i - 1]->host());140 for (size_t i = shadowRoots.size(); i > 0; --i) 141 shadowRoots[i - 1]->distributor().distribute(shadowRoots[i - 1]->host()); 144 142 } 145 146 143 147 144 void ContentDistributor::invalidateDistribution(Element* host) -
trunk/Source/WebCore/html/shadow/ContentDistributor.h
r150480 r154106 68 68 69 69 static void ensureDistribution(ShadowRoot*); 70 void distribute(Element* host); 71 bool needsDistribution() const; 70 72 71 73 private: 72 74 const Vector<RefPtr<InsertionPoint> >& ensureInsertionPointList(ShadowRoot*); 73 75 74 void distribute(Element* host);75 76 bool invalidate(Element* host); 76 77 77 78 void setValidity(Validity validity) { m_validity = validity; } 78 79 bool isValid() const { return m_validity == Valid; } 79 bool needsDistribution() const;80 80 bool needsInvalidation() const { return m_validity != Invalidated; } 81 81 -
trunk/Source/WebCore/html/shadow/InsertionPoint.cpp
r154047 r154106 32 32 #include "InsertionPoint.h" 33 33 34 #include "ElementShadow.h"35 34 #include "HTMLNames.h" 36 35 #include "QualifiedName.h" … … 119 118 HTMLElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta); 120 119 if (ShadowRoot* root = containingShadowRoot()) 121 if (ElementShadow* rootOwner = root->owner()) 122 rootOwner->invalidateDistribution(); 120 root->invalidateDistribution(); 123 121 } 124 122 … … 128 126 129 127 if (ShadowRoot* root = containingShadowRoot()) { 130 if (ElementShadow* rootOwner = root->owner()) { 131 rootOwner->distributor().didShadowBoundaryChange(root->host()); 132 rootOwner->distributor().invalidateInsertionPointList(); 133 } 128 root->distributor().didShadowBoundaryChange(root->host()); 129 root->distributor().invalidateInsertionPointList(); 134 130 } 135 131 … … 143 139 root = insertionPoint->containingShadowRoot(); 144 140 145 // host can be null when removedFrom() is called from ElementShadow destructor. 146 ElementShadow* rootOwner = root ? root->owner() : 0; 147 if (rootOwner) { 148 rootOwner->invalidateDistribution(); 149 rootOwner->distributor().invalidateInsertionPointList(); 141 if (root && root->host()) { 142 root->invalidateDistribution(); 143 root->distributor().invalidateInsertionPointList(); 150 144 } 151 145 … … 218 212 InsertionPoint* resolveReprojection(const Node* projectedNode) 219 213 { 220 if ( ElementShadow* shadow = shadowOfParentForDistribution(projectedNode)) {214 if (ShadowRoot* shadowRoot = shadowRootOfParentForDistribution(projectedNode)) { 221 215 if (ShadowRoot* root = projectedNode->containingShadowRoot()) 222 216 ContentDistributor::ensureDistribution(root); 223 return shadow ->distributor().findInsertionPointFor(projectedNode);217 return shadowRoot->distributor().findInsertionPointFor(projectedNode); 224 218 } 225 219 return 0; -
trunk/Source/WebCore/html/shadow/InsertionPoint.h
r151282 r154106 33 33 34 34 #include "ContentDistributor.h" 35 #include "ElementShadow.h"36 35 #include "HTMLElement.h" 37 36 #include "HTMLNames.h" … … 138 137 } 139 138 140 inline ElementShadow* shadowOfParentForDistribution(const Node* node)139 inline ShadowRoot* shadowRootOfParentForDistribution(const Node* node) 141 140 { 142 141 ASSERT(node); 143 142 if (Element* parent = parentElementForDistribution(node)) 144 return parent->shadow ();143 return parent->shadowRoot(); 145 144 146 145 return 0; -
trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp
r151947 r154106 35 35 36 36 #include "CSSValueKeywords.h" 37 #include "ElementShadow.h"38 37 #include "Event.h" 39 38 #include "EventHandler.h" -
trunk/Source/WebCore/inspector/InspectorDOMAgent.cpp
r153826 r154106 54 54 #include "DocumentType.h" 55 55 #include "Element.h" 56 #include "ElementShadow.h"57 56 #include "Event.h" 58 57 #include "EventContext.h" … … 358 357 359 358 if (node->isElementNode()) { 360 if (ElementShadow* shadow = toElement(node)->shadow()) { 361 if (ShadowRoot* root = shadow->shadowRoot()) 362 unbind(root, nodesMap); 363 } 359 if (ShadowRoot* root = toElement(node)->shadowRoot()) 360 unbind(root, nodesMap); 364 361 } 365 362 … … 1416 1413 } 1417 1414 1418 ElementShadow* shadow = element->shadow(); 1419 if (shadow) { 1415 if (ShadowRoot* root = element->shadowRoot()) { 1420 1416 RefPtr<TypeBuilder::Array<TypeBuilder::DOM::Node> > shadowRoots = TypeBuilder::Array<TypeBuilder::DOM::Node>::create(); 1421 if (ShadowRoot* root = shadow->shadowRoot()) 1422 shadowRoots->addItem(buildObjectForNode(root, 0, nodesMap)); 1417 shadowRoots->addItem(buildObjectForNode(root, 0, nodesMap)); 1423 1418 value->setShadowRoots(shadowRoots); 1424 1419 } -
trunk/Source/WebCore/page/FocusController.cpp
r153939 r154106 34 34 #include "EditorClient.h" 35 35 #include "Element.h" 36 #include "ElementShadow.h"37 36 #include "ElementTraversal.h" 38 37 #include "Event.h" … … 104 103 { 105 104 ASSERT(isShadowHost(node)); 106 return FocusNavigationScope(toElement(node)->shadow ()->shadowRoot());105 return FocusNavigationScope(toElement(node)->shadowRoot()); 107 106 } 108 107 -
trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp
r152149 r154106 22 22 #include "RenderFileUploadControl.h" 23 23 24 #include "ElementShadow.h"25 24 #include "FileList.h" 26 25 #include "Font.h" … … 229 228 HTMLInputElement* input = toHTMLInputElement(node()); 230 229 231 ASSERT(input->shadow ());232 233 Node* buttonNode = input->shadow ()->shadowRoot()->firstChild();230 ASSERT(input->shadowRoot()); 231 232 Node* buttonNode = input->shadowRoot()->firstChild(); 234 233 return buttonNode && buttonNode->isHTMLElement() && isHTMLInputElement(buttonNode) ? toHTMLInputElement(buttonNode) : 0; 235 234 } -
trunk/Source/WebCore/rendering/RenderTheme.cpp
r152208 r154106 56 56 57 57 #if ENABLE(DATALIST_ELEMENT) 58 #include "ElementShadow.h"59 58 #include "HTMLCollection.h" 60 59 #include "HTMLDataListElement.h" -
trunk/Source/WebCore/style/StyleResolveTree.cpp
r154047 r154106 241 241 RenderStyle* currentStyle = current->renderStyle(); 242 242 243 if ( ElementShadow* shadow = current->shadow()) {244 if (change >= Inherit || shadow ->childNeedsStyleRecalc() || shadow->needsStyleRecalc()) {243 if (ShadowRoot* shadowRoot = current->shadowRoot()) { 244 if (change >= Inherit || shadowRoot->childNeedsStyleRecalc() || shadowRoot->needsStyleRecalc()) { 245 245 parentPusher.push(); 246 resolveShadowTree(shadow ->shadowRoot(), currentStyle, change);246 resolveShadowTree(shadowRoot, currentStyle, change); 247 247 } 248 248 } -
trunk/Source/WebCore/svg/SVGTRefElement.cpp
r151800 r154106 25 25 #include "SVGTRefElement.h" 26 26 27 #include "ElementShadow.h"28 27 #include "EventListener.h" 29 28 #include "EventNames.h" … … 151 150 textContent = target->textContent(); 152 151 153 ASSERT(shadow ());154 ShadowRoot* root = shadow ()->shadowRoot();152 ASSERT(shadowRoot()); 153 ShadowRoot* root = shadowRoot(); 155 154 if (!root->firstChild()) 156 155 root->appendChild(Text::create(document(), textContent), ASSERT_NO_EXCEPTION); … … 168 167 String emptyContent; 169 168 170 ASSERT(shadow ());171 Node* container = shadow ()->shadowRoot()->firstChild();169 ASSERT(shadowRoot()); 170 Node* container = shadowRoot()->firstChild(); 172 171 if (container) 173 172 container->setTextContent(emptyContent, IGNORE_EXCEPTION); -
trunk/Source/WebCore/svg/SVGUseElement.cpp
r153939 r154106 33 33 #include "CachedSVGDocument.h" 34 34 #include "Document.h" 35 #include "ElementShadow.h"36 35 #include "ElementTraversal.h" 37 36 #include "Event.h" … … 389 388 { 390 389 // FIXME: We should try to optimize this, to at least allow partial reclones. 391 if (ShadowRoot* shadowTreeRootElement = shadow ()->shadowRoot())390 if (ShadowRoot* shadowTreeRootElement = shadowRoot()) 392 391 shadowTreeRootElement->removeChildren(); 393 392 … … 481 480 ASSERT(m_targetElementInstance->correspondingElement() == target); 482 481 483 ShadowRoot* shadowTreeRootElement = shadow ()->shadowRoot();482 ShadowRoot* shadowTreeRootElement = shadowRoot(); 484 483 ASSERT(shadowTreeRootElement); 485 484 … … 703 702 removeDisallowedElementsFromSubtree(newChild.get()); 704 703 705 shadow ()->shadowRoot()->appendChild(newChild.release());704 shadowRoot()->appendChild(newChild.release()); 706 705 } 707 706 -
trunk/Source/WebCore/testing/Internals.cpp
r153838 r154106 45 45 #include "Editor.h" 46 46 #include "Element.h" 47 #include "ElementShadow.h"48 47 #include "EventHandler.h" 49 48 #include "ExceptionCode.h" … … 628 627 } 629 628 630 if ( ElementShadow* shadow = host->shadow())631 return shadow ->shadowRoot();629 if (ShadowRoot* shadowRoot = host->shadowRoot()) 630 return shadowRoot; 632 631 633 632 return host->createShadowRoot(ec).get(); … … 649 648 return 0; 650 649 } 651 if (ElementShadow* shadow = host->shadow()) 652 return shadow->shadowRoot(); 653 return 0; 650 return host->shadowRoot(); 654 651 } 655 652 -
trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in
r154102 r154106 303 303 symbolWithPointer(?settings@Document@WebCore@@QBEPAVSettings@2@XZ, ?settings@Document@WebCore@@QEBAPEAVSettings@2@XZ) 304 304 symbolWithPointer(?settings@Frame@WebCore@@QBEPAVSettings@2@XZ, ?settings@Frame@WebCore@@QEBAPEAVSettings@2@XZ) 305 symbolWithPointer(?shadow@Element@WebCore@@QBEPAVElementShadow@2@XZ, ?shadow@Element@WebCore@@QEBAPEAVElementShadow@2@XZ)306 305 symbolWithPointer(?substring@String@WTF@@QBE?AV12@II@Z, ?substring@String@WTF@@QEBA?AV12@II@Z) 307 306 symbolWithPointer(?suggestedValue@HTMLInputElement@WebCore@@QBEABVString@WTF@@XZ, ?suggestedValue@HTMLInputElement@WebCore@@QEBAAEBVString@WTF@@XZ) -
trunk/Source/WebKit/blackberry/WebCoreSupport/SuggestionBoxHandler.cpp
r144063 r154106 36 36 #include "CSSValueKeywords.h" 37 37 #include "DOMTokenList.h" 38 #include "ElementShadow.h"39 38 #include "ExceptionCodePlaceholder.h" 40 39 #include "HTMLCollection.h"
Note: See TracChangeset
for help on using the changeset viewer.