Unreviewed manual rollout of r243929
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Apr 2019 18:32:43 +0000 (18:32 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Apr 2019 18:32:43 +0000 (18:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196626

Source/WebCore:

* dom/Element.h:
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::FormAssociatedElement):
(WebCore::FormAssociatedElement::insertedIntoAncestor):
(WebCore::FormAssociatedElement::setForm):
(WebCore::FormAssociatedElement::resetFormOwner):
(WebCore::FormAssociatedElement::formAttributeChanged):
* html/FormAssociatedElement.h:
(WebCore::FormAssociatedElement::form const):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::asFormNamedItem): Deleted.
(WebCore::HTMLElement::asFormAssociatedElement): Deleted.
* html/HTMLElement.h:
(WebCore::HTMLElement::asFormNamedItem):
* html/HTMLFormControlElement.h:
* html/HTMLFormControlsCollection.cpp:
(WebCore:: const):
(WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
* html/HTMLFormControlsCollection.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
(WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
(WebCore::HTMLFormElement::registerImgElement):
(WebCore::HTMLFormElement::defaultButton const):
(WebCore::HTMLFormElement::resetDefaultButton):
(WebCore::HTMLFormElement::matchesValidPseudoClass const):
(WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
* html/HTMLFormElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::HTMLImageElement):
(WebCore::HTMLImageElement::insertedIntoAncestor):
* html/HTMLImageElement.h:
* html/HTMLInputElement.h:
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.h:
* html/HTMLPictureElement.h:
* html/HTMLSlotElement.h:
* svg/SVGElement.h:

Source/WTF:

* wtf/WeakHashSet.h:
(WTF::WeakHashSet::remove):
(WTF::WeakHashSet::contains const):
(WTF::WeakHashSet::computesEmpty const): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243941 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/WeakHashSet.h
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.h
Source/WebCore/html/FormAssociatedElement.cpp
Source/WebCore/html/FormAssociatedElement.h
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/html/HTMLElement.h
Source/WebCore/html/HTMLFormControlElement.h
Source/WebCore/html/HTMLFormControlsCollection.cpp
Source/WebCore/html/HTMLFormControlsCollection.h
Source/WebCore/html/HTMLFormElement.cpp
Source/WebCore/html/HTMLFormElement.h
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLImageElement.h
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLObjectElement.h
Source/WebCore/html/HTMLPictureElement.h
Source/WebCore/html/HTMLSlotElement.h
Source/WebCore/svg/SVGElement.h

index bc7b7eb..ca6fb43 100644 (file)
@@ -1,3 +1,13 @@
+2019-04-05  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Unreviewed manual rollout of r243929
+        https://bugs.webkit.org/show_bug.cgi?id=196626
+
+        * wtf/WeakHashSet.h:
+        (WTF::WeakHashSet::remove):
+        (WTF::WeakHashSet::contains const):
+        (WTF::WeakHashSet::computesEmpty const): Deleted.
+
 2019-04-05  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r243833.
index c390232..8142892 100644 (file)
@@ -91,19 +91,17 @@ public:
         m_set.add(*makeWeakPtr(value).m_ref);
     }
 
-    template <typename U>
-    bool remove(const U& value)
+    void remove(const T& value)
     {
-        auto* weakReference = weak_reference_downcast<T>(value.weakPtrFactory().m_ref.get());
+        auto* weakReference = value.weakPtrFactory().m_ref.get();
         if (!weakReference)
-            return false;
-        return m_set.remove(weakReference);
+            return;
+        m_set.remove(weakReference);
     }
 
-    template <typename U>
-    bool contains(const U& value) const
+    bool contains(const T& value) const
     {
-        auto* weakReference = weak_reference_downcast<T>(value.weakPtrFactory().m_ref.get());
+        auto* weakReference = value.weakPtrFactory().m_ref.get();
         if (!weakReference)
             return false;
         return m_set.contains(weakReference);
@@ -111,17 +109,6 @@ public:
 
     unsigned capacity() const { return m_set.capacity(); }
 
-    bool computesEmpty() const
-    {
-        if (m_set.isEmpty())
-            return true;
-        for (auto& value : m_set) {
-            if (value->get())
-                return false;
-        }
-        return true;
-    }
-
     unsigned computeSize() const
     {
         const_cast<WeakReferenceSet&>(m_set).removeIf([] (auto& value) { return !value->get(); });
index 5ba0aa4..23d2a1b 100644 (file)
@@ -1,3 +1,47 @@
+2019-04-05  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Unreviewed manual rollout of r243929
+        https://bugs.webkit.org/show_bug.cgi?id=196626
+
+        * dom/Element.h:
+        * html/FormAssociatedElement.cpp:
+        (WebCore::FormAssociatedElement::FormAssociatedElement):
+        (WebCore::FormAssociatedElement::insertedIntoAncestor):
+        (WebCore::FormAssociatedElement::setForm):
+        (WebCore::FormAssociatedElement::resetFormOwner):
+        (WebCore::FormAssociatedElement::formAttributeChanged):
+        * html/FormAssociatedElement.h:
+        (WebCore::FormAssociatedElement::form const):
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::asFormNamedItem): Deleted.
+        (WebCore::HTMLElement::asFormAssociatedElement): Deleted.
+        * html/HTMLElement.h:
+        (WebCore::HTMLElement::asFormNamedItem):
+        * html/HTMLFormControlElement.h:
+        * html/HTMLFormControlsCollection.cpp:
+        (WebCore:: const):
+        (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
+        * html/HTMLFormControlsCollection.h:
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
+        (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
+        (WebCore::HTMLFormElement::registerImgElement):
+        (WebCore::HTMLFormElement::defaultButton const):
+        (WebCore::HTMLFormElement::resetDefaultButton):
+        (WebCore::HTMLFormElement::matchesValidPseudoClass const):
+        (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
+        * html/HTMLFormElement.h:
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::HTMLImageElement):
+        (WebCore::HTMLImageElement::insertedIntoAncestor):
+        * html/HTMLImageElement.h:
+        * html/HTMLInputElement.h:
+        * html/HTMLMediaElement.h:
+        * html/HTMLObjectElement.h:
+        * html/HTMLPictureElement.h:
+        * html/HTMLSlotElement.h:
+        * svg/SVGElement.h:
+
 2019-04-05  Sihui Liu  <sihui_liu@apple.com>
 
         [iOS] Web process gets suspended while holding locked database files
index 5f3f876..cfc5a4c 100644 (file)
@@ -77,7 +77,7 @@ enum SpellcheckAttributeState {
 enum class TouchAction : uint8_t;
 #endif
 
-class Element : public ContainerNode , public CanMakeWeakPtr<Element> {
+class Element : public ContainerNode {
     WTF_MAKE_ISO_ALLOCATED(Element);
 public:
     static Ref<Element> create(const QualifiedName&, Document&);
index 25220cb..26cd842 100644 (file)
@@ -52,7 +52,7 @@ private:
 
 FormAssociatedElement::FormAssociatedElement(HTMLFormElement* form)
     : m_form(nullptr)
-    , m_formSetByParser(makeWeakPtr(form))
+    , m_formSetByParser(form)
 {
 }
 
@@ -74,7 +74,7 @@ void FormAssociatedElement::insertedIntoAncestor(Node::InsertionType insertionTy
     if (m_formSetByParser) {
         // The form could have been removed by a script during parsing.
         if (m_formSetByParser->isConnected())
-            setForm(m_formSetByParser.get());
+            setForm(m_formSetByParser);
         m_formSetByParser = nullptr;
     }
 
@@ -146,9 +146,9 @@ void FormAssociatedElement::setForm(HTMLFormElement* newForm)
     willChangeForm();
     if (m_form)
         m_form->removeFormElement(this);
-    m_form = makeWeakPtr(newForm);
-    if (newForm)
-        newForm->registerFormElement(this);
+    m_form = newForm;
+    if (m_form)
+        m_form->registerFormElement(this);
     didChangeForm();
 }
 
@@ -172,11 +172,10 @@ void FormAssociatedElement::formWillBeDestroyed()
 
 void FormAssociatedElement::resetFormOwner()
 {
-    RefPtr<HTMLFormElement> originalForm = m_form.get();
-    setForm(findAssociatedForm(&asHTMLElement(), originalForm.get()));
+    RefPtr<HTMLFormElement> originalForm = m_form;
+    setForm(findAssociatedForm(&asHTMLElement(), m_form));
     HTMLElement& element = asHTMLElement();
-    auto* newForm = m_form.get();
-    if (newForm && newForm != originalForm && newForm->isConnected())
+    if (m_form && m_form != originalForm && m_form->isConnected())
         element.document().didAssociateFormControl(element);
 }
 
@@ -185,11 +184,9 @@ void FormAssociatedElement::formAttributeChanged()
     HTMLElement& element = asHTMLElement();
     if (!element.hasAttributeWithoutSynchronization(formAttr)) {
         // The form attribute removed. We need to reset form owner here.
-        RefPtr<HTMLFormElement> originalForm = m_form.get();
-        // FIXME: Why does this not pass originalForm to findClosestFormAncestor?
+        RefPtr<HTMLFormElement> originalForm = m_form;
         setForm(HTMLFormElement::findClosestFormAncestor(element));
-        auto* newForm = m_form.get();
-        if (newForm && newForm != originalForm && newForm->isConnected())
+        if (m_form && m_form != originalForm && m_form->isConnected())
             element.document().didAssociateFormControl(element);
         m_formAttributeTargetObserver = nullptr;
     } else {
index 5c84a19..1275003 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "FormNamedItem.h"
 #include "Node.h"
-#include <wtf/WeakPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -48,7 +47,7 @@ public:
     void deref() { derefFormAssociatedElement(); }
 
     static HTMLFormElement* findAssociatedForm(const HTMLElement*, HTMLFormElement*);
-    HTMLFormElement* form() const { return m_form.get(); }
+    HTMLFormElement* form() const { return m_form; }
     ValidityState* validity();
 
     virtual bool isFormControlElement() const = 0;
@@ -118,8 +117,8 @@ private:
     bool isFormAssociatedElement() const final { return true; }
 
     std::unique_ptr<FormAttributeTargetObserver> m_formAttributeTargetObserver;
-    WeakPtr<HTMLFormElement> m_form;
-    WeakPtr<HTMLFormElement> m_formSetByParser;
+    HTMLFormElement* m_form;
+    HTMLFormElement* m_formSetByParser;
     String m_customValidationMessage;
 };
 
index 9e0441b..7627e21 100644 (file)
@@ -762,16 +762,6 @@ HTMLFormElement* HTMLElement::form() const
     return HTMLFormElement::findClosestFormAncestor(*this);
 }
 
-FormNamedItem* HTMLElement::asFormNamedItem()
-{
-    return nullptr;
-}
-
-FormAssociatedElement* HTMLElement::asFormAssociatedElement()
-{
-    return nullptr;
-}
-
 static inline bool elementAffectsDirectionality(const Node& node)
 {
     if (!is<HTMLElement>(node))
index b3b923f..b851909 100644 (file)
@@ -32,7 +32,6 @@
 namespace WebCore {
 
 class DocumentFragment;
-class FormAssociatedElement;
 class FormNamedItem;
 class HTMLCollection;
 class HTMLFormElement;
@@ -89,8 +88,7 @@ public:
     bool willRespondToMouseClickEvents() override;
 
     virtual bool isLabelable() const { return false; }
-    virtual FormNamedItem* asFormNamedItem();
-    virtual FormAssociatedElement* asFormAssociatedElement();
+    virtual FormNamedItem* asFormNamedItem() { return 0; }
 
     bool hasTagName(const HTMLQualifiedName& name) const { return hasLocalName(name.localName()); }
 
index 45fdac2..9a42e4e 100644 (file)
@@ -175,8 +175,7 @@ private:
 
     HTMLElement& asHTMLElement() final { return *this; }
     const HTMLFormControlElement& asHTMLElement() const final { return *this; }
-    FormNamedItem* asFormNamedItem() final { return this; }
-    FormAssociatedElement* asFormAssociatedElement() final { return this; }
+    HTMLFormControlElement* asFormNamedItem() final { return this; }
 
     bool needsMouseFocusableQuirk() const;
 
index 430f40d..5c9756c 100644 (file)
@@ -75,6 +75,11 @@ Vector<Ref<FormAssociatedElement>> HTMLFormControlsCollection::copyFormControlEl
     return ownerNode().copyAssociatedElementsVector();
 }
 
+const Vector<HTMLImageElement*>& HTMLFormControlsCollection::formImageElements() const
+{
+    return ownerNode().imageElements();
+}
+
 static unsigned findFormAssociatedElement(const Vector<FormAssociatedElement*>& elements, const Element& element)
 {
     for (unsigned i = 0; i < elements.size(); ++i) {
@@ -140,9 +145,7 @@ void HTMLFormControlsCollection::updateNamedElementCache() const
         }
     }
 
-    for (auto& elementPtr : ownerNode().imageElements()) {
-        if (!elementPtr)
-            continue;
+    for (auto* elementPtr : formImageElements()) {
         HTMLImageElement& element = *elementPtr;
         const AtomicString& id = element.getIdAttribute();
         if (!id.isEmpty() && !foundInputElements.contains(id.impl()))
index 774e54f..bfd009e 100644 (file)
@@ -56,6 +56,7 @@ private:
 
     const Vector<FormAssociatedElement*>& unsafeFormControlElements() const;
     Vector<Ref<FormAssociatedElement>> copyFormControlElementsVector() const;
+    const Vector<HTMLImageElement*>& formImageElements() const;
 
     mutable Element* m_cachedElement;
     mutable unsigned m_cachedElementOffsetInArray;
index 48fc4eb..ab63b89 100644 (file)
@@ -566,15 +566,15 @@ void HTMLFormElement::registerInvalidAssociatedFormControl(const HTMLFormControl
     ASSERT_WITH_MESSAGE(!is<HTMLFieldSetElement>(formControlElement), "FieldSet are never candidates for constraint validation.");
     ASSERT(static_cast<const Element&>(formControlElement).matchesInvalidPseudoClass());
 
-    if (m_invalidAssociatedFormControls.computesEmpty())
+    if (m_invalidAssociatedFormControls.isEmpty())
         invalidateStyleForSubtree();
-    m_invalidAssociatedFormControls.add(const_cast<HTMLFormControlElement&>(formControlElement));
+    m_invalidAssociatedFormControls.add(&formControlElement);
 }
 
 void HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded(const HTMLFormControlElement& formControlElement)
 {
-    if (m_invalidAssociatedFormControls.remove(formControlElement)) {
-        if (m_invalidAssociatedFormControls.computesEmpty())
+    if (m_invalidAssociatedFormControls.remove(&formControlElement)) {
+        if (m_invalidAssociatedFormControls.isEmpty())
             invalidateStyleForSubtree();
     }
 }
@@ -587,7 +587,7 @@ bool HTMLFormElement::isURLAttribute(const Attribute& attribute) const
 void HTMLFormElement::registerImgElement(HTMLImageElement* e)
 {
     ASSERT(m_imageElements.find(e) == notFound);
-    m_imageElements.append(makeWeakPtr(e));
+    m_imageElements.append(e);
 }
 
 void HTMLFormElement::removeImgElement(HTMLImageElement* e)
@@ -681,18 +681,18 @@ HTMLFormControlElement* HTMLFormElement::findSubmitButton(const Event* event) co
 
 HTMLFormControlElement* HTMLFormElement::defaultButton() const
 {
-    if (m_defaultButton)
-        return m_defaultButton.get();
-    for (auto& associatedElement : m_associatedElements) {
-        if (!is<HTMLFormControlElement>(*associatedElement))
-            continue;
-        HTMLFormControlElement& control = downcast<HTMLFormControlElement>(*associatedElement);
-        if (control.isSuccessfulSubmitButton()) {
-            m_defaultButton = makeWeakPtr(control);
-            return &control;
+    if (!m_defaultButton) {
+        for (auto& associatedElement : m_associatedElements) {
+            if (!is<HTMLFormControlElement>(*associatedElement))
+                continue;
+            HTMLFormControlElement& control = downcast<HTMLFormControlElement>(*associatedElement);
+            if (control.isSuccessfulSubmitButton()) {
+                m_defaultButton = &control;
+                break;
+            }
         }
     }
-    return nullptr;
+    return m_defaultButton;
 }
 
 void HTMLFormElement::resetDefaultButton()
@@ -706,7 +706,8 @@ void HTMLFormElement::resetDefaultButton()
 
     ScriptDisallowedScope::InMainThread scriptDisallowedScope;
 
-    auto oldDefault = WTFMove(m_defaultButton);
+    auto* oldDefault = m_defaultButton;
+    m_defaultButton = nullptr;
     defaultButton();
     if (m_defaultButton != oldDefault) {
         if (oldDefault)
@@ -809,12 +810,12 @@ void HTMLFormElement::removeFromPastNamesMap(FormNamedItem* item)
 
 bool HTMLFormElement::matchesValidPseudoClass() const
 {
-    return m_invalidAssociatedFormControls.computesEmpty();
+    return m_invalidAssociatedFormControls.isEmpty();
 }
 
 bool HTMLFormElement::matchesInvalidPseudoClass() const
 {
-    return !matchesValidPseudoClass();
+    return !m_invalidAssociatedFormControls.isEmpty();
 }
 
 // FIXME: Use Ref<HTMLElement> for the function result since there are no non-HTML elements returned here.
index 19b039a..52ffdf1 100644 (file)
@@ -29,7 +29,6 @@
 #include "RadioButtonGroups.h"
 #include <memory>
 #include <wtf/IsoMalloc.h>
-#include <wtf/WeakHashSet.h>
 
 #if ENABLE(IOS_AUTOCORRECT_AND_AUTOCAPITALIZE)
 #include "Autocapitalize.h"
@@ -121,7 +120,7 @@ public:
 
     WEBCORE_EXPORT const Vector<FormAssociatedElement*>& unsafeAssociatedElements() const;
     Vector<Ref<FormAssociatedElement>> copyAssociatedElementsVector() const;
-    const Vector<WeakPtr<HTMLImageElement>>& imageElements() const { return m_imageElements; }
+    const Vector<HTMLImageElement*>& imageElements() const { return m_imageElements; }
 
     StringPairVector textFieldValues() const;
 
@@ -174,13 +173,13 @@ private:
     std::unique_ptr<PastNamesMap> m_pastNamesMap;
 
     RadioButtonGroups m_radioButtonGroups;
-    mutable WeakPtr<HTMLFormControlElement> m_defaultButton;
+    mutable HTMLFormControlElement* m_defaultButton { nullptr };
 
     unsigned m_associatedElementsBeforeIndex { 0 };
     unsigned m_associatedElementsAfterIndex { 0 };
     Vector<FormAssociatedElement*> m_associatedElements;
-    Vector<WeakPtr<HTMLImageElement>> m_imageElements;
-    WeakHashSet<HTMLFormControlElement> m_invalidAssociatedFormControls;
+    Vector<HTMLImageElement*> m_imageElements;
+    HashSet<const HTMLFormControlElement*> m_invalidAssociatedFormControls;
 
     bool m_wasUserSubmitted { false };
     bool m_isSubmittingOrPreparingForSubmission { false };
index d172d6b..d047978 100644 (file)
@@ -71,7 +71,7 @@ HTMLImageElement::HTMLImageElement(const QualifiedName& tagName, Document& docum
     : HTMLElement(tagName, document)
     , m_imageLoader(*this)
     , m_form(nullptr)
-    , m_formSetByParser(makeWeakPtr(form))
+    , m_formSetByParser(form)
     , m_compositeOperator(CompositeSourceOver)
     , m_imageDevicePixelRatio(1.0f)
 #if ENABLE(SERVICE_CONTROLS)
@@ -330,7 +330,8 @@ void HTMLImageElement::didAttachRenderers()
 Node::InsertedIntoAncestorResult HTMLImageElement::insertedIntoAncestor(InsertionType insertionType, ContainerNode& parentOfInsertedTree)
 {
     if (m_formSetByParser) {
-        m_form = WTFMove(m_formSetByParser);
+        m_form = m_formSetByParser;
+        m_formSetByParser = nullptr;
         m_form->registerImgElement(this);
     }
 
@@ -340,10 +341,9 @@ Node::InsertedIntoAncestorResult HTMLImageElement::insertedIntoAncestor(Insertio
     }
 
     if (!m_form) {
-        if (auto* newForm = HTMLFormElement::findClosestFormAncestor(*this)) {
-            m_form = makeWeakPtr(newForm);
-            newForm->registerImgElement(this);
-        }
+        m_form = HTMLFormElement::findClosestFormAncestor(*this);
+        if (m_form)
+            m_form->registerImgElement(this);
     }
 
     // Insert needs to complete first, before we start updating the loader. Loader dispatches events which could result
index 1869880..d20fa72 100644 (file)
@@ -173,8 +173,8 @@ private:
 #endif
 
     HTMLImageLoader m_imageLoader;
-    WeakPtr<HTMLFormElement> m_form;
-    WeakPtr<HTMLFormElement> m_formSetByParser;
+    HTMLFormElement* m_form;
+    HTMLFormElement* m_formSetByParser;
 
     CompositeOperator m_compositeOperator;
     AtomicString m_bestFitImageURL;
index 276dbc9..de5c501 100644 (file)
@@ -54,7 +54,7 @@ struct InputElementClickState {
     RefPtr<HTMLInputElement> checkedRadioButton;
 };
 
-class HTMLInputElement : public HTMLTextFormControlElement {
+class HTMLInputElement : public HTMLTextFormControlElement, public CanMakeWeakPtr<HTMLInputElement> {
     WTF_MAKE_ISO_ALLOCATED(HTMLInputElement);
 public:
     static Ref<HTMLInputElement> create(const QualifiedName&, Document&, HTMLFormElement*, bool createdByParser);
index 576c7dc..85cd06d 100644 (file)
@@ -126,6 +126,7 @@ class HTMLMediaElement
     : public HTMLElement
     , public ActiveDOMObject
     , public MediaControllerInterface
+    , public CanMakeWeakPtr<HTMLMediaElement>
     , public PlatformMediaSessionClient
     , private MediaCanStartListener
     , private MediaPlayerClient
index bbbbc85..7636918 100644 (file)
@@ -91,7 +91,6 @@ private:
     void derefFormAssociatedElement() final { deref(); }
 
     FormNamedItem* asFormNamedItem() final { return this; }
-    FormAssociatedElement* asFormAssociatedElement() final { return this; }
     HTMLObjectElement& asHTMLElement() final { return *this; }
     const HTMLObjectElement& asHTMLElement() const final { return *this; }
 
index dd98d65..7704fd3 100644 (file)
@@ -30,7 +30,7 @@
 
 namespace WebCore {
 
-class HTMLPictureElement final : public HTMLElement {
+class HTMLPictureElement final : public HTMLElement, public CanMakeWeakPtr<HTMLPictureElement> {
     WTF_MAKE_ISO_ALLOCATED(HTMLPictureElement);
 public:
     static Ref<HTMLPictureElement> create(const QualifiedName&, Document&);
index ef8aecb..311bcee 100644 (file)
@@ -30,7 +30,7 @@
 
 namespace WebCore {
 
-class HTMLSlotElement final : public HTMLElement {
+class HTMLSlotElement final : public HTMLElement, public CanMakeWeakPtr<HTMLSlotElement> {
     WTF_MAKE_ISO_ALLOCATED(HTMLSlotElement);
 public:
     static Ref<HTMLSlotElement> create(const QualifiedName&, Document&);
index a4beeea..979ad43 100644 (file)
@@ -47,7 +47,7 @@ class SVGUseElement;
 
 void mapAttributeToCSSProperty(HashMap<AtomicStringImpl*, CSSPropertyID>* propertyNameToIdMap, const QualifiedName& attrName);
 
-class SVGElement : public StyledElement, public SVGLangSpace, public SVGPropertyOwner {
+class SVGElement : public StyledElement, public SVGLangSpace, public SVGPropertyOwner, public CanMakeWeakPtr<SVGElement> {
     WTF_MAKE_ISO_ALLOCATED(SVGElement);
 public:
     bool isOutermostSVGSVGElement() const;