diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-04-17 06:38:37 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2020-04-17 06:38:37 -0400 |
commit | 3758434680616e91edf696e546fe3cc3b1d4da9c (patch) | |
tree | 845788e5a7a90326c7026a7bd139bc222352a54f /dom/base/nsGenericDOMDataNode.cpp | |
parent | 55d83ea6f9aa9d99963a4d1fb1f96a3b633ede49 (diff) | |
download | UXP-3758434680616e91edf696e546fe3cc3b1d4da9c.tar UXP-3758434680616e91edf696e546fe3cc3b1d4da9c.tar.gz UXP-3758434680616e91edf696e546fe3cc3b1d4da9c.tar.lz UXP-3758434680616e91edf696e546fe3cc3b1d4da9c.tar.xz UXP-3758434680616e91edf696e546fe3cc3b1d4da9c.zip |
Bug 1408341 - Implement assignedSlot on Element and Text
Tag #1375
Diffstat (limited to 'dom/base/nsGenericDOMDataNode.cpp')
-rw-r--r-- | dom/base/nsGenericDOMDataNode.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/dom/base/nsGenericDOMDataNode.cpp b/dom/base/nsGenericDOMDataNode.cpp index 73463ea5e..e5cc852d2 100644 --- a/dom/base/nsGenericDOMDataNode.cpp +++ b/dom/base/nsGenericDOMDataNode.cpp @@ -15,6 +15,7 @@ #include "mozilla/AsyncEventDispatcher.h" #include "mozilla/MemoryReporting.h" #include "mozilla/dom/Element.h" +#include "mozilla/dom/HTMLSlotElement.h" #include "mozilla/dom/ShadowRoot.h" #include "nsIDocument.h" #include "nsIDOMDocument.h" @@ -753,6 +754,20 @@ nsGenericDOMDataNode::GetExistingDestInsertionPoints() const return nullptr; } +HTMLSlotElement* +nsGenericDOMDataNode::GetAssignedSlot() const +{ + nsDataSlots *slots = GetExistingDataSlots(); + return slots ? slots->mAssignedSlot.get() : nullptr; +} + +void +nsGenericDOMDataNode::SetAssignedSlot(HTMLSlotElement* aSlot) +{ + nsDataSlots *slots = DataSlots(); + slots->mAssignedSlot = aSlot; +} + nsXBLBinding * nsGenericDOMDataNode::GetXBLBinding() const { @@ -843,6 +858,9 @@ nsGenericDOMDataNode::nsDataSlots::Traverse(nsCycleCollectionTraversalCallback & NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mSlots->mContainingShadow"); cb.NoteXPCOMChild(NS_ISUPPORTS_CAST(nsIContent*, mContainingShadow)); + + NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mSlots->mAssignedSlot"); + cb.NoteXPCOMChild(NS_ISUPPORTS_CAST(nsIContent*, mAssignedSlot.get())); } void @@ -850,6 +868,7 @@ nsGenericDOMDataNode::nsDataSlots::Unlink() { mXBLInsertionParent = nullptr; mContainingShadow = nullptr; + mAssignedSlot = nullptr; } //---------------------------------------------------------------------- |