haikuwebkit/LayoutTests/accessibility/ios-simulator/aria-details.html

47 lines
1.8 KiB
HTML
Raw Permalink Normal View History

AX: Consider implementing @aria-details. https://bugs.webkit.org/show_bug.cgi?id=165842 rdar://30725491 Reviewed by Chris Fleizach. Source/WebCore: Tests: accessibility/ios-simulator/aria-details.html accessibility/mac/aria-details.html - Added [WebAccessibilityObjectWrapper accessibilityDetailsElements] on iOS. - Added helper function accessibleElementsForObjects to retrieve platform- specific accessible elements given a collection of AXCoreObjects. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (accessibleElementsForObjects): (-[WebAccessibilityObjectWrapper accessibilityDetailsElements]): (-[WebAccessibilityObjectWrapper accessibilityErrorMessageElements]): Tools: Added AccessibilityUIElement::detailsElements. * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: (WTR::AccessibilityUIElement::detailsElements const): * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: (WTR::AccessibilityUIElement::detailsElements const): * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: (WTR::AccessibilityUIElement::detailsElements const): LayoutTests: * accessibility/ios-simulator/aria-details-expected.txt: Added. * accessibility/ios-simulator/aria-details.html: Added. * accessibility/mac/aria-details-expected.txt: Added. * accessibility/mac/aria-details.html: Added. * platform/mac-wk1/TestExpectations: Canonical link: https://commits.webkit.org/235778@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-25 23:35:20 +00:00
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<img id="image1" src="pythagorean.jpg" alt="Pythagorean Theorem" aria-details="details1 details2">
<details open id="details1">
<summary>Details example</summary>
<p>
The Pythagorean Theorem is a relationship in Euclidean Geometry between the three sides of
a right triangle, where the square of the hypotenuse is the sum of the squares of the two
opposing sides.
</p>
<p>
The following drawing illustrates an application of the Pythagorean Theorem when used to
construct a skateboard ramp.
</p>
<p>
In this example you will notice a skateboard ramp with a base and vertical board whose width
is the width of the ramp. To compute how long the ramp must be, simply calculate the
base length, square it, sum it with the square of the height of the ramp, and take the
square root of the sum.
</p>
</details>
<p>See an <a href="http://foo.com/pt.html" id="details2">Application of the Pythagorean Theorem</a>.</p>
<p id="description"></p>
<div id="console"></div>
<script>
description("This verifies the exposure of aria-details.");
if (window.accessibilityController) {
image1 = accessibilityController.accessibleElementById("image1");
details = image1.detailsElements();
shouldBe("details.length", "5");
shouldBe("details[0].description", "'AXLabel: Details example'");
shouldBe("details[2].description", "'AXLabel: The following drawing illustrates an application of the Pythagorean Theorem when used to construct a skateboard ramp.'");
shouldBe("details[4].description", "'AXLabel: Application of the Pythagorean Theorem'");
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>