Changeset 220551 in webkit
- Timestamp:
- Aug 10, 2017 3:15:49 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r220549 r220551 1 2017-08-10 Nan Wang <n_wang@apple.com> 2 3 AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24 4 https://bugs.webkit.org/show_bug.cgi?id=175340 5 <rdar://problem/33782159> 6 7 Reviewed by Chris Fleizach. 8 9 * accessibility/add-children-pseudo-element-expected.txt: Added. 10 * accessibility/add-children-pseudo-element.html: Added. 11 * accessibility/resources/svg-circle.svg: Added. 12 1 13 2017-08-10 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r220549 r220551 1 2017-08-10 Nan Wang <n_wang@apple.com> 2 3 AX: crash at WebCore::AccessibilityObject::supportsARIALiveRegion() const + 24 4 https://bugs.webkit.org/show_bug.cgi?id=175340 5 <rdar://problem/33782159> 6 7 Reviewed by Chris Fleizach. 8 9 The issue here is that we manualy set the parent object of the AccessibilitySVGRoot object 10 and there are chances that the parent doesn't detach it properly during the parent's destroying 11 process. Accessing the stale parent object will lead to a crash. 12 Fixed this by making the parent object a weak pointer so we don't access an invalid memory. 13 14 Test: accessibility/add-children-pseudo-element.html 15 16 * accessibility/AccessibilityRenderObject.cpp: 17 (WebCore::AccessibilityRenderObject::AccessibilityRenderObject): 18 * accessibility/AccessibilityRenderObject.h: 19 (WebCore::AccessibilityRenderObject::createWeakPtr): 20 * accessibility/AccessibilitySVGRoot.cpp: 21 (WebCore::AccessibilitySVGRoot::AccessibilitySVGRoot): 22 (WebCore::AccessibilitySVGRoot::setParent): 23 (WebCore::AccessibilitySVGRoot::parentObject const): 24 * accessibility/AccessibilitySVGRoot.h: 25 1 26 2017-08-10 Chris Dumez <cdumez@apple.com> 2 27 -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r219595 r220551 110 110 : AccessibilityNodeObject(renderer->node()) 111 111 , m_renderer(renderer) 112 , m_weakPtrFactory(this) 112 113 { 113 114 #ifndef NDEBUG -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h
r215975 r220551 32 32 #include "LayoutRect.h" 33 33 #include <wtf/Forward.h> 34 #include <wtf/WeakPtr.h> 34 35 35 36 namespace WebCore { … … 199 200 200 201 String passwordFieldValue() const override; 202 203 WeakPtr<AccessibilityRenderObject> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); } 201 204 202 205 protected: … … 218 221 219 222 private: 223 WeakPtrFactory<AccessibilityRenderObject> m_weakPtrFactory; 220 224 bool isAccessibilityRenderObject() const final { return true; } 221 225 void ariaListboxSelectedChildren(AccessibilityChildrenVector&); -
trunk/Source/WebCore/accessibility/AccessibilitySVGRoot.cpp
r198137 r220551 36 36 AccessibilitySVGRoot::AccessibilitySVGRoot(RenderObject* renderer) 37 37 : AccessibilitySVGElement(renderer) 38 , m_parent(nullptr)39 38 { 40 39 } … … 48 47 return adoptRef(*new AccessibilitySVGRoot(renderer)); 49 48 } 49 50 void AccessibilitySVGRoot::setParent(AccessibilityRenderObject *parent) 51 { 52 if (parent) 53 m_parent = parent->createWeakPtr(); 54 else 55 m_parent = nullptr; 56 } 50 57 51 58 AccessibilityObject* AccessibilitySVGRoot::parentObject() const … … 54 61 // but otherwise, we should rely on the standard render tree for the parent. 55 62 if (m_parent) 56 return m_parent ;63 return m_parent.get(); 57 64 58 65 return AccessibilitySVGElement::parentObject(); -
trunk/Source/WebCore/accessibility/AccessibilitySVGRoot.h
r208179 r220551 30 30 31 31 #include "AccessibilitySVGElement.h" 32 #include <wtf/WeakPtr.h> 32 33 33 34 namespace WebCore { … … 38 39 virtual ~AccessibilitySVGRoot(); 39 40 40 void setParent(Accessibility Object* parent) { m_parent = parent; }41 void setParent(AccessibilityRenderObject*); 41 42 42 43 private: … … 46 47 bool isAccessibilitySVGRoot() const override { return true; } 47 48 48 AccessibilityObject*m_parent;49 WeakPtr<AccessibilityRenderObject> m_parent; 49 50 AccessibilityRole roleValue() const override { return GroupRole; } 50 51 };
Note: See TracChangeset
for help on using the changeset viewer.