summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-12 16:49:17 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-12 16:49:17 +0000
commitf4d2041dee86fcb95027234278f43d4bc6ae7564 (patch)
treefd575ccf87abe2cb2376fe51aa43c6291e9b0288
parent2b6a388ec76e673a2414253c20a508218537e17a (diff)
downloadchromium_src-f4d2041dee86fcb95027234278f43d4bc6ae7564.zip
chromium_src-f4d2041dee86fcb95027234278f43d4bc6ae7564.tar.gz
chromium_src-f4d2041dee86fcb95027234278f43d4bc6ae7564.tar.bz2
Re-land 108318 now that patch for WebKit bug 71561 has landed
- 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. TBR=dmazzoni@chromium.org Review URL: http://codereview.chromium.org/8351066 Review URL: http://codereview.chromium.org/8546005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109801 0039d316-1c4b-4281-b951-d872f2087c98
-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.