From 5f12940329ba496da5730863cae94cd8c0b145da Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 17 Apr 2020 06:34:38 -0400 Subject: Bug 1396584 - Remove support for multiple ShadowRoots Tag #1375 --- dom/base/ShadowRoot.h | 51 ++------------------------------------------------- 1 file changed, 2 insertions(+), 49 deletions(-) (limited to 'dom/base/ShadowRoot.h') diff --git a/dom/base/ShadowRoot.h b/dom/base/ShadowRoot.h index e76e4ab3f..04943752b 100644 --- a/dom/base/ShadowRoot.h +++ b/dom/base/ShadowRoot.h @@ -25,7 +25,6 @@ namespace dom { class Element; class HTMLContentElement; -class HTMLShadowElement; class ShadowRootStyleSheetList; class ShadowRoot final : public DocumentFragment, @@ -42,7 +41,8 @@ public: NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED - ShadowRoot(Element* aElement, already_AddRefed&& aNodeInfo, + ShadowRoot(Element* aElement, + already_AddRefed&& aNodeInfo, nsXBLPrototypeBinding* aProtoBinding); void AddToIdTable(Element* aElement, nsIAtom* aId); @@ -52,24 +52,6 @@ public: bool ApplyAuthorStyles(); void SetApplyAuthorStyles(bool aApplyAuthorStyles); StyleSheetList* StyleSheets(); - HTMLShadowElement* GetShadowElement() { return mShadowElement; } - - /** - * Sets the current shadow insertion point where the older - * ShadowRoot will be projected. - */ - void SetShadowElement(HTMLShadowElement* aShadowElement); - - /** - * Change the node that populates the distribution pool with - * its children. This is distinct from the ShadowRoot host described - * in the specifications. The ShadowRoot host is the element - * which created this ShadowRoot and does not change. The pool host - * is the same as the ShadowRoot host if this is the youngest - * ShadowRoot. If this is an older ShadowRoot, the pool host is - * the element in the younger ShadowRoot (if it exists). - */ - void ChangePoolHost(nsIContent* aNewHost); /** * Distributes a single explicit child of the pool host to the content @@ -92,23 +74,15 @@ public: void AddInsertionPoint(HTMLContentElement* aInsertionPoint); void RemoveInsertionPoint(HTMLContentElement* aInsertionPoint); - void SetYoungerShadow(ShadowRoot* aYoungerShadow); - ShadowRoot* GetYoungerShadowRoot() { return mYoungerShadow; } void SetInsertionPointChanged() { mInsertionPointChanged = true; } void SetAssociatedBinding(nsXBLBinding* aBinding) { mAssociatedBinding = aBinding; } - nsISupports* GetParentObject() const { return mPoolHost; } - - nsIContent* GetPoolHost() { return mPoolHost; } - nsTArray& ShadowDescendants() { return mShadowDescendants; } - JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; static bool IsPooledNode(nsIContent* aChild, nsIContent* aContainer, nsIContent* aHost); static ShadowRoot* FromNode(nsINode* aNode); - static bool IsShadowInsertionPoint(nsIContent* aContent); static void RemoveDestInsertionPoint(nsIContent* aInsertionPoint, nsTArray& aDestInsertionPoints); @@ -125,7 +99,6 @@ public: void GetInnerHTML(nsAString& aInnerHTML); void SetInnerHTML(const nsAString& aInnerHTML, ErrorResult& aError); Element* Host(); - ShadowRoot* GetOlderShadowRoot() { return mOlderShadow; } void StyleSheetChanged(); bool IsComposedDocParticipant() { return mIsComposedDocParticipant; } @@ -134,14 +107,9 @@ public: mIsComposedDocParticipant = aIsComposedDocParticipant; } - virtual void DestroyContent() override; protected: virtual ~ShadowRoot(); - // The pool host is the parent of the nodes that will be distributed - // into the insertion points in this ShadowRoot. See |ChangeShadowRoot|. - nsCOMPtr mPoolHost; - // An array of content insertion points that are a descendant of the ShadowRoot // sorted in tree order. Insertion points are responsible for notifying // the ShadowRoot when they are removed or added as a descendant. The insertion @@ -149,10 +117,6 @@ protected: // by the array. nsTArray mInsertionPoints; - // An array of the elements that are descendant of the ShadowRoot - // sorted in tree order. Only the first may be a shadow insertion point. - nsTArray mShadowDescendants; - nsTHashtable mIdentifierMap; nsXBLPrototypeBinding* mProtoBinding; @@ -163,17 +127,6 @@ protected: RefPtr mStyleSheetList; - // The current shadow insertion point of this ShadowRoot. - HTMLShadowElement* mShadowElement; - - // The ShadowRoot that was created by the host element before - // this ShadowRoot was created. - RefPtr mOlderShadow; - - // The ShadowRoot that was created by the host element after - // this ShadowRoot was created. - RefPtr mYoungerShadow; - // A boolean that indicates that an insertion point was added or removed // from this ShadowRoot and that the nodes need to be redistributed into // the insertion points. After this flag is set, nodes will be distributed -- cgit v1.2.3