WAI-ARIA: checkbox does not determine its label from text content
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Nov 2009 06:24:43 +0000 (06:24 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 14 Nov 2009 06:24:43 +0000 (06:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=31456

Reviewed by Darin Adler.

WebCore:

Test: accessibility/aria-checkbox-text.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::title):

LayoutTests:

* accessibility/aria-checkbox-text.html: Added.
* platform/gtk/Skipped:
* platform/mac/accessibility/aria-checkbox-text-expected.txt: Added.
* platform/win/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@50994 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/accessibility/aria-checkbox-text.html [new file with mode: 0644]
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/mac/accessibility/aria-checkbox-text-expected.txt [new file with mode: 0644]
LayoutTests/platform/win/Skipped
WebCore/ChangeLog
WebCore/accessibility/AccessibilityRenderObject.cpp

index ec26070..e2aff4d 100644 (file)
@@ -1,3 +1,15 @@
+2009-11-13  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        WAI-ARIA: checkbox does not determine its label from text content
+        https://bugs.webkit.org/show_bug.cgi?id=31456
+
+        * accessibility/aria-checkbox-text.html: Added.
+        * platform/gtk/Skipped:
+        * platform/mac/accessibility/aria-checkbox-text-expected.txt: Added.
+        * platform/win/Skipped:
+
 2009-11-13  Alexey Proskuryakov  <ap@apple.com>
 
         Disable websocket tests on Tiger, as they time out.
diff --git a/LayoutTests/accessibility/aria-checkbox-text.html b/LayoutTests/accessibility/aria-checkbox-text.html
new file mode 100644 (file)
index 0000000..7763d86
--- /dev/null
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="../fast/js/resources/js-test-style.css">
+<script>
+var successfullyParsed = false;
+</script>
+<script src="../fast/js/resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<div role="radiobuttongroup">
+        <div role="checkbox" id="check1" tabindex="0" aria-checked="true">One</div>
+        <div role="checkbox" id="check2" tabindex="0">Two</div>
+        <div role="checkbox" id="check3" tabindex="0" id="foo" aria-labelledby="foo">Three</div>
+</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that ARIA checkboxes use accessible name computation.");
+
+    if (window.accessibilityController) {
+
+          var checkbox = document.getElementById("check1");
+          checkbox.focus();
+          checkbox = accessibilityController.focusedElement;
+          shouldBe("checkbox.title", "'AXTitle: One'");
+
+          checkbox = document.getElementById("check2");
+          checkbox.focus();
+          checkbox = accessibilityController.focusedElement;
+          shouldBe("checkbox.title", "'AXTitle: Two'");
+
+          checkbox = document.getElementById("check3");
+          checkbox.focus();
+          checkbox = accessibilityController.focusedElement;
+          shouldBe("checkbox.title", "'AXTitle: Three'");
+    }
+
+    successfullyParsed = true;
+</script>
+
+<script src="../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
index d42fa06..527e387 100644 (file)
@@ -44,6 +44,7 @@
 # Tests in accessibility/ directory
 # An implementation of accessibilityController is required.
 #   Tests failing
+accessibility/aria-checkbox-text.html
 accessibility/aria-combobox.html
 accessibility/aria-disabled.html
 accessibility/aria-hidden.html
diff --git a/LayoutTests/platform/mac/accessibility/aria-checkbox-text-expected.txt b/LayoutTests/platform/mac/accessibility/aria-checkbox-text-expected.txt
new file mode 100644 (file)
index 0000000..aebbb67
--- /dev/null
@@ -0,0 +1,15 @@
+One
+Two
+Three
+This tests that ARIA checkboxes use accessible name computation.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS checkbox.title is 'AXTitle: One'
+PASS checkbox.title is 'AXTitle: Two'
+PASS checkbox.title is 'AXTitle: Three'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
index c1543ef..011ab5e 100644 (file)
@@ -354,6 +354,7 @@ http/tests/xmlhttprequest/access-control-basic-non-simple-allow-async.html
 http/tests/xmlhttprequest/access-control-basic-non-simple-allow.html
 
 # Accessibility tests without results or with Mac-specific results.
+accessibility/aria-checkbox-text.html
 accessibility/aria-combobox.html
 accessibility/aria-controls-with-tabs.html
 accessibility/aria-describedby-on-input.html
index 773d68b..06f647d 100644 (file)
@@ -1,3 +1,15 @@
+2009-11-13  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        WAI-ARIA: checkbox does not determine its label from text content
+        https://bugs.webkit.org/show_bug.cgi?id=31456
+
+        Test: accessibility/aria-checkbox-text.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::title):
+
 2009-11-13  Dimitri Glazkov  <dglazkov@chromium.org>
 
         Unreviewed, build fix.
index 085c1c2..dd4912f 100644 (file)
@@ -1054,6 +1054,7 @@ String AccessibilityRenderObject::title() const
         || ariaRole == MenuItemRole
         || ariaRole == MenuButtonRole
         || ariaRole == RadioButtonRole
+        || ariaRole == CheckBoxRole
         || ariaRole == TabRole
         || isHeading())
         return textUnderElement();