Commit 86811e08 authored by cfleizach@apple.com's avatar cfleizach@apple.com

Bug 25453: AX: fall back to PLACEHOLDER attr if form element is not labeled

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



git-svn-id: svn://svn.chromium.org/blink/trunk@42949 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 16b99db4
2009-04-28 Chris Fleizach <cfleizach@apple.com>
Reviewed by Darin Alder.
Bug 25453: AX: fall back to PLACEHOLDER attr if form element is not labeled
https://bugs.webkit.org/show_bug.cgi?id=25453
* accessibility/placeholder-expected.txt: Added.
* accessibility/placeholder.html: Added.
2009-04-28 Chris Fleizach <cfleizach@apple.com>
Reviewed by Darin Adler.
<html>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
</script>
<body id="body">
<!-- This test makes sure that the AXTitle will fall back to placeholder text if nothing else is available -->
<input placeholder="search" type="text" name="q" size="15" maxlength="255" id="searchterm" />
<div id="result"></div>
<script>
if (window.accessibilityController) {
var result = document.getElementById("result");
var field = document.getElementById("searchterm");
field.focus();
var fieldElement = accessibilityController.focusedElement;
var pattern = "AXTitle: search";
if (fieldElement.allAttributes().indexOf(pattern) != -1) {
result.innerText += "Test passed\n";
}
else {
result.innerText += "Test failed\n";
}
}
</script>
</body>
</html>
2009-04-28 Chris Fleizach <cfleizach@apple.com>
Reviewed by Darin Adler.
Bug 25453: AX: fall back to PLACEHOLDER attr if form element is not labeled
https://bugs.webkit.org/show_bug.cgi?id=25453
Test: accessibility/placeholder.html
* page/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::title):
2009-04-28 Chris Fleizach <cfleizach@apple.com>
Reviewed by Darin Adler.
......@@ -908,6 +908,10 @@ String AccessibilityRenderObject::title() const
HTMLLabelElement* label = labelForElement(static_cast<Element*>(node));
if (label && !titleUIElement())
return label->innerText();
const AtomicString& placeholder = getAttribute(placeholderAttr);
if (!placeholder.isEmpty())
return placeholder;
}
if (roleValue() == ButtonRole
......
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