summaryrefslogtreecommitdiffstats
path: root/dom/base/ShadowRoot.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/base/ShadowRoot.h')
-rw-r--r--dom/base/ShadowRoot.h37
1 files changed, 30 insertions, 7 deletions
diff --git a/dom/base/ShadowRoot.h b/dom/base/ShadowRoot.h
index 04943752b..42423c92e 100644
--- a/dom/base/ShadowRoot.h
+++ b/dom/base/ShadowRoot.h
@@ -54,23 +54,48 @@ public:
StyleSheetList* StyleSheets();
/**
+ * Distributes all the explicit children of the pool host to the content
+ * insertion points in this ShadowRoot.
+ */
+ void DistributeAllNodes();
+
+private:
+ /**
* Distributes a single explicit child of the pool host to the content
* insertion points in this ShadowRoot.
+ *
+ * Returns the insertion point the element is distributed to after this call.
+ *
+ * Note that this doesn't handle distributing the node in the insertion point
+ * parent's shadow root.
*/
- void DistributeSingleNode(nsIContent* aContent);
+ const HTMLContentElement* DistributeSingleNode(nsIContent* aContent);
/**
* Removes a single explicit child of the pool host from the content
* insertion points in this ShadowRoot.
+ *
+ * Returns the old insertion point, if any.
+ *
+ * Note that this doesn't handle removing the node in the returned insertion
+ * point parent's shadow root.
*/
- void RemoveDistributedNode(nsIContent* aContent);
+ const HTMLContentElement* RemoveDistributedNode(nsIContent* aContent);
/**
- * Distributes all the explicit children of the pool host to the content
- * insertion points in this ShadowRoot.
+ * Redistributes a node of the pool, and returns whether the distribution
+ * changed.
*/
- void DistributeAllNodes();
+ bool RedistributeElement(Element*);
+ /**
+ * Called when we redistribute content after insertion points have changed.
+ */
+ void DistributionChanged();
+
+ bool IsPooledNode(nsIContent* aChild) const;
+
+public:
void AddInsertionPoint(HTMLContentElement* aInsertionPoint);
void RemoveInsertionPoint(HTMLContentElement* aInsertionPoint);
@@ -80,8 +105,6 @@ public:
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
- static bool IsPooledNode(nsIContent* aChild, nsIContent* aContainer,
- nsIContent* aHost);
static ShadowRoot* FromNode(nsINode* aNode);
static void RemoveDestInsertionPoint(nsIContent* aInsertionPoint,