AX: CrashTracer: [USER] 296 crashes in WebProcess at com.apple.WebCore: WebCore:...
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Oct 2011 21:25:34 +0000 (21:25 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Oct 2011 21:25:34 +0000 (21:25 +0000)
https://bugs.webkit.org/show_bug.cgi?id=69936

AX Scrollbars have a weak pointer to their parent. They need to become AccessibilityMockObjects, so that they can
participate in the detachFromParent() methods that happens when those parents go away.
Could not reproduce the crash, but the backtrace is unequivocal.

Reviewed by Darin Adler.

* accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::removeChildScrollbar):
* accessibility/AccessibilityScrollbar.cpp:
(WebCore::AccessibilityScrollbar::AccessibilityScrollbar):
* accessibility/AccessibilityScrollbar.h:
(WebCore::AccessibilityScrollbar::scrollbar):
(WebCore::AccessibilityScrollbar::isAccessibilityScrollbar):

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

Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityScrollView.cpp
Source/WebCore/accessibility/AccessibilityScrollbar.cpp
Source/WebCore/accessibility/AccessibilityScrollbar.h

index 180c2f4..2fb5729 100644 (file)
@@ -1,3 +1,22 @@
+2011-10-12  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: CrashTracer: [USER] 296 crashes in WebProcess at com.apple.WebCore: WebCore::AccessibilityScrollbar::document const + 29
+        https://bugs.webkit.org/show_bug.cgi?id=69936
+
+        AX Scrollbars have a weak pointer to their parent. They need to become AccessibilityMockObjects, so that they can
+        participate in the detachFromParent() methods that happens when those parents go away.
+        Could not reproduce the crash, but the backtrace is unequivocal.
+
+        Reviewed by Darin Adler.
+
+        * accessibility/AccessibilityScrollView.cpp:
+        (WebCore::AccessibilityScrollView::removeChildScrollbar):
+        * accessibility/AccessibilityScrollbar.cpp:
+        (WebCore::AccessibilityScrollbar::AccessibilityScrollbar):
+        * accessibility/AccessibilityScrollbar.h:
+        (WebCore::AccessibilityScrollbar::scrollbar):
+        (WebCore::AccessibilityScrollbar::isAccessibilityScrollbar):
+
 2011-10-12  David Hyatt  <hyatt@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=69950
index cbc7759..e12031d 100644 (file)
@@ -99,8 +99,10 @@ void AccessibilityScrollView::updateChildrenIfNecessary()
 void AccessibilityScrollView::removeChildScrollbar(AccessibilityObject* scrollbar)
 {
     size_t pos = m_children.find(scrollbar);
-    if (pos != WTF::notFound)
+    if (pos != WTF::notFound) {
+        m_children[pos]->detachFromParent();
         m_children.remove(pos);
+    }
 }
     
 AccessibilityScrollbar* AccessibilityScrollView::addChildScrollbar(Scrollbar* scrollbar)
index 0ecdab1..bf6d042 100644 (file)
@@ -38,7 +38,6 @@ namespace WebCore {
 
 AccessibilityScrollbar::AccessibilityScrollbar(Scrollbar* scrollbar)
     : m_scrollbar(scrollbar)
-    , m_parent(0)
 {
     ASSERT(scrollbar);
 }
index 3d54604..3d48c2d 100644 (file)
 #ifndef AccessibilityScrollbar_h
 #define AccessibilityScrollbar_h
 
-#include "AccessibilityObject.h"
+#include "AccessibilityMockObject.h"
 
 namespace WebCore {
 
 class Scrollbar;
 
-class AccessibilityScrollbar : public AccessibilityObject {
+class AccessibilityScrollbar : public AccessibilityMockObject {
 public:
     static PassRefPtr<AccessibilityScrollbar> create(Scrollbar*);
 
     Scrollbar* scrollbar() const { return m_scrollbar.get(); }
-    void setParent(AccessibilityObject* parent) { m_parent = parent; }
     
 private:
     AccessibilityScrollbar(Scrollbar*);
@@ -50,7 +49,6 @@ private:
     virtual bool canSetNumericValue() const { return true; }
 
     virtual bool isAccessibilityScrollbar() const { return true; }
-    virtual AccessibilityObject* parentObject() const { return m_parent; }
     virtual LayoutRect elementRect() const;
     
     virtual AccessibilityRole roleValue() const { return ScrollBarRole; }
@@ -64,7 +62,6 @@ private:
 
     RefPtr<Scrollbar> m_scrollbar;
     AccessibilityOrientation m_orientation;
-    AccessibilityObject* m_parent;
 };
 
 } // namespace WebCore