Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: third_party/WebKit/LayoutTests/accessibility/aria-owns-ignores-leafs.html

Issue 2072013004: Aria-owns should not work on roles that can't have children. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactored test Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/accessibility/aria-owns-ignores-leafs.html
diff --git a/third_party/WebKit/LayoutTests/accessibility/aria-owns-ignores-leafs.html b/third_party/WebKit/LayoutTests/accessibility/aria-owns-ignores-leafs.html
new file mode 100644
index 0000000000000000000000000000000000000000..9db935e38d273a8a459f4a2047aa8b7208630cb6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/accessibility/aria-owns-ignores-leafs.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+
+<style>
+.hideAllContainers .container { display: none; }
+
+button {
+ display: block;
+}
+</style>
+
+<div class="container" id="container1" role="group" aria-label="Container">
+ <div id="heading1" role="heading" aria-owns="menu1">heading</div>
+ <div id="menu1" role="menu">menu</div>
+</div>
+
+<script>
+test(function(t)
+{
+ // No problem with using aria-owns to put a menu inside a heading.
+ var axHeading1 = accessibilityController.accessibleElementById("heading1");
+ assert_equals(axHeading1.name, "heading menu");
+ var axContainer1 = accessibilityController.accessibleElementById("container1");
+ assert_equals(axContainer1.childrenCount, 1);
+ assert_equals(axContainer1.childAtIndex(0).role, "AXRole: AXHeading");
+}, "Aria-owns should re-parent a target when the source role allows children.");
+</script>
+
+<div class="container" id="container2" role="group" aria-label="Container">
+ <div id="button2" role="button" aria-owns="menu2">button</div>
+ <div id="menu2" role="menu">menu</div>
+</div>
+
+<script>
+test(function(t)
+{
+ // A button can't have children, so we should ignore aria-owns.
+ var axButton2 = accessibilityController.accessibleElementById("button2");
+ assert_equals(axButton2.name, "button");
+ var axContainer2 = accessibilityController.accessibleElementById("container2");
+ assert_equals(axContainer2.childrenCount, 2);
+ assert_equals(axContainer2.childAtIndex(0).role, "AXRole: AXButton");
+ assert_equals(axContainer2.childAtIndex(1).role, "AXRole: AXMenu");
+}, "Aria-owns doesn't move an element if the role doesn't allow children.");
+</script>
+
+<script>
+if (window.testRunner)
+ document.body.className = "hideAllContainers";
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698