Title: [91267] trunk
Revision
91267
Author
[email protected]
Date
2011-07-19 10:22:00 -0700 (Tue, 19 Jul 2011)

Log Message

If the control associated with a <label> is hidden, the label is also hidden (incorrectly)
https://bugs.webkit.org/show_bug.cgi?id=64752

Reviewed by Darin Adler.

Source/WebCore: 

Test: platform/mac/accessibility/label-element-with-hidden-control.html

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

LayoutTests: 

* platform/mac/accessibility/label-element-with-hidden-control-expected.txt: Added.
* platform/mac/accessibility/label-element-with-hidden-control.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (91266 => 91267)


--- trunk/LayoutTests/ChangeLog	2011-07-19 17:14:47 UTC (rev 91266)
+++ trunk/LayoutTests/ChangeLog	2011-07-19 17:22:00 UTC (rev 91267)
@@ -1,3 +1,13 @@
+2011-07-19  Chris Fleizach  <[email protected]>
+
+        If the control associated with a <label> is hidden, the label is also hidden (incorrectly)
+        https://bugs.webkit.org/show_bug.cgi?id=64752
+
+        Reviewed by Darin Adler.
+
+        * platform/mac/accessibility/label-element-with-hidden-control-expected.txt: Added.
+        * platform/mac/accessibility/label-element-with-hidden-control.html: Added.
+
 2011-07-19  Ryosuke Niwa  <[email protected]>
 
         Remove failing Chromium test expectations after r91224.

Added: trunk/LayoutTests/platform/mac/accessibility/label-element-with-hidden-control-expected.txt (0 => 91267)


--- trunk/LayoutTests/platform/mac/accessibility/label-element-with-hidden-control-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/label-element-with-hidden-control-expected.txt	2011-07-19 17:22:00 UTC (rev 91267)
@@ -0,0 +1,15 @@
+Test label1 Test label2
+This tests that if a label element references a hidden control, it is still visible to accessibility.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS container.childAtIndex('0').role is 'AXRole: AXGroup'
+PASS container.childAtIndex('0').childAtIndex(0).role is 'AXRole: AXStaticText'
+PASS container.childAtIndex('0').childAtIndex(0).stringValue is 'AXValue: Test label1'
+PASS container.childAtIndex('1').role is 'AXRole: AXCheckBox'
+PASS container.childAtIndex('1').title is 'AXTitle: Test label2'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/mac/accessibility/label-element-with-hidden-control.html (0 => 91267)


--- trunk/LayoutTests/platform/mac/accessibility/label-element-with-hidden-control.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/accessibility/label-element-with-hidden-control.html	2011-07-19 17:22:00 UTC (rev 91267)
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script>
+var successfullyParsed = false;
+</script>
+<script src=""
+</head>
+<body id="body">
+
+<label for="" label1</label><input type="checkbox" name="control1" id="control1" style="visibility:hidden;">
+<label for="" label2</label><input type="checkbox" name="control2" id="control2" >
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+    description("This tests that if a label element references a hidden control, it is still visible to accessibility.");
+    if (window.accessibilityController) {
+
+        if (window.accessibilityController) {
+
+            var body = document.getElementById("body");
+            body.focus();
+            var container = accessibilityController.focusedElement.childAtIndex(0);
+            shouldBe("container.childAtIndex('0').role", "'AXRole: AXGroup'");            
+            shouldBe("container.childAtIndex('0').childAtIndex(0).role", "'AXRole: AXStaticText'");            
+            shouldBe("container.childAtIndex('0').childAtIndex(0).stringValue", "'AXValue: Test label1'");            
+            shouldBe("container.childAtIndex('1').role", "'AXRole: AXCheckBox'");
+            shouldBe("container.childAtIndex('1').title", "'AXTitle: Test label2'");            
+        }
+    }
+    successfullyParsed = true;
+</script>
+
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (91266 => 91267)


--- trunk/Source/WebCore/ChangeLog	2011-07-19 17:14:47 UTC (rev 91266)
+++ trunk/Source/WebCore/ChangeLog	2011-07-19 17:22:00 UTC (rev 91267)
@@ -1,3 +1,15 @@
+2011-07-19  Chris Fleizach  <[email protected]>
+
+        If the control associated with a <label> is hidden, the label is also hidden (incorrectly)
+        https://bugs.webkit.org/show_bug.cgi?id=64752
+
+        Reviewed by Darin Adler.
+
+        Test: platform/mac/accessibility/label-element-with-hidden-control.html
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::exposesTitleUIElement):
+
 2011-07-19  Vsevolod Vlasov  <[email protected]>
 
         Web Inspector: Backend should provide network resource identifiers that are unique across navigation.

Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (91266 => 91267)


--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2011-07-19 17:14:47 UTC (rev 91266)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp	2011-07-19 17:22:00 UTC (rev 91267)
@@ -1658,6 +1658,11 @@
     if (!isControl())
         return false;
 
+    // If this control is ignored (because it's invisible), 
+    // then the label needs to be exposed so it can be visible to accessibility.
+    if (accessibilityIsIgnored())
+        return true;
+    
     // checkbox or radio buttons don't expose the title ui element unless it has a title already
     if (isCheckboxOrRadio() && getAttribute(titleAttr).isEmpty())
         return false;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to