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

Side by Side Diff: third_party/WebKit/Source/core/dom/shadow/InsertionPoint.h

Issue 1489433002: Support the essential part of Shadow DOM v1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert Internals.* Created 5 years 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 inline bool isActiveInsertionPoint(const Node& node) 92 inline bool isActiveInsertionPoint(const Node& node)
93 { 93 {
94 return node.isInsertionPoint() && toInsertionPoint(node).isActive(); 94 return node.isInsertionPoint() && toInsertionPoint(node).isActive();
95 } 95 }
96 96
97 inline bool isActiveShadowInsertionPoint(const Node& node) 97 inline bool isActiveShadowInsertionPoint(const Node& node)
98 { 98 {
99 return node.isInsertionPoint() && toInsertionPoint(node).isShadowInsertionPo int(); 99 return node.isInsertionPoint() && toInsertionPoint(node).isShadowInsertionPo int();
100 } 100 }
101 101
102 // TODO(hayato): The function name is confusing. This neither resolve a reprojec tion nor support v1 shadow trees.
102 inline ElementShadow* shadowWhereNodeCanBeDistributed(const Node& node) 103 inline ElementShadow* shadowWhereNodeCanBeDistributed(const Node& node)
103 { 104 {
104 Node* parent = node.parentNode(); 105 Node* parent = node.parentNode();
105 if (!parent) 106 if (!parent)
106 return 0; 107 return 0;
107 if (parent->isShadowRoot() && !toShadowRoot(parent)->isYoungest()) 108 if (parent->isShadowRoot() && !toShadowRoot(parent)->isYoungest())
108 return node.shadowHost()->shadow(); 109 return node.shadowHost()->shadow();
109 if (isActiveInsertionPoint(*parent)) 110 if (isActiveInsertionPoint(*parent))
110 return node.shadowHost()->shadow(); 111 return node.shadowHost()->shadow();
111 if (parent->isElementNode()) 112 if (parent->isElementNode())
112 return toElement(parent)->shadow(); 113 return toElement(parent)->shadow();
113 return 0; 114 return 0;
114 } 115 }
115 116
116 const InsertionPoint* resolveReprojection(const Node*); 117 const InsertionPoint* resolveReprojection(const Node*);
117 118
118 void collectDestinationInsertionPoints(const Node&, WillBeHeapVector<RawPtrWillB eMember<InsertionPoint>, 8>& results); 119 void collectDestinationInsertionPoints(const Node&, WillBeHeapVector<RawPtrWillB eMember<InsertionPoint>, 8>& results);
119 120
120 } // namespace blink 121 } // namespace blink
121 122
122 #endif // InsertionPoint_h 123 #endif // InsertionPoint_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698