haikuwebkit/LayoutTests/accessibility/ios-simulator/element-haspopup.html

51 lines
1.4 KiB
HTML
Raw Permalink Normal View History

Accessibility objects contained in links should honor the aria-haspopup attribute in the ancestor link. https://bugs.webkit.org/show_bug.cgi?id=199107 <rdar://problem/43663611> Patch by Andres Gonzalez <andresg_22@apple.com> on 2019-06-22 Reviewed by Chris Fleizach. Source/WebCore: Tests: accessibility/ios-simulator/button-with-aria-haspopup-role.html accessibility/ios-simulator/element-haspopup.html If an accessibility object is contained within an <a>, we should check the aria-haspopup attribute on the ancestor <a> element. This was done before in the iOS WebKit accessibility bunddle override. * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::hasPopup const): Tools: iOS implementation for AccessibilityUIElement::hasPopup. * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: (WTR::AccessibilityUIElement::hasPopup const): LayoutTests: * accessibility/element-haspopup-expected.txt: * accessibility/element-haspopup.html: Added cases for a <p> element contained within <a>. * accessibility/ios-simulator/button-with-aria-haspopup-role-expected.txt: Added. * accessibility/ios-simulator/button-with-aria-haspopup-role.html: Added. Existed for MacOS and now also for iOS. * accessibility/ios-simulator/element-haspopup-expected.txt: Copied from LayoutTests/accessibility/element-haspopup-expected.txt. * accessibility/ios-simulator/element-haspopup.html: Added. Canonical link: https://commits.webkit.org/213100@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-06-22 18:59:18 +00:00
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body id="body">
<a href="#" aria-haspopup="true" tabindex="0" id="link1">Link 1</a>
<a href="#" aria-haspopup="false" tabindex="0" id="link2">Link 2</a>
<a href="#" aria-haspopup="true" tabindex="0" id="link3">
<p id="paragraph1">Paragraph 1.</p>
</a>
<a href="#" aria-haspopup="false" tabindex="0" id="link4">
<p id="paragraph2">Paragraph 2.</p>
</a>
<a href="#" tabindex="0" id="link5">
<p id="paragraph3">Paragraph 3.</p>
</a>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that an element will report that it has a popup correctly.");
if (window.accessibilityController) {
document.getElementById("link1").focus();
shouldBe("accessibilityController.focusedElement.hasPopup", "true");
document.getElementById("link2").focus();
shouldBe("accessibilityController.focusedElement.hasPopup", "false");
var p1 = accessibilityController.accessibleElementById("paragraph1");
shouldBe("p1.hasPopup", "true");
var p2 = accessibilityController.accessibleElementById("paragraph2");
shouldBe("p2.hasPopup", "false");
var p3 = accessibilityController.accessibleElementById("paragraph3");
shouldBe("p3.hasPopup", "false");
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>