AX: Notification should be sent when accessibilityIsIgnored changes
authordmazzoni@google.com <dmazzoni@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2012 19:31:25 +0000 (19:31 +0000)
committerdmazzoni@google.com <dmazzoni@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2012 19:31:25 +0000 (19:31 +0000)
commit6f67ad5f93b60b0e789b5781bb86dedf4a12236c
tree8e746ffd50e56426b2620032944c7747698e5392
parent38c26fa1956aa3fce6508bb8f0c99c63b45e97d9
AX: Notification should be sent when accessibilityIsIgnored changes
https://bugs.webkit.org/show_bug.cgi?id=99547

Reviewed by Chris Fleizach.

Source/WebCore:

Adds a new flag in AccessibilityObject that keeps track of the most recent
value of accessibilityIsIgnored(). After certain events such as an ARIA
attribute change or content change, checks the new value of
accessibilityIsIgnored() and posts a "children changed" notification on the
parent node if it changed, making sure the parent recomputes its vector of
(unignored) children.

Also moves handling of attribute changes to AXObjectCache, and sends
notifications for some attribute changes that were previously silent. On
Chromium, all changes to an accessibility object's attributes should
result in some notification.

Some tests would have broken because an AccessibilityScrollView was created
and holding a reference to a ScrollView for an iframe after it was deleted,
so this change switches AccessibilityScrollView to hold a weak reference
to ScrollView instead.

Tests: platform/chromium/accessibility/is-ignored-change-sends-notification.html
       platform/chromium/accessibility/other-aria-attribute-change-sends-notification.html
       platform/chromium/accessibility/text-change-notification.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::focusedUIElementForPage):
(WebCore::AXObjectCache::getOrCreate):
(WebCore::AXObjectCache::textChanged):
(WebCore):
(WebCore::AXObjectCache::childrenChanged):
(WebCore::AXObjectCache::handleAriaRoleChanged):
(WebCore::AXObjectCache::handleAttributeChanged):
(WebCore::AXObjectCache::labelChanged):
(WebCore::AXObjectCache::recomputeIsIgnored):
* accessibility/AXObjectCache.h:
(AXObjectCache):
(WebCore::AXObjectCache::childrenChanged):
(WebCore::AXObjectCache::textChanged):
(WebCore::AXObjectCache::handleAttributeChanged):
(WebCore::AXObjectCache::recomputeIsIgnored):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::insertChild):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::AccessibilityObject):
(WebCore::AccessibilityObject::cachedIsIgnoredValue):
(WebCore):
(WebCore::AccessibilityObject::setCachedIsIgnoredValue):
(WebCore::AccessibilityObject::notifyIfIgnoredValueChanged):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::textChanged):
(AccessibilityObject):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
(WebCore::AccessibilityRenderObject::correspondingControlForLabelElement):
(WebCore::AccessibilityRenderObject::textChanged):
(WebCore::AccessibilityRenderObject::addHiddenChildren):
(WebCore::AccessibilityRenderObject::addChildren):
* accessibility/AccessibilityRenderObject.h:
(AccessibilityRenderObject):
* accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::~AccessibilityScrollView):
(WebCore):
(WebCore::AccessibilityScrollView::detach):
(WebCore::AccessibilityScrollView::isAttachment):
(WebCore::AccessibilityScrollView::widgetForAttachmentView):
(WebCore::AccessibilityScrollView::updateScrollbars):
(WebCore::AccessibilityScrollView::webAreaObject):
(WebCore::AccessibilityScrollView::elementRect):
(WebCore::AccessibilityScrollView::documentFrameView):
(WebCore::AccessibilityScrollView::parentObject):
(WebCore::AccessibilityScrollView::parentObjectIfExists):
(WebCore::AccessibilityScrollView::getScrollableAreaIfScrollable):
(WebCore::AccessibilityScrollView::scrollTo):
* accessibility/AccessibilityScrollView.h:
(WebCore::AccessibilityScrollView::scrollView):
(AccessibilityScrollView):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::isDataTable):
* accessibility/chromium/AXObjectCacheChromium.cpp:
(WebCore::AXObjectCache::postPlatformNotification):
* dom/Element.cpp:
(WebCore::Element::attributeChanged):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::deleteLineBoxTree):
(WebCore::RenderBlock::createAndAppendRootInlineBox):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::styleWillChange):
* rendering/RenderText.cpp:
(WebCore::RenderText::setText):

Source/WebKit/chromium:

Adds new accessibility notifications.

* public/WebAccessibilityNotification.h:
* src/AssertMatchingEnums.cpp:

Tools:

Add additional accessibility notifications.

* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::postAccessibilityNotification):

LayoutTests:

Adds 3 new test to ensure:
1. A "children changed" notification is fired on the parent object when an
   object that was previously ignored becomes unignored.
2. A notification is sent when an element's text (incl. title or label) changes.
3. A notification is sent when another ARIA attribute changes.

Modifies add-to-menu-list-crashes because it was too brittle; it was
    referencing a stale object rather than retrieving its latest handle.
Modifies aria-checkbox-sends-notification to listen on the correct
    object on all platforms.
Simplifies notification-listeners so it doesn't generate additional
    notifications that are inconsistent between platforms now.

* accessibility/aria-checkbox-sends-notification.html:
* accessibility/notification-listeners.html:
* platform/chromium/accessibility/add-to-menu-list-crashes-expected.txt:
* platform/chromium/accessibility/add-to-menu-list-crashes.html:
* platform/chromium/accessibility/is-ignored-change-sends-notification-expected.txt: Added.
* platform/chromium/accessibility/is-ignored-change-sends-notification.html: Added.
* platform/chromium/accessibility/other-aria-attribute-change-sends-notification-expected.txt: Added.
* platform/chromium/accessibility/other-aria-attribute-change-sends-notification.html: Added.
* platform/chromium/accessibility/text-change-notification-expected.txt: Added.
* platform/chromium/accessibility/text-change-notification.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
33 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/aria-checkbox-sends-notification.html
LayoutTests/accessibility/notification-listeners.html
LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-ax-value-changed-notification-expected.txt
LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-ax-value-changed-notification-expected.txt
LayoutTests/platform/chromium/accessibility/add-to-menu-list-crashes-expected.txt
LayoutTests/platform/chromium/accessibility/add-to-menu-list-crashes.html
LayoutTests/platform/chromium/accessibility/is-ignored-change-sends-notification-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/accessibility/is-ignored-change-sends-notification.html [new file with mode: 0644]
LayoutTests/platform/chromium/accessibility/other-aria-attribute-change-sends-notification-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/accessibility/other-aria-attribute-change-sends-notification.html [new file with mode: 0644]
LayoutTests/platform/chromium/accessibility/text-change-notification-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/accessibility/text-change-notification.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AXObjectCache.h
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.h
Source/WebCore/accessibility/AccessibilityScrollView.cpp
Source/WebCore/accessibility/AccessibilityScrollView.h
Source/WebCore/accessibility/AccessibilityTable.cpp
Source/WebCore/accessibility/chromium/AXObjectCacheChromium.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderText.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebAccessibilityNotification.h
Source/WebKit/chromium/src/AssertMatchingEnums.cpp
Tools/ChangeLog
Tools/DumpRenderTree/chromium/WebViewHost.cpp