AX: when no other label on provided on form elements, WebKit should fall back to using @title

https://bugs.webkit.org/show_bug.cgi?id=112842

Patch by Samuel White <samuel_white@apple.com> on 2013-09-04
Reviewed by Chris Fleizach.

Source/WebCore:

Don't let input elements include empty labels in their accessibility title.

Test: platform/mac/accessibility/input-title.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::titleElementText):

LayoutTests:

Added test to ensure that input elements are computing their
accessibility title as expected.

* platform/mac/accessibility/input-title-expected.txt: Added.
* platform/mac/accessibility/input-title.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155078 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0eadccd7
2013-09-04 Samuel White <samuel_white@apple.com>
AX: when no other label on provided on form elements, WebKit should fall back to using @title
https://bugs.webkit.org/show_bug.cgi?id=112842
Reviewed by Chris Fleizach.
Added test to ensure that input elements are computing their
accessibility title as expected.
* platform/mac/accessibility/input-title-expected.txt: Added.
* platform/mac/accessibility/input-title.html: Added.
2013-09-04 Tim Horton <timothy_horton@apple.com>
[mac] PDFDocumentImage should use PDFKit to draw
This tests that the input title is exposed correctly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS green.description is 'AXDescription: green'
PASS red.description is 'AXDescription: red'
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE html>
<html>
<head>
<script src="../../../fast/js/resources/js-test-pre.js"></script>
<title>Input Title</title>
</head>
<body>
<input id="green" name="color" title="green" type="radio">
<input id="red" name="color" title="red" type="radio">
<label for="red"></label>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that the input title is exposed correctly.");
if (window.accessibilityController) {
var green = accessibilityController.accessibleElementById("green");
shouldBe("green.description", "'AXDescription: green'");
var red = accessibilityController.accessibleElementById("red");
shouldBe("red.description", "'AXDescription: red'");
}
</script>
<script src="../../../fast/js/resources/js-test-post.js"></script>
</body>
</html>
2013-09-04 Samuel White <samuel_white@apple.com>
AX: when no other label on provided on form elements, WebKit should fall back to using @title
https://bugs.webkit.org/show_bug.cgi?id=112842
Reviewed by Chris Fleizach.
Don't let input elements include empty labels in their accessibility title.
Test: platform/mac/accessibility/input-title.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::titleElementText):
2013-09-04 Andreas Kling <akling@apple.com>
Make ImageQualityController per-RenderView.
......@@ -1171,7 +1171,9 @@ void AccessibilityNodeObject::titleElementText(Vector<AccessibilityText>& textOr
HTMLLabelElement* label = labelForElement(toElement(node));
if (label) {
AccessibilityObject* labelObject = axObjectCache()->getOrCreate(label);
textOrder.append(AccessibilityText(label->innerText(), LabelByElementText, labelObject));
String innerText = label->innerText();
if (!innerText.isEmpty())
textOrder.append(AccessibilityText(innerText, LabelByElementText, labelObject));
return;
}
}
......
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