AX: [ATK] Attempting to clear selection on ARIA listboxes results in crash
authorjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Nov 2016 16:48:12 +0000 (16:48 +0000)
committerjdiggs@igalia.com <jdiggs@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Nov 2016 16:48:12 +0000 (16:48 +0000)
commit223709ddd0f96706e1d7cd74c44fdeab7b547b7a
treec43f2a25403af51aadc2cb7c46e064c8b26651a5
parent5f16b7708702d65e32c2a365b04cf9539ac8f452
AX: [ATK] Attempting to clear selection on ARIA listboxes results in crash
https://bugs.webkit.org/show_bug.cgi?id=164331

Reviewed by Chris Fleizach.

Source/WebCore:

The ATK code is using is<AccessibilityListBox>() to identify native listboxes.
But is<AccessibilityListBox>() returns the value of isListBox() which returns
true both for AccessibilityListBox instances as well as for AccessibilityObject
instances which have an AccessibilityRole value of ListBoxRole. Because only
native listboxes should be AccessibilityListBoxes, add isNativeListBox() so
that we can distinguish native and ARIA listboxes.

Tests: accessibility/aria-listbox-clear-selection-crash.html
       accessibility/listbox-clear-selection.html

* accessibility/AccessibilityListBox.h:
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isNativeListBox):
(WebCore::AccessibilityObject::isListBox):

Tools:

Add AccessibilityUIElement::clearSelectedChildren() to DRT and WKTR.
Implement it for ATK.

* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::clearSelectedChildren):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::clearSelectedChildren):
* DumpRenderTree/win/AccessibilityUIElementWin.cpp:
(AccessibilityUIElement::clearSelectedChildren):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::clearSelectedChildren):
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::clearSelectedChildren):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::clearSelectedChildren):

LayoutTests:

Add tests to verify clearing selection works for native listboxes, and does not
crash for ARIA listboxes. These tests are being skipped for the Mac and Win ports
which do not yet implement AccessibilityUIElement::clearSelectedChildren().

* accessibility/aria-listbox-clear-selection-crash-expected.txt: Added.
* accessibility/aria-listbox-clear-selection-crash.html: Added.
* accessibility/listbox-clear-selection-expected.txt: Added.
* accessibility/listbox-clear-selection.html: Added.
* platform/mac/TestExpectations:
* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/aria-listbox-clear-selection-crash-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/aria-listbox-clear-selection-crash.html [new file with mode: 0644]
LayoutTests/accessibility/listbox-clear-selection-expected.txt [new file with mode: 0644]
LayoutTests/accessibility/listbox-clear-selection.html [new file with mode: 0644]
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityListBox.h
Source/WebCore/accessibility/AccessibilityObject.h
Tools/ChangeLog
Tools/DumpRenderTree/AccessibilityUIElement.h
Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm
Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm