From 87520df9dac4543a9dd7c7b0acb1e1db51f3e318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 20 Dec 2017 22:08:15 +0100 Subject: [PATCH] Bug 1426503: Remove DestInsertionPoints stuff. r=smaug MozReview-Commit-ID: KtaEqZn9GH3 --HG-- extra : rebase_source : 54b76e2437cd3031d12973b7021ba740474f07e3 --- 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(-) diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index d9fff18e4587..7b6d9754c928 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -1259,83 +1259,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 0d1f90606271..447c7f57e09f 100644 --- a/dom/base/Element.h +++ b/dom/base/Element.h @@ -188,7 +188,6 @@ class CustomElementRegistry; class Link; class DOMRect; class DOMRectList; -class DestinationInsertionPointList; class Flex; class Grid; @@ -1236,7 +1235,6 @@ public: // [deprecated] Shadow DOM v0 already_AddRefed CreateShadowRoot(ErrorResult& aError); - already_AddRefed GetDestinationInsertionPoints(); ShadowRoot *FastGetShadowRoot() const { @@ -1959,30 +1957,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 2a95892adc2c..dea6e324aea9 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -1289,23 +1289,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 0571313a83ac..8d350ec905e7 100644 --- a/dom/base/FragmentOrElement.h +++ b/dom/base/FragmentOrElement.h @@ -153,8 +153,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; @@ -292,12 +290,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 8450c7a1152b..8a9923c40e82 100644 --- a/dom/base/nsGenericDOMDataNode.cpp +++ b/dom/base/nsGenericDOMDataNode.cpp @@ -690,23 +690,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 cb5b1bbc3298..cad6c75dadff 100644 --- a/dom/base/nsGenericDOMDataNode.h +++ b/dom/base/nsGenericDOMDataNode.h @@ -163,8 +163,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; @@ -272,11 +270,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 ec6861812e78..722fb83b3a55 100644 --- a/dom/base/nsIContent.h +++ b/dom/base/nsIContent.h @@ -649,20 +649,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 bc46e36745fe..2df4723d0f0a 100644 --- a/dom/webidl/Element.webidl +++ b/dom/webidl/Element.webidl @@ -266,8 +266,6 @@ partial interface Element { // [deprecated] Shadow DOM v0 [Throws, Func="nsDocument::IsWebComponentsEnabled"] ShadowRoot createShadowRoot(); - [Func="nsDocument::IsWebComponentsEnabled"] - NodeList getDestinationInsertionPoints(); }; Element implements ChildNode;