1217436 - Make nsIdentifierMapEntry::mIdContentList...

master
Fedor 2020-09-17 07:18:30 +03:00
parent 565954b717
commit c2ac69a62d
1 changed files with 12 additions and 4 deletions

View File

@ -54,13 +54,18 @@ public:
nsStringHashKey(aKey), mNameContentList(nullptr)
{
}
nsIdentifierMapEntry(const nsIdentifierMapEntry& aOther) :
nsStringHashKey(&aOther.GetKey())
nsIdentifierMapEntry(nsIdentifierMapEntry&& aOther) :
nsStringHashKey(&aOther.GetKey()),
mIdContentList(mozilla::Move(aOther.mIdContentList)),
mNameContentList(aOther.mNameContentList.forget()),
mChangeCallbacks(aOther.mChangeCallbacks.forget()),
mImageElement(aOther.mImageElement.forget())
{
NS_ERROR("Should never be called");
}
~nsIdentifierMapEntry();
enum { ALLOW_MEMMOVE = false };
void AddNameElement(nsINode* aDocument, Element* aElement);
void RemoveNameElement(Element* aElement);
bool IsEmpty();
@ -156,12 +161,15 @@ public:
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
private:
nsIdentifierMapEntry(const nsIdentifierMapEntry& aOther) = delete;
nsIdentifierMapEntry& operator=(const nsIdentifierMapEntry& aOther) = delete;
void FireChangeCallbacks(Element* aOldElement, Element* aNewElement,
bool aImageOnly = false);
// empty if there are no elements with this ID.
// The elements are stored as weak pointers.
nsTArray<Element*> mIdContentList;
AutoTArray<Element*, 1> mIdContentList;
RefPtr<nsBaseContentList> mNameContentList;
nsAutoPtr<nsTHashtable<ChangeCallbackEntry> > mChangeCallbacks;
RefPtr<Element> mImageElement;