Commit ff63faae authored by cfleizach@apple.com's avatar cfleizach@apple.com

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.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@91267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9744812c
2011-07-19 Chris Fleizach <cfleizach@apple.com>
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 <rniwa@webkit.org>
Remove failing Chromium test expectations after r91224.
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
<!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">
<label for="control1">Test label1</label><input type="checkbox" name="control1" id="control1" style="visibility:hidden;">
<label for="control2">Test 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="../../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
2011-07-19 Chris Fleizach <cfleizach@apple.com>
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 <vsevik@chromium.org>
Web Inspector: Backend should provide network resource identifiers that are unique across navigation.
......@@ -1658,6 +1658,11 @@ bool AccessibilityRenderObject::exposesTitleUIElement() const
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment