diff options
Diffstat (limited to 'webkit/glue/webaccessibility.cc')
-rw-r--r-- | webkit/glue/webaccessibility.cc | 29 |
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. |