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 180c2f41a8c60b0ee78b99a2910d490d79bbb2a5..2fb5729c6d0aa8f34297106feb8e0da8209ca5fb 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 cbc77599c77a4d4aaa62ea88fbe5a241578deecf..e12031d3bacc17bfb2c83e573272ad893976a01f 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 0ecdab10ef2b3df98e527031d9c5fca989ec5b2f..bf6d042d798ad292b59d64824b79bca3435793d6 100644 (file)
@@ -38,7 +38,6 @@ namespace WebCore {
 
 AccessibilityScrollbar::AccessibilityScrollbar(Scrollbar* scrollbar)
     : m_scrollbar(scrollbar)
-    , m_parent(0)
 {
     ASSERT(scrollbar);
 }
index 3d54604aec89b26b3fa21925db9a8e8204c80695..3d48c2dc6504c60e82bb5f61968c89012439fdbc 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