From 53df3a74f46fa6b5d3778f9635a1afb7522c345f Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 17 Apr 2020 07:37:07 -0400 Subject: Bug 1426503 - Remove DestInsertionPoints stuff Tag #1375 --- dom/base/Element.cpp | 77 --------------------------------------- dom/base/Element.h | 26 ------------- dom/base/FragmentOrElement.cpp | 17 --------- dom/base/FragmentOrElement.h | 8 ---- dom/base/nsGenericDOMDataNode.cpp | 17 --------- dom/base/nsGenericDOMDataNode.h | 7 ---- dom/base/nsIContent.h | 14 ------- dom/webidl/Element.webidl | 2 - 8 files changed, 168 deletions(-) (limited to 'dom') diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index f3c8a1129..8e9225a64 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -1208,83 +1208,6 @@ Element::AttachShadowInternal(bool aClosed, ErrorResult& aError) return shadowRoot.forget(); } -NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(DestinationInsertionPointList, mParent, - mDestinationPoints) - -NS_INTERFACE_TABLE_HEAD(DestinationInsertionPointList) - NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY - NS_INTERFACE_TABLE(DestinationInsertionPointList, nsINodeList, nsIDOMNodeList) - NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(DestinationInsertionPointList) -NS_INTERFACE_MAP_END - -NS_IMPL_CYCLE_COLLECTING_ADDREF(DestinationInsertionPointList) -NS_IMPL_CYCLE_COLLECTING_RELEASE(DestinationInsertionPointList) - -DestinationInsertionPointList::DestinationInsertionPointList(Element* aElement) - : mParent(aElement) -{ - nsTArray* destPoints = aElement->GetExistingDestInsertionPoints(); - if (destPoints) { - for (uint32_t i = 0; i < destPoints->Length(); i++) { - mDestinationPoints.AppendElement(destPoints->ElementAt(i)); - } - } -} - -DestinationInsertionPointList::~DestinationInsertionPointList() -{ -} - -nsIContent* -DestinationInsertionPointList::Item(uint32_t aIndex) -{ - return mDestinationPoints.SafeElementAt(aIndex); -} - -NS_IMETHODIMP -DestinationInsertionPointList::Item(uint32_t aIndex, nsIDOMNode** aReturn) -{ - nsIContent* item = Item(aIndex); - if (!item) { - return NS_ERROR_FAILURE; - } - - return CallQueryInterface(item, aReturn); -} - -uint32_t -DestinationInsertionPointList::Length() const -{ - return mDestinationPoints.Length(); -} - -NS_IMETHODIMP -DestinationInsertionPointList::GetLength(uint32_t* aLength) -{ - *aLength = Length(); - return NS_OK; -} - -int32_t -DestinationInsertionPointList::IndexOf(nsIContent* aContent) -{ - return mDestinationPoints.IndexOf(aContent); -} - -JSObject* -DestinationInsertionPointList::WrapObject(JSContext* aCx, JS::Handle aGivenProto) -{ - return NodeListBinding::Wrap(aCx, this, aGivenProto); -} - -already_AddRefed -Element::GetDestinationInsertionPoints() -{ - RefPtr list = - new DestinationInsertionPointList(this); - return list.forget(); -} - void Element::GetAttribute(const nsAString& aName, DOMString& aReturn) { diff --git a/dom/base/Element.h b/dom/base/Element.h index 23a9fee52..3d9b80a98 100644 --- a/dom/base/Element.h +++ b/dom/base/Element.h @@ -144,7 +144,6 @@ class CustomElementRegistry; class Link; class DOMRect; class DOMRectList; -class DestinationInsertionPointList; class Grid; // IID for the dom::Element interface @@ -933,7 +932,6 @@ public: // [deprecated] Shadow DOM v0 already_AddRefed CreateShadowRoot(ErrorResult& aError); - already_AddRefed GetDestinationInsertionPoints(); ShadowRoot *FastGetShadowRoot() const { @@ -1616,30 +1614,6 @@ private: nsCOMPtr mDoc; }; -class DestinationInsertionPointList : public nsINodeList -{ -public: - explicit DestinationInsertionPointList(Element* aElement); - - NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DestinationInsertionPointList) - - // nsIDOMNodeList - NS_DECL_NSIDOMNODELIST - - // nsINodeList - virtual nsIContent* Item(uint32_t aIndex) override; - virtual int32_t IndexOf(nsIContent* aContent) override; - virtual nsINode* GetParentObject() override { return mParent; } - virtual uint32_t Length() const; - virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; -protected: - virtual ~DestinationInsertionPointList(); - - RefPtr mParent; - nsCOMArray mDestinationPoints; -}; - NS_DEFINE_STATIC_IID_ACCESSOR(Element, NS_ELEMENT_IID) inline bool diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index 676665c09..6fbe04d25 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -1131,23 +1131,6 @@ FragmentOrElement::SetShadowRoot(ShadowRoot* aShadowRoot) slots->mShadowRoot = aShadowRoot; } -nsTArray& -FragmentOrElement::DestInsertionPoints() -{ - nsExtendedDOMSlots* slots = ExtendedDOMSlots(); - return slots->mDestInsertionPoints; -} - -nsTArray* -FragmentOrElement::GetExistingDestInsertionPoints() const -{ - nsExtendedDOMSlots* slots = GetExistingExtendedDOMSlots(); - if (slots) { - return &slots->mDestInsertionPoints; - } - return nullptr; -} - HTMLSlotElement* FragmentOrElement::GetAssignedSlot() const { diff --git a/dom/base/FragmentOrElement.h b/dom/base/FragmentOrElement.h index df05bcb50..f1fa046ee 100644 --- a/dom/base/FragmentOrElement.h +++ b/dom/base/FragmentOrElement.h @@ -155,8 +155,6 @@ public: virtual void SetXBLBinding(nsXBLBinding* aBinding, nsBindingManager* aOldBindingManager = nullptr) override; virtual ShadowRoot *GetContainingShadow() const override; - virtual nsTArray &DestInsertionPoints() override; - virtual nsTArray *GetExistingDestInsertionPoints() const override; virtual void SetShadowRoot(ShadowRoot* aBinding) override; virtual mozilla::dom::HTMLSlotElement* GetAssignedSlot() const override; virtual void SetAssignedSlot(mozilla::dom::HTMLSlotElement* aSlot) override; @@ -296,12 +294,6 @@ public: */ RefPtr mContainingShadow; - /** - * An array of web component insertion points to which this element - * is distributed. - */ - nsTArray mDestInsertionPoints; - /** * The assigned slot associated with this element. */ diff --git a/dom/base/nsGenericDOMDataNode.cpp b/dom/base/nsGenericDOMDataNode.cpp index e5cc852d2..d23783368 100644 --- a/dom/base/nsGenericDOMDataNode.cpp +++ b/dom/base/nsGenericDOMDataNode.cpp @@ -737,23 +737,6 @@ nsGenericDOMDataNode::SetShadowRoot(ShadowRoot* aShadowRoot) { } -nsTArray& -nsGenericDOMDataNode::DestInsertionPoints() -{ - nsDataSlots *slots = DataSlots(); - return slots->mDestInsertionPoints; -} - -nsTArray* -nsGenericDOMDataNode::GetExistingDestInsertionPoints() const -{ - nsDataSlots *slots = GetExistingDataSlots(); - if (slots) { - return &slots->mDestInsertionPoints; - } - return nullptr; -} - HTMLSlotElement* nsGenericDOMDataNode::GetAssignedSlot() const { diff --git a/dom/base/nsGenericDOMDataNode.h b/dom/base/nsGenericDOMDataNode.h index 97bd79129..4d0114cb1 100644 --- a/dom/base/nsGenericDOMDataNode.h +++ b/dom/base/nsGenericDOMDataNode.h @@ -160,8 +160,6 @@ public: virtual void SetXBLBinding(nsXBLBinding* aBinding, nsBindingManager* aOldBindingManager = nullptr) override; virtual mozilla::dom::ShadowRoot *GetContainingShadow() const override; - virtual nsTArray &DestInsertionPoints() override; - virtual nsTArray *GetExistingDestInsertionPoints() const override; virtual void SetShadowRoot(mozilla::dom::ShadowRoot* aShadowRoot) override; virtual mozilla::dom::HTMLSlotElement* GetAssignedSlot() const override; virtual void SetAssignedSlot(mozilla::dom::HTMLSlotElement* aSlot) override; @@ -268,11 +266,6 @@ protected: */ RefPtr mContainingShadow; - /** - * @see nsIContent::GetDestInsertionPoints - */ - nsTArray mDestInsertionPoints; - /** * @see nsIContent::GetAssignedSlot */ diff --git a/dom/base/nsIContent.h b/dom/base/nsIContent.h index 975173656..ce0a4e596 100644 --- a/dom/base/nsIContent.h +++ b/dom/base/nsIContent.h @@ -696,20 +696,6 @@ public: */ virtual mozilla::dom::ShadowRoot *GetContainingShadow() const = 0; - /** - * Gets an array of destination insertion points where this content - * is distributed by web component distribution algorithms. - * The array is created if it does not already exist. - */ - virtual nsTArray &DestInsertionPoints() = 0; - - /** - * Same as DestInsertionPoints except that this method will return - * null if the array of destination insertion points does not already - * exist. - */ - virtual nsTArray *GetExistingDestInsertionPoints() const = 0; - /** * Gets the assigned slot associated with this content. * diff --git a/dom/webidl/Element.webidl b/dom/webidl/Element.webidl index f6d0f7f93..2f7e934b8 100644 --- a/dom/webidl/Element.webidl +++ b/dom/webidl/Element.webidl @@ -248,8 +248,6 @@ partial interface Element { // [deprecated] Shadow DOM v0 [Throws, Pref="nsDocument::IsWebComponentsEnabled"] ShadowRoot createShadowRoot(); - [Pref="nsDocument::IsWebComponentsEnabled"] - NodeList getDestinationInsertionPoints(); }; Element implements ChildNode; -- cgit v1.2.3