Changeset 100057 in webkit
- Timestamp:
- Nov 11, 2011, 6:23:09 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/accessibility/loading-iframe-updates-axtree-expected.txt (added)
-
LayoutTests/accessibility/loading-iframe-updates-axtree.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/accessibility/AXObjectCache.h (modified) (2 diffs)
-
Source/WebCore/accessibility/AccessibilityObject.h (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityRenderObject.cpp (modified) (3 diffs)
-
Source/WebCore/accessibility/AccessibilityRenderObject.h (modified) (3 diffs)
-
Source/WebCore/accessibility/AccessibilityScrollView.cpp (modified) (3 diffs)
-
Source/WebCore/accessibility/AccessibilityScrollView.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r100051 r100057 1 2011-11-11 Dominic Mazzoni <dmazzoni@google.com> 2 3 New iframe content may not be reflected in the ax tree. 4 https://bugs.webkit.org/show_bug.cgi?id=72100 5 6 Reviewed by Chris Fleizach. 7 8 Add new test that makes sure that if you explore the accessibility 9 tree of an iframe and that iframe subsequently loads new content, 10 the iframe AccessibilityObject's descendants are updated to point 11 to the new content, not the old content. 12 13 * accessibility/loading-iframe-updates-axtree-expected.txt: Added. 14 * accessibility/loading-iframe-updates-axtree.html: Added. 15 1 16 2011-11-11 Julien Chaffraix <jchaffraix@webkit.org> 2 17 -
trunk/Source/WebCore/ChangeLog
r100055 r100057 1 2011-11-11 Dominic Mazzoni <dmazzoni@google.com> 2 3 New iframe content may not be reflected in the ax tree. 4 https://bugs.webkit.org/show_bug.cgi?id=72100 5 6 Reviewed by Chris Fleizach. 7 8 The core issue was that when childrenChanged was called on a 9 web area from an iframe that was just detached, it wasn't calling 10 childrenChanged on its parent scroll area, or that scroll area's 11 parent iframe element. To fix this, now AccessibilityScrollView 12 implements setNeedsToUpdateChildren and parentObjectIfExists, 13 and childrenChanged calls setNeedsToUpdateChildren on every object 14 in the parent chain, not just AccessibilityRenderObjects. 15 16 Test: accessibility/loading-iframe-updates-axtree.html 17 18 * accessibility/AXObjectCache.h: 19 * accessibility/AccessibilityObject.h: 20 (WebCore::AccessibilityObject::setNeedsToUpdateChildren): 21 * accessibility/AccessibilityRenderObject.cpp: 22 (WebCore::AccessibilityRenderObject::parentObjectIfExists): 23 (WebCore::AccessibilityRenderObject::childrenChanged): 24 * accessibility/AccessibilityRenderObject.h: 25 (WebCore::AccessibilityRenderObject::setNeedsToUpdateChildren): 26 * accessibility/AccessibilityScrollView.cpp: 27 (WebCore::AccessibilityScrollView::AccessibilityScrollView): 28 (WebCore::AccessibilityScrollView::updateChildrenIfNecessary): 29 (WebCore::AccessibilityScrollView::parentObject): 30 (WebCore::AccessibilityScrollView::parentObjectIfExists): 31 * accessibility/AccessibilityScrollView.h: 32 (WebCore::AccessibilityScrollView::setNeedsToUpdateChildren): 33 1 34 2011-11-11 Iain Merrick <husky@google.com> 2 35 -
trunk/Source/WebCore/accessibility/AXObjectCache.h
r96343 r100057 77 77 // will only return the AccessibilityObject if it already exists 78 78 AccessibilityObject* get(RenderObject*); 79 AccessibilityObject* get(Widget*); 79 80 80 81 void remove(RenderObject*); … … 172 173 173 174 AXID getAXID(AccessibilityObject*); 174 AccessibilityObject* get(Widget*);175 175 }; 176 176 -
trunk/Source/WebCore/accessibility/AccessibilityObject.h
r97755 r100057 565 565 virtual bool hasChildren() const { return m_haveChildren; } 566 566 virtual void updateChildrenIfNecessary(); 567 virtual void setNeedsToUpdateChildren() { } 567 568 virtual void clearChildren(); 568 569 virtual void detachFromParent() { } -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r99740 r100057 436 436 AccessibilityObject* AccessibilityRenderObject::parentObjectIfExists() const 437 437 { 438 // WebArea's parent should be the scroll view containing it. 439 if (isWebArea()) 440 return axObjectCache()->get(m_renderer->frame()->view()); 441 438 442 return axObjectCache()->get(renderParentObject()); 439 443 } … … 3403 3407 return; 3404 3408 3405 bool sentChildrenChanged = false;3406 3409 axObjectCache()->postNotification(this, document(), AXObjectCache::AXChildrenChanged, true); 3410 3407 3411 // Go up the accessibility parent chain, but only if the element already exists. This method is 3408 3412 // called during render layouts, minimal work should be done. … … 3410 3414 // At the same time, process ARIA live region changes. 3411 3415 for (AccessibilityObject* parent = this; parent; parent = parent->parentObjectIfExists()) { 3412 if (!parent->isAccessibilityRenderObject()) 3413 continue; 3414 3415 AccessibilityRenderObject* axParent = toAccessibilityRenderObject(parent); 3416 3417 // Send the children changed notification on the first accessibility render object ancestor. 3418 if (!sentChildrenChanged) { 3419 axObjectCache()->postNotification(axParent->renderer(), AXObjectCache::AXChildrenChanged, true); 3420 sentChildrenChanged = true; 3421 } 3422 3423 axParent->setNeedsToUpdateChildren(); 3424 3416 parent->setNeedsToUpdateChildren(); 3417 3425 3418 // These notifications always need to be sent because screenreaders are reliant on them to perform. 3426 3419 // In other words, they need to be sent even when the screen reader has not accessed this live region since the last update. 3427 3420 3428 3421 // If this element supports ARIA live regions, then notify the AT of changes. 3429 if ( axParent->supportsARIALiveRegion())3430 axObjectCache()->postNotification( axParent->renderer(), AXObjectCache::AXLiveRegionChanged, true);3422 if (parent->supportsARIALiveRegion()) 3423 axObjectCache()->postNotification(parent, parent->document(), AXObjectCache::AXLiveRegionChanged, true); 3431 3424 3432 3425 // If this element is an ARIA text control, notify the AT of changes. 3433 if ( axParent->isARIATextControl() && !axParent->isNativeTextControl() && !axParent->node()->isContentEditable())3434 axObjectCache()->postNotification( axParent->renderer(), AXObjectCache::AXValueChanged, true);3426 if (parent->isARIATextControl() && !parent->isNativeTextControl() && !parent->node()->isContentEditable()) 3427 axObjectCache()->postNotification(parent, parent->document(), AXObjectCache::AXValueChanged, true); 3435 3428 } 3436 3429 } -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h
r97769 r100057 262 262 RenderObject* m_renderer; 263 263 AccessibilityRole m_ariaRole; 264 mutablebool m_childrenDirty;264 bool m_childrenDirty; 265 265 266 266 void setRenderObject(RenderObject* renderer) { m_renderer = renderer; } … … 281 281 Element* rootEditableElementForPosition(const Position&) const; 282 282 bool nodeIsTextControl(const Node*) const; 283 virtual void setNeedsToUpdateChildren() { m_childrenDirty = true; } 283 284 284 285 Element* menuElementForMenuButton() const; … … 321 322 322 323 bool inheritsPresentationalRole() const; 323 void setNeedsToUpdateChildren() const { m_childrenDirty = true; }324 324 325 325 mutable AccessibilityRole m_roleForMSAA; -
trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp
r97629 r100057 40 40 AccessibilityScrollView::AccessibilityScrollView(ScrollView* view) 41 41 : m_scrollView(view) 42 , m_childrenDirty(false) 42 43 { 43 44 } … … 75 76 void AccessibilityScrollView::updateChildrenIfNecessary() 76 77 { 78 if (m_childrenDirty) 79 clearChildren(); 80 77 81 if (!m_haveChildren) 78 82 addChildren(); … … 175 179 176 180 HTMLFrameOwnerElement* owner = static_cast<FrameView*>(m_scrollView.get())->frame()->ownerElement(); 177 if (owner && owner->renderPart()) 178 return axObjectCache()->getOrCreate(owner->renderPart()->parent()); 181 if (owner && owner->renderer()) 182 return axObjectCache()->getOrCreate(owner->renderer()); 183 184 return 0; 185 } 186 187 AccessibilityObject* AccessibilityScrollView::parentObjectIfExists() const 188 { 189 if (!m_scrollView->isFrameView()) 190 return 0; 191 192 HTMLFrameOwnerElement* owner = static_cast<FrameView*>(m_scrollView.get())->frame()->ownerElement(); 193 if (owner && owner->renderer()) 194 return axObjectCache()->get(owner->renderer()); 179 195 180 196 return 0; 181 197 } 182 198 183 199 } // namespace WebCore -
trunk/Source/WebCore/accessibility/AccessibilityScrollView.h
r97629 r100057 55 55 virtual AccessibilityObject* accessibilityHitTest(const LayoutPoint&) const; 56 56 virtual void updateChildrenIfNecessary(); 57 virtual void setNeedsToUpdateChildren() { m_childrenDirty = true; } 57 58 void updateScrollbars(); 58 59 … … 60 61 virtual LayoutRect elementRect() const; 61 62 virtual AccessibilityObject* parentObject() const; 63 virtual AccessibilityObject* parentObjectIfExists() const; 62 64 63 65 AccessibilityObject* webAreaObject() const; … … 69 71 RefPtr<AccessibilityObject> m_horizontalScrollbar; 70 72 RefPtr<AccessibilityObject> m_verticalScrollbar; 73 bool m_childrenDirty; 71 74 }; 72 75
Note:
See TracChangeset
for help on using the changeset viewer.