Elements retained by AccessibilityImageMapLink leak
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 Sep 2013 04:15:35 +0000 (04:15 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 7 Sep 2013 04:15:35 +0000 (04:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=120917

Reviewed by Chris Fleizach.

Merge https://chromium.googlesource.com/chromium/blink/+/df0bd288efe65e5e38425fbdcdfc68b5a2a79e42

Unfortunately, the test added by the Blink change doesn't reproduce a leak in WebKit.

* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::detachFromParent):
* accessibility/AccessibilityImageMapLink.h:
* accessibility/AccessibilityMockObject.h:
(WebCore::AccessibilityMockObject::detachFromParent):

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

Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityImageMapLink.cpp
Source/WebCore/accessibility/AccessibilityImageMapLink.h
Source/WebCore/accessibility/AccessibilityMockObject.h

index 70d56063dc69c1c6155186ce57e143e5e039ae55..a281f22c7149f321813f482c93c731087246f348 100644 (file)
@@ -1,3 +1,20 @@
+2013-09-06  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Elements retained by AccessibilityImageMapLink leak
+        https://bugs.webkit.org/show_bug.cgi?id=120917
+
+        Reviewed by Chris Fleizach.
+
+        Merge https://chromium.googlesource.com/chromium/blink/+/df0bd288efe65e5e38425fbdcdfc68b5a2a79e42
+
+        Unfortunately, the test added by the Blink change doesn't reproduce a leak in WebKit.
+
+        * accessibility/AccessibilityImageMapLink.cpp:
+        (WebCore::AccessibilityImageMapLink::detachFromParent):
+        * accessibility/AccessibilityImageMapLink.h:
+        * accessibility/AccessibilityMockObject.h:
+        (WebCore::AccessibilityMockObject::detachFromParent):
+
 2013-09-06  Andreas Kling  <akling@apple.com>
 
         Make Obj-C bindings generator less #include-happy.
index 20386cbfdac5d09def715aa6f672e77de53b6b16..1cb1c69c534336f9da1ce8bb5839aec5c0ff02eb 100644 (file)
@@ -147,7 +147,14 @@ RenderObject* AccessibilityImageMapLink::imageMapLinkRenderer() const
     
     return renderer;
 }
-    
+
+void AccessibilityImageMapLink::detachFromParent()
+{
+    AccessibilityMockObject::detachFromParent();
+    m_areaElement = 0;
+    m_mapElement = 0;
+}
+
 Path AccessibilityImageMapLink::elementPath() const
 {
     RenderObject* renderer = imageMapLinkRenderer();
index 40fb926780294dca15bc19dd037ddb014ce8f34a..7a3ec082de02ee6a987b7c0b7b100d393110a2ee 100644 (file)
@@ -71,7 +71,9 @@ public:
 private:    
     RefPtr<HTMLAreaElement> m_areaElement;
     RefPtr<HTMLMapElement> m_mapElement;
-    
+
+    virtual void detachFromParent() OVERRIDE;
+
     virtual Path elementPath() const;
     RenderObject* imageMapLinkRenderer() const;
     virtual void accessibilityText(Vector<AccessibilityText>&);
index 8a9a36e89805058dd7224bfb7c77ca81afeb57d9..d3c142a51f63025fcc845ddb1991d4da049a1972 100644 (file)
@@ -40,16 +40,17 @@ public:
     virtual AccessibilityObject* parentObject() const { return m_parent; }
     virtual void setParent(AccessibilityObject* parent) { m_parent = parent; };
     virtual bool isEnabled() const { return true; }
-    
+
 protected:
     AccessibilityObject* m_parent;
 
+    // Must be called when the parent object clears its children.
+    virtual void detachFromParent() { m_parent = 0; }
+
 private:
     virtual bool isMockObject() const { return true; }
 
     virtual bool computeAccessibilityIsIgnored() const;
-    // Must be called when the parent object clears its children.
-    virtual void detachFromParent() { m_parent = 0; }
 }; 
     
 inline AccessibilityMockObject* toAccessibilityMockObject(AccessibilityObject* object)