Changeset 132699 in webkit
- Timestamp:
- Oct 26, 2012 2:57:57 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r132696 r132699 1 2012-10-26 Dominic Mazzoni <dmazzoni@google.com> 2 3 AX: Notification should be sent when accessibilityIsIgnored changes 4 https://bugs.webkit.org/show_bug.cgi?id=99547 5 6 Reviewed by Chris Fleizach. 7 8 Adds 3 new test to ensure: 9 1. A "children changed" notification is fired on the parent object when an 10 object that was previously ignored becomes unignored. 11 2. A notification is sent when an element's text (incl. title or label) changes. 12 3. A notification is sent when another ARIA attribute changes. 13 14 Modifies add-to-menu-list-crashes because it was too brittle; it was 15 referencing a stale object rather than retrieving its latest handle. 16 Modifies aria-checkbox-sends-notification to listen on the correct 17 object on all platforms. 18 Simplifies notification-listeners so it doesn't generate additional 19 notifications that are inconsistent between platforms now. 20 21 * accessibility/aria-checkbox-sends-notification.html: 22 * accessibility/notification-listeners.html: 23 * platform/chromium/accessibility/add-to-menu-list-crashes-expected.txt: 24 * platform/chromium/accessibility/add-to-menu-list-crashes.html: 25 * platform/chromium/accessibility/is-ignored-change-sends-notification-expected.txt: Added. 26 * platform/chromium/accessibility/is-ignored-change-sends-notification.html: Added. 27 * platform/chromium/accessibility/other-aria-attribute-change-sends-notification-expected.txt: Added. 28 * platform/chromium/accessibility/other-aria-attribute-change-sends-notification.html: Added. 29 * platform/chromium/accessibility/text-change-notification-expected.txt: Added. 30 * platform/chromium/accessibility/text-change-notification.html: Added. 31 1 32 2012-10-26 Vincent Scheib <scheib@chromium.org> 2 33 -
trunk/LayoutTests/accessibility/aria-checkbox-sends-notification.html
r132549 r132699 8 8 9 9 description("This tests that checking of an aria checkbox sends a notification."); 10 window.root = accessibilityController.rootElement;11 window.body = root.childAtIndex(0);12 10 13 var accessibleCheckbox = body.childAtIndex(0);11 var accessibleCheckbox = accessibilityController.accessibleElementById("checkbox1"); 14 12 var notificationCount = 0; 15 13 16 14 function listener(notification) { 17 if (notification == "CheckedStateChanged")18 notificationCount++;15 if (notification == "CheckedStateChanged") 16 notificationCount++; 19 17 20 18 document.getElementById("console").innerText += "Got notification: " + notification + "\n"; -
trunk/LayoutTests/accessibility/notification-listeners.html
r132549 r132699 8 8 <p id="description"></p> 9 9 10 <select id="select" value="Select">< option>A<option>B</select>10 <select id="select" value="Select"></select> 11 11 12 12 <div id="slider" tabindex="0" role="slider" aria-valuenow="5">Slider</div> -
trunk/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-ax-value-changed-notification-expected.txt
r132549 r132699 8 8 FocusedUIElementChanged AXHelp: Year=AXValueDescription: 2012 9 9 ValueChanged AXHelp: Day=AXValueDescription: 04 10 ValueChanged AXHelp: Day=AXValueDescription: 04 11 ValueChanged AXHelp: Year=AXValueDescription: 2013 10 12 ValueChanged AXHelp: Year=AXValueDescription: 2013 11 13 -
trunk/LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-ax-value-changed-notification-expected.txt
r132549 r132699 8 8 ValueChanged AXHelp: Minutes=AXValueDescription: 05 9 9 ValueChanged AXHelp: Minutes=AXValueDescription: 05 10 ValueChanged AXHelp: Minutes=AXValueDescription: 05 11 ValueChanged AXHelp: Minutes=AXValueDescription: 05 10 12 11 13 PASS successfullyParsed is true -
trunk/LayoutTests/platform/chromium/accessibility/add-to-menu-list-crashes-expected.txt
r132549 r132699 1 1 This test makes sure that adding a selected option to a menu list via an unusual route (document.write from an external script) doesn't trigger a crash when didUpdateActiveOption is called before the children are updated. 2 2 3 PASS accessible Popup.childrenCount is 14 PASS accessible Popup.childrenCount is 25 PASS accessible Popup.childrenCount is 13 PASS accessibleMenulist.childAtIndex(0).childrenCount is 1 4 PASS accessibleMenulist.childAtIndex(0).childrenCount is 2 5 PASS accessibleMenulist.childAtIndex(0).childrenCount is 1 6 6 PASS successfullyParsed is true 7 7 -
trunk/LayoutTests/platform/chromium/accessibility/add-to-menu-list-crashes.html
r132549 r132699 20 20 if (window.testRunner && window.accessibilityController) { 21 21 window.accessibleMenulist = accessibilityController.focusedElement; 22 window.accessiblePopup = accessibleMenulist.childAtIndex(0); 23 shouldBe("accessiblePopup.childrenCount", "1"); 22 shouldBe("accessibleMenulist.childAtIndex(0).childrenCount", "1"); 24 23 } 25 24 </script> … … 27 26 <script> 28 27 if (window.testRunner && window.accessibilityController) 29 shouldBe("accessible Popup.childrenCount", "2");28 shouldBe("accessibleMenulist.childAtIndex(0).childrenCount", "2"); 30 29 </script> 31 30 <script> 32 31 menulist.removeChild(menulist.selectedOptions[0]); 33 32 if (window.testRunner && window.accessibilityController) 34 shouldBe("accessible Popup.childrenCount", "1");33 shouldBe("accessibleMenulist.childAtIndex(0).childrenCount", "1"); 35 34 </script> 36 35 </select> -
trunk/Source/WebCore/ChangeLog
r132698 r132699 1 2012-10-26 Dominic Mazzoni <dmazzoni@google.com> 2 3 AX: Notification should be sent when accessibilityIsIgnored changes 4 https://bugs.webkit.org/show_bug.cgi?id=99547 5 6 Reviewed by Chris Fleizach. 7 8 Adds a new flag in AccessibilityObject that keeps track of the most recent 9 value of accessibilityIsIgnored(). After certain events such as an ARIA 10 attribute change or content change, checks the new value of 11 accessibilityIsIgnored() and posts a "children changed" notification on the 12 parent node if it changed, making sure the parent recomputes its vector of 13 (unignored) children. 14 15 Also moves handling of attribute changes to AXObjectCache, and sends 16 notifications for some attribute changes that were previously silent. On 17 Chromium, all changes to an accessibility object's attributes should 18 result in some notification. 19 20 Some tests would have broken because an AccessibilityScrollView was created 21 and holding a reference to a ScrollView for an iframe after it was deleted, 22 so this change switches AccessibilityScrollView to hold a weak reference 23 to ScrollView instead. 24 25 Tests: platform/chromium/accessibility/is-ignored-change-sends-notification.html 26 platform/chromium/accessibility/other-aria-attribute-change-sends-notification.html 27 platform/chromium/accessibility/text-change-notification.html 28 29 * accessibility/AXObjectCache.cpp: 30 (WebCore::AXObjectCache::focusedUIElementForPage): 31 (WebCore::AXObjectCache::getOrCreate): 32 (WebCore::AXObjectCache::textChanged): 33 (WebCore): 34 (WebCore::AXObjectCache::childrenChanged): 35 (WebCore::AXObjectCache::handleAriaRoleChanged): 36 (WebCore::AXObjectCache::handleAttributeChanged): 37 (WebCore::AXObjectCache::labelChanged): 38 (WebCore::AXObjectCache::recomputeIsIgnored): 39 * accessibility/AXObjectCache.h: 40 (AXObjectCache): 41 (WebCore::AXObjectCache::childrenChanged): 42 (WebCore::AXObjectCache::textChanged): 43 (WebCore::AXObjectCache::handleAttributeChanged): 44 (WebCore::AXObjectCache::recomputeIsIgnored): 45 * accessibility/AccessibilityNodeObject.cpp: 46 (WebCore::AccessibilityNodeObject::insertChild): 47 * accessibility/AccessibilityObject.cpp: 48 (WebCore::AccessibilityObject::AccessibilityObject): 49 (WebCore::AccessibilityObject::cachedIsIgnoredValue): 50 (WebCore): 51 (WebCore::AccessibilityObject::setCachedIsIgnoredValue): 52 (WebCore::AccessibilityObject::notifyIfIgnoredValueChanged): 53 * accessibility/AccessibilityObject.h: 54 (WebCore::AccessibilityObject::textChanged): 55 (AccessibilityObject): 56 * accessibility/AccessibilityRenderObject.cpp: 57 (WebCore::AccessibilityRenderObject::accessibilityIsIgnored): 58 (WebCore::AccessibilityRenderObject::correspondingControlForLabelElement): 59 (WebCore::AccessibilityRenderObject::textChanged): 60 (WebCore::AccessibilityRenderObject::addHiddenChildren): 61 (WebCore::AccessibilityRenderObject::addChildren): 62 * accessibility/AccessibilityRenderObject.h: 63 (AccessibilityRenderObject): 64 * accessibility/AccessibilityScrollView.cpp: 65 (WebCore::AccessibilityScrollView::~AccessibilityScrollView): 66 (WebCore): 67 (WebCore::AccessibilityScrollView::detach): 68 (WebCore::AccessibilityScrollView::isAttachment): 69 (WebCore::AccessibilityScrollView::widgetForAttachmentView): 70 (WebCore::AccessibilityScrollView::updateScrollbars): 71 (WebCore::AccessibilityScrollView::webAreaObject): 72 (WebCore::AccessibilityScrollView::elementRect): 73 (WebCore::AccessibilityScrollView::documentFrameView): 74 (WebCore::AccessibilityScrollView::parentObject): 75 (WebCore::AccessibilityScrollView::parentObjectIfExists): 76 (WebCore::AccessibilityScrollView::getScrollableAreaIfScrollable): 77 (WebCore::AccessibilityScrollView::scrollTo): 78 * accessibility/AccessibilityScrollView.h: 79 (WebCore::AccessibilityScrollView::scrollView): 80 (AccessibilityScrollView): 81 * accessibility/AccessibilityTable.cpp: 82 (WebCore::AccessibilityTable::isDataTable): 83 * accessibility/chromium/AXObjectCacheChromium.cpp: 84 (WebCore::AXObjectCache::postPlatformNotification): 85 * dom/Element.cpp: 86 (WebCore::Element::attributeChanged): 87 * rendering/RenderBlock.cpp: 88 (WebCore::RenderBlock::deleteLineBoxTree): 89 (WebCore::RenderBlock::createAndAppendRootInlineBox): 90 * rendering/RenderObject.cpp: 91 (WebCore::RenderObject::styleWillChange): 92 * rendering/RenderText.cpp: 93 (WebCore::RenderText::setText): 94 1 95 2012-10-26 Joshua Bell <jsbell@chromium.org> 2 96 -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r132549 r132699 61 61 #include "HTMLImageElement.h" 62 62 #include "HTMLInputElement.h" 63 #include "HTMLLabelElement.h" 63 64 #include "HTMLNames.h" 64 65 #if ENABLE(VIDEO) … … 334 335 m_objects.set(newObj->axObjectID(), newObj); 335 336 attachWrapper(newObj.get()); 337 338 newObj->setCachedIsIgnoredValue(newObj->accessibilityIsIgnored()); 339 336 340 return newObj.get(); 337 341 } … … 352 356 m_objects.set(newObj->axObjectID(), newObj); 353 357 attachWrapper(newObj.get()); 358 359 newObj->setCachedIsIgnoredValue(newObj->accessibilityIsIgnored()); 360 354 361 return newObj.get(); 355 362 } … … 528 535 } 529 536 530 void AXObjectCache::contentChanged(Node* node) 531 { 532 if (AccessibilityObject* object = getOrCreate(node)) 533 object->contentChanged(); 534 } 535 536 void AXObjectCache::contentChanged(RenderObject* renderer) 537 { 538 if (AccessibilityObject* object = getOrCreate(renderer)) 539 object->contentChanged(); 537 void AXObjectCache::textChanged(Node* node) 538 { 539 textChanged(getOrCreate(node)); 540 } 541 542 void AXObjectCache::textChanged(RenderObject* renderer) 543 { 544 textChanged(getOrCreate(renderer)); 545 } 546 547 void AXObjectCache::textChanged(AccessibilityObject* obj) 548 { 549 if (!obj) 550 return; 551 552 bool parentAlreadyExists = obj->parentObjectIfExists(); 553 obj->textChanged(); 554 postNotification(obj, obj->document(), AXObjectCache::AXTextChanged, true); 555 if (parentAlreadyExists) 556 obj->notifyIfIgnoredValueChanged(); 540 557 } 541 558 … … 549 566 void AXObjectCache::childrenChanged(Node* node) 550 567 { 551 if (AccessibilityObject* obj = get(node)) 552 obj->childrenChanged(); 568 childrenChanged(get(node)); 553 569 } 554 570 555 571 void AXObjectCache::childrenChanged(RenderObject* renderer) 556 572 { 557 if (AccessibilityObject* obj = get(renderer)) 558 obj->childrenChanged(); 573 childrenChanged(get(renderer)); 574 } 575 576 void AXObjectCache::childrenChanged(AccessibilityObject* obj) 577 { 578 if (!obj) 579 return; 580 581 obj->childrenChanged(); 582 583 if (obj->parentObjectIfExists() && obj->cachedIsIgnoredValue() != obj->accessibilityIsIgnored()) 584 childrenChanged(obj->parentObject()); 559 585 } 560 586 … … 707 733 void AXObjectCache::handleAriaRoleChanged(Node* node) 708 734 { 709 if (AccessibilityObject* obj = getOrCreate(node)) 735 if (AccessibilityObject* obj = getOrCreate(node)) { 710 736 obj->updateAccessibilityRole(); 737 obj->notifyIfIgnoredValueChanged(); 738 } 739 } 740 741 void AXObjectCache::handleAttributeChanged(const QualifiedName& attrName, Element* element) 742 { 743 if (attrName == roleAttr) 744 handleAriaRoleChanged(element); 745 else if (attrName == altAttr || attrName == titleAttr) 746 textChanged(element); 747 else if (attrName == forAttr && element->hasTagName(labelTag)) 748 labelChanged(element); 749 750 if (!attrName.localName().string().startsWith("aria-")) 751 return; 752 753 if (attrName == aria_activedescendantAttr) 754 handleActiveDescendantChanged(element); 755 else if (attrName == aria_valuenowAttr || attrName == aria_valuetextAttr) 756 postNotification(element, AXObjectCache::AXValueChanged, true); 757 else if (attrName == aria_labelAttr || attrName == aria_labeledbyAttr || attrName == aria_labelledbyAttr) 758 textChanged(element); 759 else if (attrName == aria_checkedAttr) 760 checkedStateChanged(element); 761 else if (attrName == aria_selectedAttr) 762 selectedChildrenChanged(element); 763 else if (attrName == aria_expandedAttr) 764 handleAriaExpandedChange(element); 765 else if (attrName == aria_hiddenAttr) 766 childrenChanged(element->parentNode()); 767 else if (attrName == aria_invalidAttr) 768 postNotification(element, AXObjectCache::AXInvalidStatusChanged, true); 769 else 770 postNotification(element, AXObjectCache::AXAriaAttributeChanged, true); 771 } 772 773 void AXObjectCache::labelChanged(Element* element) 774 { 775 ASSERT(element->hasTagName(labelTag)); 776 HTMLElement* correspondingControl = static_cast<HTMLLabelElement*>(element)->control(); 777 textChanged(correspondingControl); 778 } 779 780 void AXObjectCache::recomputeIsIgnored(RenderObject* renderer) 781 { 782 if (AccessibilityObject* obj = get(renderer)) 783 obj->notifyIfIgnoredValueChanged(); 711 784 } 712 785 -
trunk/Source/WebCore/accessibility/AXObjectCache.h
r132549 r132699 90 90 void childrenChanged(Node*); 91 91 void childrenChanged(RenderObject*); 92 void childrenChanged(AccessibilityObject*); 92 93 void checkedStateChanged(Node*); 93 94 void selectedChildrenChanged(Node*); 94 95 void selectedChildrenChanged(RenderObject*); 95 96 // Called by a node when text or a text equivalent (e.g. alt) attribute is changed. 96 void contentChanged(Node*);97 void contentChanged(RenderObject*);97 void textChanged(Node*); 98 void textChanged(RenderObject*); 98 99 // Called when a node has just been attached, so we can make sure we have the right subclass of AccessibilityObject. 99 100 void updateCacheAfterNodeIsAttached(Node*); … … 105 106 void handleAriaExpandedChange(Node*); 106 107 void handleScrollbarUpdate(ScrollView*); 108 109 void handleAttributeChanged(const QualifiedName& attrName, Element*); 110 void recomputeIsIgnored(RenderObject* renderer); 107 111 108 112 #if HAVE(ACCESSIBILITY) … … 153 157 AXRowExpanded, 154 158 AXInvalidStatusChanged, 159 AXTextChanged, 160 AXAriaAttributeChanged 155 161 }; 156 162 … … 181 187 void nodeTextChangePlatformNotification(AccessibilityObject*, AXTextChange, unsigned offset, const String&); 182 188 void frameLoadingEventPlatformNotification(AccessibilityObject*, AXLoadingEvent); 189 void textChanged(AccessibilityObject*); 190 void labelChanged(Element*); 183 191 184 192 // This is a weak reference cache for knowing if Nodes used by TextMarkers are valid. … … 233 241 inline void AXObjectCache::childrenChanged(RenderObject*) { } 234 242 inline void AXObjectCache::childrenChanged(Node*) { } 235 inline void AXObjectCache::contentChanged(RenderObject*) { } 236 inline void AXObjectCache::contentChanged(Node*) { } 243 inline void AXObjectCache::childrenChanged(AccessibilityObject*) { } 244 inline void AXObjectCache::textChanged(RenderObject*) { } 245 inline void AXObjectCache::textChanged(Node*) { } 246 inline void AXObjectCache::textChanged(AccessibilityObject*) { } 237 247 inline void AXObjectCache::updateCacheAfterNodeIsAttached(Node*) { } 238 248 inline void AXObjectCache::detachWrapper(AccessibilityObject*) { } … … 244 254 inline void AXObjectCache::handleFocusedUIElementChanged(Node*, Node*) { } 245 255 inline void AXObjectCache::handleScrollbarUpdate(ScrollView*) { } 256 inline void AXObjectCache::handleAttributeChanged(const QualifiedName&, Element*) { } 257 inline void AXObjectCache::recomputeIsIgnored(RenderObject*) { } 246 258 inline void AXObjectCache::handleScrolledToAnchor(const Node*) { } 247 259 inline void AXObjectCache::nodeTextChangeNotification(Node*, AXTextChange, unsigned, const String&) { } -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r132549 r132699 73 73 , m_haveChildren(false) 74 74 , m_role(UnknownRole) 75 , m_cachedIsIgnoredValue(DefaultBehavior) 75 76 #if PLATFORM(GTK) 76 77 , m_wrapper(0) … … 1771 1772 } 1772 1773 1774 bool AccessibilityObject::cachedIsIgnoredValue() 1775 { 1776 if (m_cachedIsIgnoredValue == DefaultBehavior) 1777 m_cachedIsIgnoredValue = accessibilityIsIgnored() ? IgnoreObject : IncludeObject; 1778 1779 return m_cachedIsIgnoredValue == IgnoreObject; 1780 } 1781 1782 void AccessibilityObject::setCachedIsIgnoredValue(bool isIgnored) 1783 { 1784 m_cachedIsIgnoredValue = isIgnored ? IgnoreObject : IncludeObject; 1785 } 1786 1787 void AccessibilityObject::notifyIfIgnoredValueChanged() 1788 { 1789 bool isIgnored = accessibilityIsIgnored(); 1790 if (cachedIsIgnoredValue() != isIgnored) { 1791 axObjectCache()->childrenChanged(parentObject()); 1792 setCachedIsIgnoredValue(isIgnored); 1793 } 1794 } 1795 1773 1796 bool AccessibilityObject::ariaPressedIsPresent() const 1774 1797 { -
trunk/Source/WebCore/accessibility/AccessibilityObject.h
r132549 r132699 611 611 612 612 virtual void childrenChanged() { } 613 virtual void contentChanged() { }613 virtual void textChanged() { } 614 614 virtual void updateAccessibilityRole() { } 615 615 const AccessibilityChildrenVector& children(); … … 730 730 virtual void scrollToGlobalPoint(const IntPoint&) const; 731 731 732 bool cachedIsIgnoredValue(); 733 void setCachedIsIgnoredValue(bool); 734 735 // Fires a children changed notification on the parent if the isIgnored value changed. 736 void notifyIfIgnoredValueChanged(); 737 732 738 #if HAVE(ACCESSIBILITY) 733 739 #if PLATFORM(GTK) … … 768 774 mutable bool m_haveChildren; 769 775 AccessibilityRole m_role; 776 AccessibilityObjectInclusion m_cachedIsIgnoredValue; 770 777 771 778 // If this object itself scrolls, return its ScrollableArea. -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r132549 r132699 1095 1095 if (m_renderer->isText()) { 1096 1096 // static text beneath MenuItems and MenuButtons are just reported along with the menu item, so it's ignored on an individual level 1097 if (parentObjectUnignored()->ariaRoleAttribute() == MenuItemRole1098 || parentObjectUnignored()->ariaRoleAttribute() == MenuButtonRole)1097 AccessibilityObject* parent = parentObjectUnignored(); 1098 if (parent && (parent->ariaRoleAttribute() == MenuItemRole || parent->ariaRoleAttribute() == MenuButtonRole)) 1099 1099 return true; 1100 1100 RenderText* renderText = toRenderText(m_renderer); … … 2213 2213 if (!correspondingControl) 2214 2214 return 0; 2215 2216 // Make sure the corresponding control isn't a descendant of this label that's in the middle of being destroyed. 2217 if (correspondingControl->renderer() && !correspondingControl->renderer()->parent()) 2218 return 0; 2215 2219 2216 2220 return axObjectCache()->getOrCreate(correspondingControl); … … 2529 2533 } 2530 2534 2531 void AccessibilityRenderObject:: contentChanged()2535 void AccessibilityRenderObject::textChanged() 2532 2536 { 2533 2537 // If this element supports ARIA live regions, or is part of a region with an ARIA editable role, -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.h
r132549 r132699 166 166 167 167 virtual void detach(); 168 virtual void contentChanged();168 virtual void textChanged(); 169 169 virtual void addChildren(); 170 170 virtual bool canHaveChildren() const; -
trunk/Source/WebCore/accessibility/AccessibilityScrollView.cpp
r132549 r132699 44 44 } 45 45 46 AccessibilityScrollView::~AccessibilityScrollView() 47 { 48 ASSERT(isDetached()); 49 } 50 51 void AccessibilityScrollView::detach() 52 { 53 AccessibilityObject::detach(); 54 m_scrollView = 0; 55 } 56 46 57 PassRefPtr<AccessibilityScrollView> AccessibilityScrollView::create(ScrollView* view) 47 58 { … … 68 79 bool AccessibilityScrollView::isAttachment() const 69 80 { 70 return m_scrollView ->platformWidget();81 return m_scrollView && m_scrollView->platformWidget(); 71 82 } 72 83 73 84 Widget* AccessibilityScrollView::widgetForAttachmentView() const 74 85 { 75 return m_scrollView .get();86 return m_scrollView; 76 87 } 77 88 … … 89 100 void AccessibilityScrollView::updateScrollbars() 90 101 { 102 if (!m_scrollView) 103 return; 104 91 105 if (m_scrollView->horizontalScrollbar() && !m_horizontalScrollbar) 92 106 m_horizontalScrollbar = addChildScrollbar(m_scrollView->horizontalScrollbar()); … … 154 168 AccessibilityObject* AccessibilityScrollView::webAreaObject() const 155 169 { 156 if (!m_scrollView ->isFrameView())157 return 0; 158 159 Document* doc = static_cast<FrameView*>(m_scrollView .get())->frame()->document();170 if (!m_scrollView || !m_scrollView->isFrameView()) 171 return 0; 172 173 Document* doc = static_cast<FrameView*>(m_scrollView)->frame()->document(); 160 174 if (!doc || !doc->renderer()) 161 175 return 0; … … 180 194 LayoutRect AccessibilityScrollView::elementRect() const 181 195 { 196 if (!m_scrollView) 197 return LayoutRect(); 198 182 199 return m_scrollView->frameRect(); 183 200 } … … 185 202 FrameView* AccessibilityScrollView::documentFrameView() const 186 203 { 187 if (!m_scrollView ->isFrameView())188 return 0; 189 190 return static_cast<FrameView*>(m_scrollView .get());204 if (!m_scrollView || !m_scrollView->isFrameView()) 205 return 0; 206 207 return static_cast<FrameView*>(m_scrollView); 191 208 } 192 209 193 210 AccessibilityObject* AccessibilityScrollView::parentObject() const 194 211 { 195 if (!m_scrollView ->isFrameView())196 return 0; 197 198 HTMLFrameOwnerElement* owner = static_cast<FrameView*>(m_scrollView .get())->frame()->ownerElement();212 if (!m_scrollView || !m_scrollView->isFrameView()) 213 return 0; 214 215 HTMLFrameOwnerElement* owner = static_cast<FrameView*>(m_scrollView)->frame()->ownerElement(); 199 216 if (owner && owner->renderer()) 200 217 return axObjectCache()->getOrCreate(owner); … … 205 222 AccessibilityObject* AccessibilityScrollView::parentObjectIfExists() const 206 223 { 207 if (!m_scrollView ->isFrameView())208 return 0; 209 210 HTMLFrameOwnerElement* owner = static_cast<FrameView*>(m_scrollView .get())->frame()->ownerElement();224 if (!m_scrollView || !m_scrollView->isFrameView()) 225 return 0; 226 227 HTMLFrameOwnerElement* owner = static_cast<FrameView*>(m_scrollView)->frame()->ownerElement(); 211 228 if (owner && owner->renderer()) 212 229 return axObjectCache()->get(owner); … … 217 234 ScrollableArea* AccessibilityScrollView::getScrollableAreaIfScrollable() const 218 235 { 219 return m_scrollView .get();236 return m_scrollView; 220 237 } 221 238 222 239 void AccessibilityScrollView::scrollTo(const IntPoint& point) const 223 240 { 224 m_scrollView->setScrollPosition(point); 241 if (m_scrollView) 242 m_scrollView->setScrollPosition(point); 225 243 } 226 244 -
trunk/Source/WebCore/accessibility/AccessibilityScrollView.h
r132549 r132699 39 39 static PassRefPtr<AccessibilityScrollView> create(ScrollView*); 40 40 virtual AccessibilityRole roleValue() const { return ScrollAreaRole; } 41 ScrollView* scrollView() const { return m_scrollView.get(); } 41 ScrollView* scrollView() const { return m_scrollView; } 42 43 virtual ~AccessibilityScrollView(); 44 virtual void detach(); 42 45 43 46 protected: … … 73 76 void removeChildScrollbar(AccessibilityObject*); 74 77 75 RefPtr<ScrollView>m_scrollView;78 ScrollView* m_scrollView; 76 79 RefPtr<AccessibilityObject> m_horizontalScrollbar; 77 80 RefPtr<AccessibilityObject> m_verticalScrollbar; -
trunk/Source/WebCore/accessibility/AccessibilityTable.cpp
r132549 r132699 131 131 // go through the cell's and check for tell-tale signs of "data" table status 132 132 // cells have borders, or use attributes like headers, abbr, scope or axis 133 table->recalcSectionsIfNeeded(); 133 134 RenderTableSection* firstBody = table->firstBody(); 134 135 if (!firstBody) -
trunk/Source/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
r132549 r132699 83 83 handleFocusedUIElementChanged(0, obj->document()->focusedNode()); 84 84 break; 85 case AXAriaAttributeChanged: 85 86 case AXAutocorrectionOccured: 86 87 case AXCheckedStateChanged: 87 88 case AXChildrenChanged: 88 89 case AXFocusedUIElementChanged: 90 case AXInvalidStatusChanged: 89 91 case AXLayoutComplete: 90 92 case AXLiveRegionChanged: … … 98 100 case AXSelectedChildrenChanged: 99 101 case AXSelectedTextChanged: 102 case AXTextChanged: 100 103 case AXValueChanged: 101 case AXInvalidStatusChanged:102 104 break; 103 105 } -
trunk/Source/WebCore/dom/Element.cpp
r132684 r132699 729 729 invalidateNodeListCachesInAncestors(&name, this); 730 730 731 if (!AXObjectCache::accessibilityEnabled()) 732 return; 733 734 if (name == aria_activedescendantAttr) { 735 // any change to aria-activedescendant attribute triggers accessibility focus change, but document focus remains intact 736 document()->axObjectCache()->handleActiveDescendantChanged(this); 737 } else if (name == roleAttr) { 738 // the role attribute can change at any time, and the AccessibilityObject must pick up these changes 739 document()->axObjectCache()->handleAriaRoleChanged(this); 740 } else if (name == aria_valuenowAttr) { 741 // If the valuenow attribute changes, AX clients need to be notified. 742 document()->axObjectCache()->postNotification(this, AXObjectCache::AXValueChanged, true); 743 } else if (name == aria_labelAttr || name == aria_labeledbyAttr || name == altAttr || name == titleAttr) { 744 // If the content of an element changes due to an attribute change, notify accessibility. 745 document()->axObjectCache()->contentChanged(this); 746 } else if (name == aria_checkedAttr) 747 document()->axObjectCache()->checkedStateChanged(this); 748 else if (name == aria_selectedAttr) 749 document()->axObjectCache()->selectedChildrenChanged(this); 750 else if (name == aria_expandedAttr) 751 document()->axObjectCache()->handleAriaExpandedChange(this); 752 else if (name == aria_hiddenAttr) 753 document()->axObjectCache()->childrenChanged(this); 754 else if (name == aria_invalidAttr) 755 document()->axObjectCache()->postNotification(this, AXObjectCache::AXInvalidStatusChanged, true); 731 if (AXObjectCache::accessibilityEnabled()) 732 document()->axObjectCache()->handleAttributeChanged(name, this); 756 733 } 757 734 -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r132696 r132699 25 25 #include "RenderBlock.h" 26 26 27 #include "AXObjectCache.h" 27 28 #include "ColumnInfo.h" 28 29 #include "Document.h" … … 1012 1013 } 1013 1014 m_lineBoxes.deleteLineBoxTree(renderArena()); 1015 if (UNLIKELY(AXObjectCache::accessibilityEnabled())) 1016 document()->axObjectCache()->recomputeIsIgnored(this); 1014 1017 } 1015 1018 … … 1023 1026 RootInlineBox* rootBox = createRootInlineBox(); 1024 1027 m_lineBoxes.appendLineBox(rootBox); 1028 1029 if (UNLIKELY(AXObjectCache::accessibilityEnabled()) && m_lineBoxes.firstLineBox() == rootBox) 1030 document()->axObjectCache()->recomputeIsIgnored(this); 1031 1025 1032 return rootBox; 1026 1033 } -
trunk/Source/WebCore/rendering/RenderObject.cpp
r132591 r132699 1830 1830 #endif 1831 1831 if (visibilityChanged && AXObjectCache::accessibilityEnabled()) 1832 document()->axObjectCache()->childrenChanged( this);1832 document()->axObjectCache()->childrenChanged(parent()); 1833 1833 1834 1834 // Keep layer hierarchy visibility bits up to date if visibility changes. -
trunk/Source/WebCore/rendering/RenderText.cpp
r132549 r132699 1467 1467 AXObjectCache* axObjectCache = document()->axObjectCache(); 1468 1468 if (axObjectCache->accessibilityEnabled()) 1469 axObjectCache-> contentChanged(this);1469 axObjectCache->textChanged(this); 1470 1470 } 1471 1471 -
trunk/Source/WebKit/chromium/ChangeLog
r132600 r132699 1 2012-10-26 Dominic Mazzoni <dmazzoni@google.com> 2 3 AX: Notification should be sent when accessibilityIsIgnored changes 4 https://bugs.webkit.org/show_bug.cgi?id=99547 5 6 Reviewed by Chris Fleizach. 7 8 Adds new accessibility notifications. 9 10 * public/WebAccessibilityNotification.h: 11 * src/AssertMatchingEnums.cpp: 12 1 13 2012-10-26 Thiago Marcos P. Santos <thiago.santos@intel.com> 2 14 -
trunk/Source/WebKit/chromium/public/WebAccessibilityNotification.h
r132549 r132699 55 55 WebAccessibilityNotificationRowExpanded, 56 56 WebAccessibilityNotificationInvalidStatusChanged, 57 58 // FIXME: now that we're using AssertMatchingEnums, we don't need a 59 // catch-all "invalid" notification enum. Remove this once it's been 60 // removed from Chromium. 61 WebAccessibilityNotificationInvalid, 57 WebAccessibilityNotificationTextChanged, 58 WebAccessibilityNotificationAriaAttributeChanged 62 59 }; 63 60 -
trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp
r132549 r132699 154 154 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityNotificationRowExpanded, AXObjectCache::AXRowExpanded); 155 155 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityNotificationInvalidStatusChanged, AXObjectCache::AXInvalidStatusChanged); 156 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityNotificationTextChanged, AXObjectCache::AXTextChanged); 157 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityNotificationAriaAttributeChanged, AXObjectCache::AXAriaAttributeChanged); 156 158 157 159 COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleUnknown, UnknownRole); -
trunk/Tools/ChangeLog
r132690 r132699 1 2012-10-26 Dominic Mazzoni <dmazzoni@google.com> 2 3 AX: Notification should be sent when accessibilityIsIgnored changes 4 https://bugs.webkit.org/show_bug.cgi?id=99547 5 6 Reviewed by Chris Fleizach. 7 8 Add additional accessibility notifications. 9 10 * DumpRenderTree/chromium/WebViewHost.cpp: 11 (WebViewHost::postAccessibilityNotification): 12 1 13 2012-10-25 Roger Fong <roger_fong@apple.com> 2 14 -
trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp
r132597 r132699 697 697 notificationName = "InvalidStatusChanged"; 698 698 break; 699 case WebAccessibilityNotificationTextChanged: 700 notificationName = "TextChanged"; 701 break; 702 case WebAccessibilityNotificationAriaAttributeChanged: 703 notificationName = "AriaAttributeChanged"; 704 break; 699 705 default: 700 706 notificationName = "UnknownNotification";
Note: See TracChangeset
for help on using the changeset viewer.