Make HTMLOptionsCollection::mSelect into a strong reference.

The cycle collector makes weak references like this obsolete.
This commit is contained in:
wolfbeast 2018-12-14 15:08:52 +01:00 committed by Roy Tam
commit a3386fbe38
4 changed files with 8 additions and 59 deletions

View file

@ -46,7 +46,7 @@ public:
using nsWrapperCache::GetWrapper;
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
protected:
virtual ~HTMLOptionsCollection();
virtual ~HTMLOptionsCollection() = default;
virtual JSObject* GetWrapperPreserveColorInternal() override
{
@ -112,11 +112,6 @@ public:
mElements.AppendElement(aOption);
}
/**
* Drop the reference to the select. Called during select destruction.
*/
void DropReference();
/**
* Finds the index of a given option element.
* If the option isn't part of the collection, return NS_ERROR_FAILURE
@ -161,7 +156,7 @@ private:
* various members such as InsertOptionAt are also infallible. */
nsTArray<RefPtr<mozilla::dom::HTMLOptionElement> > mElements;
/** The select element that contains this array */
HTMLSelectElement* mSelect;
RefPtr<HTMLSelectElement> mSelect;
};
} // namespace dom