haikuwebkit/LayoutTests/accessibility/form-control-value-settable...

74 lines
2.8 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE HTML>
<html>
<body>
[GTK] accessibility/aria-readonly.html is failing https://bugs.webkit.org/show_bug.cgi?id=98357 Reviewed by Chris Fleizach. Source/WebCore: Add support for ATK_STATE_READ_ONLY and expose the value of aria-readonly as an AtkObject attribute. In order to eliminate duplicate checks, remove isReadOnly() and just use canSetAttributeValue(), moving all the logic into AccessibilityNodeObject. Add AccessibilityObject::supportsARIAReadOnly() so that we can explicitly expose the implicit value for aria-readonly on roles which support this property. Also add support for ATK_STATE_CHECKABLE, both because this state was missing and because it serves a similar function to ATK_STATE_EDITABLE for the purpose of verifying exposure of toggle-able elements that are not read-only. Test: accessibility/form-control-value-settable.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::canSetValueAttribute): (WebCore::AccessibilityNodeObject::isRequired): Deleted. (WebCore::AccessibilityNodeObject::supportsRequiredAttribute): Deleted. * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::supportsARIAReadOnly): (WebCore::AccessibilityObject::ariaReadOnlyValue): * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::isUnvisited): Deleted. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::clickPoint): (WebCore::AccessibilityRenderObject::isOffScreen): Deleted. (WebCore::AccessibilityRenderObject::anchorElement): Deleted. (WebCore::AccessibilityRenderObject::internalLinkElement): Deleted. (WebCore::AccessibilityRenderObject::textChanged): Deleted. (WebCore::AccessibilityRenderObject::clearChildren): Deleted. (WebCore::AccessibilityRenderObject::addImageMapChildren): Deleted. * accessibility/AccessibilityRenderObject.h: * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (getAttributeSetForAccessibilityObject): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): (setAtkStateSetFromCoreObject): (getInterfaceMaskFromObject): * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties): Source/WebKit/win: Call AccessibilityNode::canSetValueAttribute() to determine if STATE_SYSTEM_READONLY should be added and if editable text should be supported. * AccessibleBase.cpp: (AccessibleBase::state): * AccessibleTextImpl.cpp: (AccessibleText::deleteText): (AccessibleText::insertText): (AccessibleText::cutText): (AccessibleText::pasteText): (AccessibleText::replaceText): Tools: Add checks to isAttributeSettable() for ATK_STATE_READ_ONLY and the 'readonly' AtkObject attribute along with ATK_STATE_CHECKABLE for toggle-able elements, ATK_STATE_SELECTABLE for select elements, and ATK_STATE_FOCUSABLE combined with range verification for inputs which implement AtkValue. The latter two additions are admittedly a heuristic workaround for platform accessibility API differences. But they should be sufficient to facilitate cross-platform testing of isAttributeSettable() for form elements which lack ARIA attributes. Bump the minimum version of at-spi2-core and at-spi2-atk to 2.15.4 (earliest version that supports STATE_READ_ONLY). * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::AccessibilityUIElement::isAttributeSettable): * gtk/jhbuild.modules: LayoutTests: As part of this change, a new AtkObject attribute and state are being exposed. Update two tests accordingly. Also unskip the previously-failing test. Lastly, move the Mac form-control-value-settable.html test to the shared test set, with a minor tweak to check the platform for several elements' expectations. * accessibility/form-control-value-settable.html: Moved to shared tests. * accessibility/gtk/xml-roles-exposed-expected.txt: Updated. * platform/gtk/TestExpectations: Unskipped previously-failing test. * platform/gtk/accessibility/form-control-value-settable-expected.txt: Added. * platform/gtk/accessibility/table-detection-expected.txt: Updated. * platform/mac/accessibility/form-control-value-settable-expected.txt: Moved. Canonical link: https://commits.webkit.org/175702@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-11 07:14:31 +00:00
<script src="../resources/js-test-pre.js"></script>
<div>
<input id="text1" type="text" value="Value">
<input id="checkbox1" type="checkbox" checked>
<input id="number1" type="number" value="123">
<input id="radio1" type="radio" checked>
<input id="slider1" type="range" min="1" max="10" value="5">
<input id="submit1" type="submit">
<select id="combobox1"><option>1<option selected>2</select>
<select multiple id="listbox1"><option>1<option selected>2</select>
<textarea id="textarea1">Textarea</textarea>
</div>
<div contentEditable>
<input id="text2" type="text" value="Value">
<input id="checkbox2" type="checkbox" checked>
<input id="number2" type="number" value="123">
<input id="radio2" type="radio" checked>
<input id="slider2" type="range" min="1" max="10" value="5">
<input id="submit2" type="submit">
<select id="combobox2"><option>1<option selected>2</select>
<select multiple id="listbox2"><option>1<option selected>2</select>
<textarea id="textarea2">Textarea</textarea>
</div>
<div id="console"></div>
<script>
description("This tests whether AXValue is writable for various form controls.");
if (window.testRunner && window.accessibilityController) {
jsTestIsAsync = true;
window.testRunner.dumpAsText();
function check(ids, expect, index) {
if (index >= ids.length)
finishJSTest();
id = ids[index];
window.element = document.getElementById(id);
element.focus();
setTimeout(function() {
debug(id);
shouldBe("document.activeElement == element", "true");
window.axElement = accessibilityController.focusedElement;
shouldBe("axElement.isAttributeSettable('AXValue')", String(expect[index]));
check(ids, expect, ++index);
}, 0);
}
var ids = ["text1", "text2", "number1", "number2", "textarea1", "textarea2", "slider1", "slider2", "checkbox1", "checkbox2", "radio1", "radio2", "submit1", "submit2", "combobox1", "combobox2", "listbox1", "listbox2"];
// All text-like form controls and slider should have a writable AXValue.
[GTK] accessibility/aria-readonly.html is failing https://bugs.webkit.org/show_bug.cgi?id=98357 Reviewed by Chris Fleizach. Source/WebCore: Add support for ATK_STATE_READ_ONLY and expose the value of aria-readonly as an AtkObject attribute. In order to eliminate duplicate checks, remove isReadOnly() and just use canSetAttributeValue(), moving all the logic into AccessibilityNodeObject. Add AccessibilityObject::supportsARIAReadOnly() so that we can explicitly expose the implicit value for aria-readonly on roles which support this property. Also add support for ATK_STATE_CHECKABLE, both because this state was missing and because it serves a similar function to ATK_STATE_EDITABLE for the purpose of verifying exposure of toggle-able elements that are not read-only. Test: accessibility/form-control-value-settable.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::canSetValueAttribute): (WebCore::AccessibilityNodeObject::isRequired): Deleted. (WebCore::AccessibilityNodeObject::supportsRequiredAttribute): Deleted. * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::supportsARIAReadOnly): (WebCore::AccessibilityObject::ariaReadOnlyValue): * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::isUnvisited): Deleted. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::clickPoint): (WebCore::AccessibilityRenderObject::isOffScreen): Deleted. (WebCore::AccessibilityRenderObject::anchorElement): Deleted. (WebCore::AccessibilityRenderObject::internalLinkElement): Deleted. (WebCore::AccessibilityRenderObject::textChanged): Deleted. (WebCore::AccessibilityRenderObject::clearChildren): Deleted. (WebCore::AccessibilityRenderObject::addImageMapChildren): Deleted. * accessibility/AccessibilityRenderObject.h: * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (getAttributeSetForAccessibilityObject): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): (setAtkStateSetFromCoreObject): (getInterfaceMaskFromObject): * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties): Source/WebKit/win: Call AccessibilityNode::canSetValueAttribute() to determine if STATE_SYSTEM_READONLY should be added and if editable text should be supported. * AccessibleBase.cpp: (AccessibleBase::state): * AccessibleTextImpl.cpp: (AccessibleText::deleteText): (AccessibleText::insertText): (AccessibleText::cutText): (AccessibleText::pasteText): (AccessibleText::replaceText): Tools: Add checks to isAttributeSettable() for ATK_STATE_READ_ONLY and the 'readonly' AtkObject attribute along with ATK_STATE_CHECKABLE for toggle-able elements, ATK_STATE_SELECTABLE for select elements, and ATK_STATE_FOCUSABLE combined with range verification for inputs which implement AtkValue. The latter two additions are admittedly a heuristic workaround for platform accessibility API differences. But they should be sufficient to facilitate cross-platform testing of isAttributeSettable() for form elements which lack ARIA attributes. Bump the minimum version of at-spi2-core and at-spi2-atk to 2.15.4 (earliest version that supports STATE_READ_ONLY). * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::AccessibilityUIElement::isAttributeSettable): * gtk/jhbuild.modules: LayoutTests: As part of this change, a new AtkObject attribute and state are being exposed. Update two tests accordingly. Also unskip the previously-failing test. Lastly, move the Mac form-control-value-settable.html test to the shared test set, with a minor tweak to check the platform for several elements' expectations. * accessibility/form-control-value-settable.html: Moved to shared tests. * accessibility/gtk/xml-roles-exposed-expected.txt: Updated. * platform/gtk/TestExpectations: Unskipped previously-failing test. * platform/gtk/accessibility/form-control-value-settable-expected.txt: Added. * platform/gtk/accessibility/table-detection-expected.txt: Updated. * platform/mac/accessibility/form-control-value-settable-expected.txt: Moved. Canonical link: https://commits.webkit.org/175702@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-11 07:14:31 +00:00
// Other controls whose contents or state can be user modified should have a read-only
// AXValue for non-ATK-based platforms, unless those controls are inside contentEditable,
// then everything should have a writable AXValue.
var expect;
if (accessibilityController.platformName != "atk")
expect = [true, true, true, true, true, true, true, true, false, true, false, true, false, true, false, true, false, true];
else
expect = [true, true, true, true, true, true, true, true, true, true, true, true, false, true, true, true, true, true];
check(ids, expect, 0);
}
</script>
[GTK] accessibility/aria-readonly.html is failing https://bugs.webkit.org/show_bug.cgi?id=98357 Reviewed by Chris Fleizach. Source/WebCore: Add support for ATK_STATE_READ_ONLY and expose the value of aria-readonly as an AtkObject attribute. In order to eliminate duplicate checks, remove isReadOnly() and just use canSetAttributeValue(), moving all the logic into AccessibilityNodeObject. Add AccessibilityObject::supportsARIAReadOnly() so that we can explicitly expose the implicit value for aria-readonly on roles which support this property. Also add support for ATK_STATE_CHECKABLE, both because this state was missing and because it serves a similar function to ATK_STATE_EDITABLE for the purpose of verifying exposure of toggle-able elements that are not read-only. Test: accessibility/form-control-value-settable.html * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::canSetValueAttribute): (WebCore::AccessibilityNodeObject::isRequired): Deleted. (WebCore::AccessibilityNodeObject::supportsRequiredAttribute): Deleted. * accessibility/AccessibilityNodeObject.h: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::supportsARIAReadOnly): (WebCore::AccessibilityObject::ariaReadOnlyValue): * accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::isUnvisited): Deleted. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::clickPoint): (WebCore::AccessibilityRenderObject::isOffScreen): Deleted. (WebCore::AccessibilityRenderObject::anchorElement): Deleted. (WebCore::AccessibilityRenderObject::internalLinkElement): Deleted. (WebCore::AccessibilityRenderObject::textChanged): Deleted. (WebCore::AccessibilityRenderObject::clearChildren): Deleted. (WebCore::AccessibilityRenderObject::addImageMapChildren): Deleted. * accessibility/AccessibilityRenderObject.h: * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (getAttributeSetForAccessibilityObject): * accessibility/atk/WebKitAccessibleWrapperAtk.cpp: (webkitAccessibleGetAttributes): (setAtkStateSetFromCoreObject): (getInterfaceMaskFromObject): * inspector/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties): Source/WebKit/win: Call AccessibilityNode::canSetValueAttribute() to determine if STATE_SYSTEM_READONLY should be added and if editable text should be supported. * AccessibleBase.cpp: (AccessibleBase::state): * AccessibleTextImpl.cpp: (AccessibleText::deleteText): (AccessibleText::insertText): (AccessibleText::cutText): (AccessibleText::pasteText): (AccessibleText::replaceText): Tools: Add checks to isAttributeSettable() for ATK_STATE_READ_ONLY and the 'readonly' AtkObject attribute along with ATK_STATE_CHECKABLE for toggle-able elements, ATK_STATE_SELECTABLE for select elements, and ATK_STATE_FOCUSABLE combined with range verification for inputs which implement AtkValue. The latter two additions are admittedly a heuristic workaround for platform accessibility API differences. But they should be sufficient to facilitate cross-platform testing of isAttributeSettable() for form elements which lack ARIA attributes. Bump the minimum version of at-spi2-core and at-spi2-atk to 2.15.4 (earliest version that supports STATE_READ_ONLY). * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::AccessibilityUIElement::isAttributeSettable): * gtk/jhbuild.modules: LayoutTests: As part of this change, a new AtkObject attribute and state are being exposed. Update two tests accordingly. Also unskip the previously-failing test. Lastly, move the Mac form-control-value-settable.html test to the shared test set, with a minor tweak to check the platform for several elements' expectations. * accessibility/form-control-value-settable.html: Moved to shared tests. * accessibility/gtk/xml-roles-exposed-expected.txt: Updated. * platform/gtk/TestExpectations: Unskipped previously-failing test. * platform/gtk/accessibility/form-control-value-settable-expected.txt: Added. * platform/gtk/accessibility/table-detection-expected.txt: Updated. * platform/mac/accessibility/form-control-value-settable-expected.txt: Moved. Canonical link: https://commits.webkit.org/175702@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-11 07:14:31 +00:00
<script src="../resources/js-test-post.js"></script>
</body>
</html>