Changeset 189239 in webkit
- Timestamp:
- Sep 1, 2015 5:54:43 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r189230 r189239 1 2015-09-01 Ryosuke Niwa <rniwa@webkit.org> 2 3 Rename ShadowRoot::hostElement to shadowRoot::host to match the latest spec 4 https://bugs.webkit.org/show_bug.cgi?id=148694 5 6 Reviewed by Chris Dumez. 7 8 Renamed ShadowRoot::hostElement to ShadowRoot::host to match the latest shadow DOM spec. 9 This will help us implementing shadow DOM in near future. 10 11 * dom/ContainerNodeAlgorithms.cpp: 12 (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument): 13 (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument): 14 * dom/Element.cpp: 15 (WebCore::Element::addShadowRoot): 16 (WebCore::Element::removeShadowRoot): 17 * dom/EventDispatcher.cpp: 18 (WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost): 19 (WebCore::EventRelatedNodeResolver::findHostOfTreeScopeInTargetTreeScope): 20 (WebCore::shouldEventCrossShadowBoundary): 21 (WebCore::EventPath::EventPath): 22 * dom/Node.cpp: 23 (WebCore::Node::shadowHost): 24 (WebCore::Node::deprecatedShadowAncestorNode): 25 (WebCore::Node::parentOrShadowHostElement): 26 * dom/NodeRenderingTraversal.cpp: 27 (WebCore::NodeRenderingTraversal::traverseParent): 28 * dom/ShadowRoot.cpp: 29 (WebCore::ShadowRoot::setInnerHTML): 30 (WebCore::ShadowRoot::setResetStyleInheritance): 31 * dom/ShadowRoot.h: 32 (WebCore::Node::parentOrShadowHostNode): 33 * dom/Text.cpp: 34 (WebCore::isSVGShadowText): 35 * dom/TreeScope.cpp: 36 (WebCore::TreeScope::focusedElement): 37 * html/shadow/ContentDistributor.cpp: 38 (WebCore::ContentDistributor::ensureDistribution): 39 * html/shadow/InsertionPoint.cpp: 40 (WebCore::InsertionPoint::insertedInto): 41 (WebCore::InsertionPoint::removedFrom): 42 * page/DragController.cpp: 43 (WebCore::asFileInput): 44 * page/EventHandler.cpp: 45 (WebCore::EventHandler::handleMousePressEvent): 46 * page/FocusController.cpp: 47 (WebCore::FocusNavigationScope::owner): 48 * rendering/RenderLayer.cpp: 49 (WebCore::rendererForScrollbar): 50 * style/StyleResolveTree.cpp: 51 (WebCore::Style::attachShadowRoot): 52 (WebCore::Style::resolveShadowTree): 53 * svg/SVGElement.cpp: 54 (WebCore::SVGElement::correspondingUseElement): 55 1 56 2015-09-01 Chris Dumez <cdumez@apple.com> 2 57 -
trunk/Source/WebCore/dom/ContainerNodeAlgorithms.cpp
r185435 r189239 45 45 46 46 if (RefPtr<ShadowRoot> root = downcast<Element>(node).shadowRoot()) { 47 if (node.inDocument() && root->host Element() == &node)47 if (node.inDocument() && root->host() == &node) 48 48 notifyNodeInsertedIntoDocument(*root, postInsertionNotificationTargets); 49 49 } … … 79 79 80 80 if (RefPtr<ShadowRoot> root = downcast<Element>(node).shadowRoot()) { 81 if (!node.inDocument() && root->host Element() == &node)81 if (!node.inDocument() && root->host() == &node) 82 82 notifyNodeRemovedFromDocument(*root.get()); 83 83 } -
trunk/Source/WebCore/dom/Element.cpp
r188920 r189239 1632 1632 ensureElementRareData().setShadowRoot(WTF::move(newShadowRoot)); 1633 1633 1634 shadowRoot.setHost Element(this);1634 shadowRoot.setHost(this); 1635 1635 shadowRoot.setParentTreeScope(&treeScope()); 1636 1636 shadowRoot.distributor().didShadowBoundaryChange(this); … … 1661 1661 elementRareData()->clearShadowRoot(); 1662 1662 1663 oldRoot->setHost Element(0);1663 oldRoot->setHost(0); 1664 1664 oldRoot->setParentTreeScope(&document()); 1665 1665 -
trunk/Source/WebCore/dom/EventDispatcher.cpp
r185232 r189239 144 144 if (m_currentTreeScope) { 145 145 ASSERT(is<ShadowRoot>(m_currentTreeScope->rootNode())); 146 ASSERT(&newTarget == downcast<ShadowRoot>(m_currentTreeScope->rootNode()).host Element());146 ASSERT(&newTarget == downcast<ShadowRoot>(m_currentTreeScope->rootNode()).host()); 147 147 ASSERT(m_currentTreeScope->parentTreeScope() == &newTreeScope); 148 148 } … … 185 185 } 186 186 if (is<ShadowRoot>(scope->rootNode())) 187 previousHost = downcast<ShadowRoot>(scope->rootNode()).host Element();187 previousHost = downcast<ShadowRoot>(scope->rootNode()).host(); 188 188 else 189 189 ASSERT_WITH_SECURITY_IMPLICATION(!scope->parentTreeScope()); … … 386 386 // FIXME: We assume that if the full screen element is a media element that it's 387 387 // the video-only full screen. Both here and elsewhere. But that is probably wrong. 388 if (element->isMediaElement() && shadowRoot.host Element() == element)388 if (element->isMediaElement() && shadowRoot.host() == element) 389 389 return false; 390 390 } … … 445 445 if (!node || !shouldEventCrossShadowBoundary(event, downcast<ShadowRoot>(*node), *target)) 446 446 return; 447 node = downcast<ShadowRoot>(*node).host Element();447 node = downcast<ShadowRoot>(*node).host(); 448 448 } 449 449 } -
trunk/Source/WebCore/dom/Node.cpp
r188917 r189239 1035 1035 { 1036 1036 if (ShadowRoot* root = containingShadowRoot()) 1037 return root->host Element();1037 return root->host(); 1038 1038 return 0; 1039 1039 } … … 1042 1042 { 1043 1043 if (ShadowRoot* root = containingShadowRoot()) 1044 return root->host Element();1044 return root->host(); 1045 1045 1046 1046 return const_cast<Node*>(this); … … 1087 1087 1088 1088 if (is<ShadowRoot>(*parent)) 1089 return downcast<ShadowRoot>(*parent).host Element();1089 return downcast<ShadowRoot>(*parent).host(); 1090 1090 1091 1091 if (!is<Element>(*parent)) -
trunk/Source/WebCore/dom/NodeRenderingTraversal.cpp
r174225 r189239 134 134 135 135 if (is<ShadowRoot>(*parent)) 136 return shadowRootCrossing == CrossShadowRoot ? downcast<ShadowRoot>(parent)->host Element() : parent;136 return shadowRootCrossing == CrossShadowRoot ? downcast<ShadowRoot>(parent)->host() : parent; 137 137 138 138 if (is<InsertionPoint>(*parent)) { -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r179143 r189239 92 92 } 93 93 94 if (RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(markup, host Element(), AllowScriptingContent, ec))94 if (RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(markup, host(), AllowScriptingContent, ec)) 95 95 replaceChildrenWithFragment(*this, fragment.release(), ec); 96 96 } … … 118 118 if (value != m_resetStyleInheritance) { 119 119 m_resetStyleInheritance = value; 120 if (host Element())120 if (host()) 121 121 setNeedsStyleRecalc(); 122 122 } -
trunk/Source/WebCore/dom/ShadowRoot.h
r177751 r189239 54 54 void setResetStyleInheritance(bool); 55 55 56 Element* host Element() const { return m_hostElement; }57 void setHost Element(Element* hostElement) { m_hostElement = hostElement; }56 Element* host() const { return m_hostElement; } 57 void setHost(Element* hostElement) { m_hostElement = hostElement; } 58 58 59 59 String innerHTML() const; … … 67 67 68 68 ContentDistributor& distributor() { return m_distributor; } 69 void invalidateDistribution() { m_distributor.invalidateDistribution( hostElement()); }69 void invalidateDistribution() { m_distributor.invalidateDistribution(m_hostElement); } 70 70 71 71 virtual void removeAllEventListeners() override; … … 80 80 81 81 // FIXME: This shouldn't happen. https://bugs.webkit.org/show_bug.cgi?id=88834 82 bool isOrphan() const { return ! hostElement(); }82 bool isOrphan() const { return !m_hostElement; } 83 83 84 84 unsigned m_resetStyleInheritance : 1; … … 106 106 ASSERT(isMainThreadOrGCThread()); 107 107 if (is<ShadowRoot>(*this)) 108 return downcast<ShadowRoot>(*this).host Element();108 return downcast<ShadowRoot>(*this).host(); 109 109 return parentNode(); 110 110 } -
trunk/Source/WebCore/dom/Text.cpp
r187022 r189239 176 176 Node* parentNode = text->parentNode(); 177 177 ASSERT(parentNode); 178 return is<ShadowRoot>(*parentNode) && downcast<ShadowRoot>(*parentNode).host Element()->hasTagName(SVGNames::trefTag);178 return is<ShadowRoot>(*parentNode) && downcast<ShadowRoot>(*parentNode).host()->hasTagName(SVGNames::trefTag); 179 179 } 180 180 -
trunk/Source/WebCore/dom/TreeScope.cpp
r185109 r189239 314 314 TreeScope* treeScope = &element->treeScope(); 315 315 while (treeScope != this && treeScope != &document) { 316 element = downcast<ShadowRoot>(treeScope->rootNode()).host Element();316 element = downcast<ShadowRoot>(treeScope->rootNode()).host(); 317 317 treeScope = &element->treeScope(); 318 318 } -
trunk/Source/WebCore/html/shadow/ContentDistributor.cpp
r174067 r189239 127 127 128 128 Vector<ShadowRoot*, 8> shadowRoots; 129 for (Element* current = shadowRoot->host Element(); current; current = current->shadowHost()) {129 for (Element* current = shadowRoot->host(); current; current = current->shadowHost()) { 130 130 ShadowRoot* currentRoot = current->shadowRoot(); 131 131 if (!currentRoot->distributor().needsDistribution()) … … 135 135 136 136 for (size_t i = shadowRoots.size(); i > 0; --i) 137 shadowRoots[i - 1]->distributor().distribute(shadowRoots[i - 1]->host Element());137 shadowRoots[i - 1]->distributor().distribute(shadowRoots[i - 1]->host()); 138 138 } 139 139 -
trunk/Source/WebCore/html/shadow/InsertionPoint.cpp
r161205 r189239 86 86 87 87 if (ShadowRoot* root = containingShadowRoot()) { 88 root->distributor().didShadowBoundaryChange(root->host Element());88 root->distributor().didShadowBoundaryChange(root->host()); 89 89 root->distributor().invalidateInsertionPointList(); 90 90 } … … 99 99 root = insertionPoint.containingShadowRoot(); 100 100 101 if (root && root->host Element()) {101 if (root && root->host()) { 102 102 root->invalidateDistribution(); 103 103 root->distributor().invalidateInsertionPointList(); -
trunk/Source/WebCore/page/DragController.cpp
r185231 r189239 291 291 // If this is a button inside of the a file input, move up to the file input. 292 292 if (inputElement && inputElement->isTextButton() && is<ShadowRoot>(inputElement->treeScope().rootNode())) 293 inputElement = downcast<ShadowRoot>(inputElement->treeScope().rootNode()).host Element()->toInputElement();293 inputElement = downcast<ShadowRoot>(inputElement->treeScope().rootNode()).host()->toInputElement(); 294 294 295 295 return inputElement && inputElement->isFileUpload() ? inputElement : 0; -
trunk/Source/WebCore/page/EventHandler.cpp
r188990 r189239 1817 1817 // we'd like to EventHandler::handleMousePressEvent to pass the event to the widget and thus the 1818 1818 // event target node can't still be the shadow node. 1819 if (is<ShadowRoot>(*mouseEvent.targetNode()) && is<HTMLInputElement>(*downcast<ShadowRoot>(*mouseEvent.targetNode()).host Element()))1819 if (is<ShadowRoot>(*mouseEvent.targetNode()) && is<HTMLInputElement>(*downcast<ShadowRoot>(*mouseEvent.targetNode()).host())) 1820 1820 mouseEvent = m_frame.document()->prepareMouseEvent(HitTestRequest(), documentPoint, platformMouseEvent); 1821 1821 -
trunk/Source/WebCore/page/FocusController.cpp
r186256 r189239 84 84 ContainerNode* root = rootNode(); 85 85 if (is<ShadowRoot>(*root)) 86 return downcast<ShadowRoot>(*root).host Element();86 return downcast<ShadowRoot>(*root).host(); 87 87 if (Frame* frame = root->document().frame()) 88 88 return frame->ownerElement(); -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r189144 r189239 3064 3064 if (ShadowRoot* shadowRoot = element->containingShadowRoot()) { 3065 3065 if (shadowRoot->type() == ShadowRoot::UserAgentShadowRoot) 3066 return shadowRoot->host Element()->renderer();3066 return shadowRoot->host()->renderer(); 3067 3067 } 3068 3068 } -
trunk/Source/WebCore/style/StyleResolveTree.cpp
r187496 r189239 386 386 static void attachShadowRoot(ShadowRoot& shadowRoot) 387 387 { 388 ASSERT(shadowRoot.host Element());389 ASSERT(shadowRoot.host Element()->renderer());390 391 auto& renderer = *shadowRoot.host Element()->renderer();388 ASSERT(shadowRoot.host()); 389 ASSERT(shadowRoot.host()->renderer()); 390 391 auto& renderer = *shadowRoot.host()->renderer(); 392 392 RenderTreePosition renderTreePosition(renderer); 393 393 attachChildren(shadowRoot, renderer.style(), renderTreePosition); … … 679 679 static void resolveShadowTree(ShadowRoot& shadowRoot, Element& host, Style::Change change) 680 680 { 681 ASSERT(shadowRoot.host Element() == &host);681 ASSERT(shadowRoot.host() == &host); 682 682 ASSERT(host.renderer()); 683 683 RenderTreePosition renderTreePosition(*host.renderer()); -
trunk/Source/WebCore/svg/SVGElement.cpp
r187504 r189239 491 491 if (root->type() != ShadowRoot::UserAgentShadowRoot) 492 492 return nullptr; 493 auto* host = root->host Element();493 auto* host = root->host(); 494 494 if (!is<SVGUseElement>(host)) 495 495 return nullptr;
Note: See TracChangeset
for help on using the changeset viewer.