summaryrefslogtreecommitdiffstats
path: root/dom/base/nsGenericDOMDataNode.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-04-17 16:02:56 +0200
committerGitHub <noreply@github.com>2020-04-17 16:02:56 +0200
commitd5102d6beafc2a2a0cec3cc3ee5f7ebde31ae7bf (patch)
tree2bfef192cbb748b675ce8308c242a376798e265d /dom/base/nsGenericDOMDataNode.cpp
parent5caf99795aa81e1fc145b8e937b1ee8197ed2486 (diff)
parentf35aa3e15fedf3cd4ad163d60ab74a9537ca5c82 (diff)
downloadUXP-d5102d6beafc2a2a0cec3cc3ee5f7ebde31ae7bf.tar
UXP-d5102d6beafc2a2a0cec3cc3ee5f7ebde31ae7bf.tar.gz
UXP-d5102d6beafc2a2a0cec3cc3ee5f7ebde31ae7bf.tar.lz
UXP-d5102d6beafc2a2a0cec3cc3ee5f7ebde31ae7bf.tar.xz
UXP-d5102d6beafc2a2a0cec3cc3ee5f7ebde31ae7bf.zip
Merge pull request #1518 from MoonchildProductions/shadowdom-merge
Incremental shadowdom-merge
Diffstat (limited to 'dom/base/nsGenericDOMDataNode.cpp')
-rw-r--r--dom/base/nsGenericDOMDataNode.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/dom/base/nsGenericDOMDataNode.cpp b/dom/base/nsGenericDOMDataNode.cpp
index 73463ea5e..d23783368 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"
@@ -736,21 +737,18 @@ nsGenericDOMDataNode::SetShadowRoot(ShadowRoot* aShadowRoot)
{
}
-nsTArray<nsIContent*>&
-nsGenericDOMDataNode::DestInsertionPoints()
+HTMLSlotElement*
+nsGenericDOMDataNode::GetAssignedSlot() const
{
- nsDataSlots *slots = DataSlots();
- return slots->mDestInsertionPoints;
+ nsDataSlots *slots = GetExistingDataSlots();
+ return slots ? slots->mAssignedSlot.get() : nullptr;
}
-nsTArray<nsIContent*>*
-nsGenericDOMDataNode::GetExistingDestInsertionPoints() const
+void
+nsGenericDOMDataNode::SetAssignedSlot(HTMLSlotElement* aSlot)
{
- nsDataSlots *slots = GetExistingDataSlots();
- if (slots) {
- return &slots->mDestInsertionPoints;
- }
- return nullptr;
+ nsDataSlots *slots = DataSlots();
+ slots->mAssignedSlot = aSlot;
}
nsXBLBinding *
@@ -843,6 +841,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 +851,7 @@ nsGenericDOMDataNode::nsDataSlots::Unlink()
{
mXBLInsertionParent = nullptr;
mContainingShadow = nullptr;
+ mAssignedSlot = nullptr;
}
//----------------------------------------------------------------------