Regression: AX: Don't expose role or notifications for invalid menus
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Mar 2014 21:26:25 +0000 (21:26 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Mar 2014 21:26:25 +0000 (21:26 +0000)
commit44d44b424b9ab44202fd47c9a46576b7630ba70b
tree0b352a9d6bf52c284580865ececfe006b615f819
parent4ef7d69ab6c733b05cbbbdcceed2f559e4d98157
Regression: AX: Don't expose role or notifications for invalid menus
https://bugs.webkit.org/show_bug.cgi?id=129814

Reviewed by Mario Sanchez Prada.

Source/WebCore:

If a role=menu has no menuitem children, it should not be a menu.
This was a bit tricky to implement since we need to update the role after the children are created,
but it means we have to be a bit more aggressive about when to updateChildren, so that the role
is known to be valid.

Test: platform/mac/accessibility/invalid-menu-role-does-not-send-notification.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::notificationPostTimerFired):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
(WebCore::AccessibilityRenderObject::addChildren):
* accessibility/AccessibilityRenderObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):

LayoutTests:

* accessibility/table-with-aria-role.html:
     Modify test so that tests only what we want (that the role is correct).
     No longer use role=menu on the table, since the table won't have menuitems and won't be a valid menu.
* platform/mac/accessibility/invalid-menu-role-does-not-send-notification-expected.txt: Added.
* platform/mac/accessibility/invalid-menu-role-does-not-send-notification.html: Added.
* platform/mac/accessibility/table-with-aria-role-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166194 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/accessibility/table-with-aria-role-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/table-with-aria-role.html
LayoutTests/platform/mac/accessibility/invalid-menu-role-does-not-send-notification-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/invalid-menu-role-does-not-send-notification.html [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/table-with-aria-role-expected.txt [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.h