Bug 1465907 part 1. Remove nsIAttribute::GetMap, SetMap, SetOwnerDocument, NodeInfo methods. r=mccr8

This commit is contained in:
Boris Zbarsky 2018-07-12 15:51:52 -07:00
Родитель a70fd07c29
Коммит e503d9a052
3 изменённых файлов: 18 добавлений и 29 удалений

Просмотреть файл

@ -27,9 +27,8 @@
#include "mozAutoDocUpdate.h"
#include "nsWrapperCacheInlines.h"
nsIAttribute::nsIAttribute(nsDOMAttributeMap* aAttrMap,
already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsINode(aNodeInfo), mAttrMap(aAttrMap)
nsIAttribute::nsIAttribute(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsINode(aNodeInfo)
{
}
@ -46,7 +45,7 @@ bool Attr::sInitialized;
Attr::Attr(nsDOMAttributeMap *aAttrMap,
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
const nsAString &aValue)
: nsIAttribute(aAttrMap, aNodeInfo), mValue(aValue)
: nsIAttribute(aNodeInfo), mAttrMap(aAttrMap), mValue(aValue)
{
MOZ_ASSERT(mNodeInfo, "We must get a nodeinfo here!");
MOZ_ASSERT(mNodeInfo->NodeType() == ATTRIBUTE_NODE,

Просмотреть файл

@ -51,10 +51,20 @@ public:
void GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
// nsIAttribute interface
void SetMap(nsDOMAttributeMap *aMap) override;
nsDOMAttributeMap* GetMap()
{
return mAttrMap;
}
void SetMap(nsDOMAttributeMap *aMap);
Element* GetElement() const;
nsresult SetOwnerDocument(nsIDocument* aDocument) override;
/**
* Called when our ownerElement is moved into a new document.
* Updates the nodeinfo of this node.
*/
nsresult SetOwnerDocument(nsIDocument* aDocument);
// nsINode interface
virtual bool IsNodeOfType(uint32_t aFlags) const override;
@ -100,6 +110,7 @@ protected:
static bool sInitialized;
private:
RefPtr<nsDOMAttributeMap> mAttrMap;
nsString mValue;
};

Просмотреть файл

@ -20,32 +20,11 @@ class nsIAttribute : public nsINode
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IATTRIBUTE_IID)
virtual void SetMap(nsDOMAttributeMap *aMap) = 0;
nsDOMAttributeMap *GetMap()
{
return mAttrMap;
}
mozilla::dom::NodeInfo *NodeInfo() const
{
return mNodeInfo;
}
/**
* Called when our ownerElement is moved into a new document.
* Updates the nodeinfo of this node.
*/
virtual nsresult SetOwnerDocument(nsIDocument* aDocument) = 0;
protected:
#ifdef MOZILLA_INTERNAL_API
nsIAttribute(nsDOMAttributeMap *aAttrMap,
already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
nsIAttribute(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
#endif //MOZILLA_INTERNAL_API
virtual ~nsIAttribute();
RefPtr<nsDOMAttributeMap> mAttrMap;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIAttribute, NS_IATTRIBUTE_IID)