haikuwebkit/LayoutTests/accessibility/ARIA-reflection.html

73 lines
1.8 KiB
HTML
Raw Permalink Normal View History

AX: AOM: Add ARIA IDL Attribute Reflection https://bugs.webkit.org/show_bug.cgi?id=184676 <rdar://problem/39476882> Source/WebCore: Reviewed by Chris Fleizach. Test: accessibility/ARIA-reflection.html * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * accessibility/AccessibilityRole.idl: Added. * accessibility/AriaAttributes.idl: Added. * dom/Element.idl: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setAriaReflectionEnabled): (WebCore::RuntimeEnabledFeatures::ariaReflectionEnabled const): Source/WebKit: Added ARIA property string reflection on Element, behind a new runtime flag. Spec: https://w3c.github.io/aria/#idl-interface Reviewed by Chris Fleizach. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetAriaReflectionEnabled): (WKPreferencesGetAriaReflectionEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: Source/WebKitLegacy/mac: Reviewed by Chris Fleizach. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences ariaReflectionEnabled]): (-[WebPreferences setAriaReflectionEnabled:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChanged:]): Tools: Reviewed by Chris Fleizach. * DumpRenderTree/mac/DumpRenderTree.mm: (enableExperimentalFeatures): * WebKitTestRunner/TestController.cpp: (WTR::TestController::resetPreferencesToConsistentValues): LayoutTests: Reviewed by Chris Fleizach. * accessibility/ARIA-reflection-expected.txt: Added. * accessibility/ARIA-reflection.html: Added. * js/dom/dom-static-property-for-in-iteration.html: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/203354@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-01 22:07:42 +00:00
<!DOCTYPE html>
<html>
<body id="body">
<script src="../resources/js-test-pre.js"></script>
<div id="content">
<div id="test" data="some data">
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests ARIA IDL Attribute Reflection.");
var element = document.getElementById("test");
var data = element.getAttribute("data");
var otherData = "other data";
var currentProperty;
var currentAttribute;
function testElement() {
currentAttribute = currentProperty.replace("aria", "aria-").toLowerCase();
debug("\nTest " + currentProperty + " < - > " + currentAttribute);
shouldBeNull("element[currentProperty]");
shouldBeNull("element.getAttribute(currentAttribute)");
// Set the property value
debug("element[\"" + currentProperty + "\"] = data;");
element[currentProperty] = data;
shouldBe("element.getAttribute(currentAttribute)", "data");
// Set the attribute value
debug("element.setAttribute(\"" + currentAttribute + "\", otherData);");
element.setAttribute(currentAttribute, otherData);
shouldBe("element[currentProperty]", "otherData");
}
function testRole() {
currentProperty = "role";
testElement();
}
if (window.accessibilityController) {
testRole();
// There are 46 ARIA attributes in total.
var count = 0;
for (var propertyName in element) {
if (propertyName.startsWith("aria")) {
currentProperty = propertyName;
testElement();
count++;
}
}
debug("\n");
shouldBe("count", "38");
AX: AOM: Add ARIA IDL Attribute Reflection https://bugs.webkit.org/show_bug.cgi?id=184676 <rdar://problem/39476882> Source/WebCore: Reviewed by Chris Fleizach. Test: accessibility/ARIA-reflection.html * CMakeLists.txt: * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * accessibility/AccessibilityRole.idl: Added. * accessibility/AriaAttributes.idl: Added. * dom/Element.idl: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setAriaReflectionEnabled): (WebCore::RuntimeEnabledFeatures::ariaReflectionEnabled const): Source/WebKit: Added ARIA property string reflection on Element, behind a new runtime flag. Spec: https://w3c.github.io/aria/#idl-interface Reviewed by Chris Fleizach. * Shared/WebPreferences.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetAriaReflectionEnabled): (WKPreferencesGetAriaReflectionEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: Source/WebKitLegacy/mac: Reviewed by Chris Fleizach. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences ariaReflectionEnabled]): (-[WebPreferences setAriaReflectionEnabled:]): * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChanged:]): Tools: Reviewed by Chris Fleizach. * DumpRenderTree/mac/DumpRenderTree.mm: (enableExperimentalFeatures): * WebKitTestRunner/TestController.cpp: (WTR::TestController::resetPreferencesToConsistentValues): LayoutTests: Reviewed by Chris Fleizach. * accessibility/ARIA-reflection-expected.txt: Added. * accessibility/ARIA-reflection.html: Added. * js/dom/dom-static-property-for-in-iteration.html: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/203354@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-08-01 22:07:42 +00:00
} else {
testFailed("Could not load accessibility controller");
}
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>