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

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

Issue 2630293003: Do not allocate SlotAssignment unless a shadowroot has a slot (Closed)
Patch Set: renamed Created 3 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 const HeapVector<Member<InsertionPoint>>& descendantInsertionPoints(); 116 const HeapVector<Member<InsertionPoint>>& descendantInsertionPoints();
117 117
118 // For Internals, don't use this. 118 // For Internals, don't use this.
119 unsigned childShadowRootCount() const { return m_childShadowRootCount; } 119 unsigned childShadowRootCount() const { return m_childShadowRootCount; }
120 120
121 void recalcStyle(StyleRecalcChange); 121 void recalcStyle(StyleRecalcChange);
122 122
123 void registerScopedHTMLStyleChild(); 123 void registerScopedHTMLStyleChild();
124 void unregisterScopedHTMLStyleChild(); 124 void unregisterScopedHTMLStyleChild();
125 125
126 SlotAssignment& ensureSlotAssignment(); 126 SlotAssignment& slotAssignment() {
127 DCHECK(m_slotAssignment);
128 return *m_slotAssignment;
129 }
130
131 HTMLSlotElement* assignedSlotFor(const Node&);
132 void didAddSlot(HTMLSlotElement&);
133 void didChangeHostChildSlotName(const AtomicString& oldValue,
134 const AtomicString& newValue);
127 135
128 void distributeV1(); 136 void distributeV1();
129 137
130 Element* activeElement() const; 138 Element* activeElement() const;
131 139
132 String innerHTML() const; 140 String innerHTML() const;
133 void setInnerHTML(const String&, ExceptionState& = ASSERT_NO_EXCEPTION); 141 void setInnerHTML(const String&, ExceptionState& = ASSERT_NO_EXCEPTION);
134 142
135 Node* cloneNode(bool, ExceptionState&); 143 Node* cloneNode(bool, ExceptionState&);
136 144
(...skipping 11 matching lines...) Expand all
148 DECLARE_VIRTUAL_TRACE(); 156 DECLARE_VIRTUAL_TRACE();
149 DECLARE_VIRTUAL_TRACE_WRAPPERS(); 157 DECLARE_VIRTUAL_TRACE_WRAPPERS();
150 158
151 private: 159 private:
152 ShadowRoot(Document&, ShadowRootType); 160 ShadowRoot(Document&, ShadowRootType);
153 ~ShadowRoot() override; 161 ~ShadowRoot() override;
154 162
155 void childrenChanged(const ChildrenChange&) override; 163 void childrenChanged(const ChildrenChange&) override;
156 164
157 ShadowRootRareDataV0& ensureShadowRootRareDataV0(); 165 ShadowRootRareDataV0& ensureShadowRootRareDataV0();
166 SlotAssignment& ensureSlotAssignment();
158 167
159 void addChildShadowRoot() { ++m_childShadowRootCount; } 168 void addChildShadowRoot() { ++m_childShadowRootCount; }
160 void removeChildShadowRoot() { 169 void removeChildShadowRoot() {
161 DCHECK_GT(m_childShadowRootCount, 0u); 170 DCHECK_GT(m_childShadowRootCount, 0u);
162 --m_childShadowRootCount; 171 --m_childShadowRootCount;
163 } 172 }
164 void invalidateDescendantInsertionPoints(); 173 void invalidateDescendantInsertionPoints();
165 174
166 // ShadowRoots should never be cloned. 175 // ShadowRoots should never be cloned.
167 Node* cloneNode(bool) override { return nullptr; } 176 Node* cloneNode(bool) override { return nullptr; }
(...skipping 25 matching lines...) Expand all
193 treeScope, 202 treeScope,
194 treeScope->rootNode().isShadowRoot(), 203 treeScope->rootNode().isShadowRoot(),
195 treeScope.rootNode().isShadowRoot()); 204 treeScope.rootNode().isShadowRoot());
196 DEFINE_TYPE_CASTS(TreeScope, ShadowRoot, shadowRoot, true, true); 205 DEFINE_TYPE_CASTS(TreeScope, ShadowRoot, shadowRoot, true, true);
197 206
198 CORE_EXPORT std::ostream& operator<<(std::ostream&, const ShadowRootType&); 207 CORE_EXPORT std::ostream& operator<<(std::ostream&, const ShadowRootType&);
199 208
200 } // namespace blink 209 } // namespace blink
201 210
202 #endif // ShadowRoot_h 211 #endif // ShadowRoot_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698