Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Side by Side Diff: third_party/WebKit/Source/core/dom/Node.cpp

Issue 1562743002: Revert of Support slot element's fallback content feature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 bool Node::canParticipateInComposedTree() const 961 bool Node::canParticipateInComposedTree() const
962 { 962 {
963 return !isShadowRoot() && !isSlotOrActiveInsertionPoint(); 963 return !isShadowRoot() && !isSlotOrActiveInsertionPoint();
964 } 964 }
965 965
966 bool Node::isSlotOrActiveInsertionPoint() const 966 bool Node::isSlotOrActiveInsertionPoint() const
967 { 967 {
968 return isHTMLSlotElement(*this) || isActiveInsertionPoint(*this); 968 return isHTMLSlotElement(*this) || isActiveInsertionPoint(*this);
969 } 969 }
970 970
971 bool Node::isInV1ShadowTree() const
972 {
973 ShadowRoot* shadowRoot = containingShadowRoot();
974 return shadowRoot && shadowRoot->isV1();
975 }
976
977 bool Node::isInV0ShadowTree() const
978 {
979 ShadowRoot* shadowRoot = containingShadowRoot();
980 return shadowRoot && !shadowRoot->isV1();
981 }
982
983 static ElementShadow* parentElementShadow(const Node& node)
984 {
985 Element* parent = node.parentElement();
986 if (!parent)
987 return nullptr;
988 return parent->shadow();
989 }
990
991 bool Node::isChildOfV1ShadowHost() const
992 {
993 ElementShadow* parentShadow = parentElementShadow(*this);
994 return parentShadow && parentShadow->isV1();
995 }
996
997 bool Node::isChildOfV0ShadowHost() const
998 {
999 ElementShadow* parentShadow = parentElementShadow(*this);
1000 return parentShadow && !parentShadow->isV1();
1001 }
1002
1003 Element* Node::shadowHost() const 971 Element* Node::shadowHost() const
1004 { 972 {
1005 if (ShadowRoot* root = containingShadowRoot()) 973 if (ShadowRoot* root = containingShadowRoot())
1006 return root->host(); 974 return root->host();
1007 return nullptr; 975 return nullptr;
1008 } 976 }
1009 977
1010 ShadowRoot* Node::containingShadowRoot() const 978 ShadowRoot* Node::containingShadowRoot() const
1011 { 979 {
1012 Node& root = treeScope().rootNode(); 980 Node& root = treeScope().rootNode();
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after
2236 if (!insertionPoint->containingShadowRoot()->isOpen()) 2204 if (!insertionPoint->containingShadowRoot()->isOpen())
2237 break; 2205 break;
2238 filteredInsertionPoints.append(insertionPoint); 2206 filteredInsertionPoints.append(insertionPoint);
2239 } 2207 }
2240 return StaticNodeList::adopt(filteredInsertionPoints); 2208 return StaticNodeList::adopt(filteredInsertionPoints);
2241 } 2209 }
2242 2210
2243 HTMLSlotElement* Node::assignedSlot() const 2211 HTMLSlotElement* Node::assignedSlot() const
2244 { 2212 {
2245 ASSERT(!needsDistributionRecalc()); 2213 ASSERT(!needsDistributionRecalc());
2246 if (ElementShadow* shadow = parentElementShadow(*this)) 2214 Element* parent = parentElement();
2247 return shadow->assignedSlotFor(*this); 2215 if (!parent)
2248 return nullptr; 2216 return nullptr;
2249 } 2217 if (ElementShadow* shadow = parent->shadow()) {
2250
2251 HTMLSlotElement* Node::assignedSlotForBinding()
2252 {
2253 updateDistribution();
2254 if (ElementShadow* shadow = parentElementShadow(*this)) {
2255 if (shadow->isV1() && shadow->isOpen()) 2218 if (shadow->isV1() && shadow->isOpen())
2256 return shadow->assignedSlotFor(*this); 2219 return shadow->assignedSlotFor(*this);
2257 } 2220 }
2258 return nullptr; 2221 return nullptr;
2259 } 2222 }
2260 2223
2261 void Node::setFocus(bool flag) 2224 void Node::setFocus(bool flag)
2262 { 2225 {
2263 document().userActionElements().setFocused(this, flag); 2226 document().userActionElements().setFocused(this, flag);
2264 } 2227 }
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
2406 2369
2407 void showNodePath(const blink::Node* node) 2370 void showNodePath(const blink::Node* node)
2408 { 2371 {
2409 if (node) 2372 if (node)
2410 node->showNodePathForThis(); 2373 node->showNodePathForThis();
2411 else 2374 else
2412 fprintf(stderr, "Cannot showNodePath for (nil)\n"); 2375 fprintf(stderr, "Cannot showNodePath for (nil)\n");
2413 } 2376 }
2414 2377
2415 #endif 2378 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/dom/shadow/ComposedTreeTraversal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698