summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-02 18:17:44 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-02 18:17:44 +0000
commit8d93603116c5be19665c84340c5c12b61b62b5f1 (patch)
treede4c0ba56c3b258986299bb578557f3cdee4eacc /webkit
parent12cd6ba3acb630835295ad66ff194be52e3eef34 (diff)
downloadchromium_src-8d93603116c5be19665c84340c5c12b61b62b5f1.zip
chromium_src-8d93603116c5be19665c84340c5c12b61b62b5f1.tar.gz
chromium_src-8d93603116c5be19665c84340c5c12b61b62b5f1.tar.bz2
Expose accessible text attributes for anything with an
editable text role, not just <input> and <textarea> elements. BUG=none TEST=Try using pure-javascript text editor with VoiceOver on Mac OS X. Review URL: http://codereview.chromium.org/8351066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108318 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/webaccessibility.cc29
1 files changed, 13 insertions, 16 deletions
diff --git a/webkit/glue/webaccessibility.cc b/webkit/glue/webaccessibility.cc
index 92de74f..7eea917 100644
--- a/webkit/glue/webaccessibility.cc
+++ b/webkit/glue/webaccessibility.cc
@@ -820,22 +820,19 @@ void WebAccessibility::Init(const WebKit::WebAccessibilityObject& src,
html_attributes.push_back(std::pair<string16, string16>(name, value));
}
- if (element.isFormControlElement()) {
- WebKit::WebFormControlElement form_element =
- element.to<WebKit::WebFormControlElement>();
- if (form_element.formControlType() == ASCIIToUTF16("text") ||
- form_element.formControlType() == ASCIIToUTF16("textarea")) {
- // Jaws gets confused by children of text fields, so we ignore them.
- include_children = false;
-
- int_attributes[ATTR_TEXT_SEL_START] = src.selectionStart();
- int_attributes[ATTR_TEXT_SEL_END] = src.selectionEnd();
- WebKit::WebVector<int> src_line_breaks;
- src.lineBreaks(src_line_breaks);
- line_breaks.reserve(src_line_breaks.size());
- for (size_t i = 0; i < src_line_breaks.size(); ++i)
- line_breaks.push_back(src_line_breaks[i]);
- }
+ if (role == ROLE_EDITABLE_TEXT ||
+ role == ROLE_TEXTAREA ||
+ role == ROLE_TEXT_FIELD) {
+ // Jaws gets confused by children of text fields, so we ignore them.
+ include_children = false;
+
+ int_attributes[ATTR_TEXT_SEL_START] = src.selectionStart();
+ int_attributes[ATTR_TEXT_SEL_END] = src.selectionEnd();
+ WebKit::WebVector<int> src_line_breaks;
+ src.lineBreaks(src_line_breaks);
+ line_breaks.reserve(src_line_breaks.size());
+ for (size_t i = 0; i < src_line_breaks.size(); ++i)
+ line_breaks.push_back(src_line_breaks[i]);
}
// ARIA role.