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

Unified Diff: third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp

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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
diff --git a/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp b/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
index 835e03e3aaaba6149be358deb6f62dd29e959dca..c72f2a0cdc84b8557a6fa137266e55be6b0c5142 100644
--- a/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
+++ b/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
@@ -101,6 +101,24 @@ SlotAssignment& ShadowRoot::ensureSlotAssignment() {
return *m_slotAssignment;
}
+HTMLSlotElement* ShadowRoot::assignedSlotFor(const Node& node) {
+ if (!m_slotAssignment)
+ return nullptr;
+ return m_slotAssignment->findSlot(node);
+}
+
+void ShadowRoot::didAddSlot(HTMLSlotElement& slot) {
+ DCHECK(isV1());
+ ensureSlotAssignment().didAddSlot(slot);
+}
+
+void ShadowRoot::didChangeHostChildSlotName(const AtomicString& oldValue,
+ const AtomicString& newValue) {
+ if (!m_slotAssignment)
+ return;
+ m_slotAssignment->didChangeHostChildSlotName(oldValue, newValue);
+}
+
Node* ShadowRoot::cloneNode(bool, ExceptionState& exceptionState) {
exceptionState.throwDOMException(NotSupportedError,
"ShadowRoot nodes are not clonable.");
« no previous file with comments | « third_party/WebKit/Source/core/dom/shadow/ShadowRoot.h ('k') | third_party/WebKit/Source/core/dom/shadow/SlotAssignment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698