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

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: 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..d9265bc7056f8ba6b32cbe4db2c57a650f1e7511 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::slotAdded(HTMLSlotElement& slot) {
esprehn 2017/01/17 10:48:18 DidAddSlot()
hayato 2017/01/19 03:13:50 Done
+ DCHECK(isV1());
+ ensureSlotAssignment().slotAdded(slot);
+}
+
+void ShadowRoot::hostChildSlotNameChanged(const AtomicString& oldValue,
esprehn 2017/01/17 10:48:18 I prefer the did naming. ::DidChangeHostChildSlot
hayato 2017/01/19 03:13:50 Done
+ const AtomicString& newValue) {
+ if (!m_slotAssignment)
+ return;
+ m_slotAssignment->hostChildSlotNameChanged(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/html/HTMLSlotElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698