Revert of Properly prioritize the sources of an accessible name on Android....

Revert of Properly prioritize the sources of an accessible name on Android. (https://codereview.chromium.org/303113003/)

Reason for revert:
Broke android bots it looks like:
http://build.chromium.org/p/chromium.linux/builders/Android%20Tests%20%28dbg%29/builds/20683

Original issue's description:
> Properly prioritize the sources of an accessible name on Android.
> 
> This spec covers the right order: http://www.w3.org/TR/wai-aria-implementation
> 
> Now Android basically matches Windows, the difference is that Android has
> to pick just one accessible name while Windows can have both a name and
> a description.
> 
> There were existing cross-platform tests; I updated the Android
> expectations.
> 
> BUG=359216
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=274017

TBR=aboxhall@chromium.org,dmazzoni@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=359216

Review URL: https://codereview.chromium.org/304293006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274063 0039d316-1c4b-4281-b951-d872f2087c98
parent 7af3c912
...@@ -268,29 +268,12 @@ base::string16 BrowserAccessibilityAndroid::GetText() const { ...@@ -268,29 +268,12 @@ base::string16 BrowserAccessibilityAndroid::GetText() const {
return base::string16(); return base::string16();
} }
// See comment in browser_accessibility_win.cc for details.
// The difference here is that we can only expose one accessible
// name on Android, not 2 or 3 like on Windows or Mac.
//
// The basic rule is: prefer description (aria-labelledby or aria-label),
// then help (title), then name (inner text), then value (control value).
// However, if title_elem_id is set, that means there's a label element
// supplying the name and then name takes precedence over help.
// TODO(dmazzoni): clean this up by providing more granular labels in
// Blink, making the platform-specific mapping to accessible text simpler.
base::string16 description = GetString16Attribute(ui::AX_ATTR_DESCRIPTION); base::string16 description = GetString16Attribute(ui::AX_ATTR_DESCRIPTION);
base::string16 help = GetString16Attribute(ui::AX_ATTR_HELP);
int title_elem_id = GetIntAttribute(
ui::AX_ATTR_TITLE_UI_ELEMENT);
base::string16 text; base::string16 text;
if (!description.empty()) if (!name().empty())
text = description;
else if (title_elem_id && !name().empty())
text = base::UTF8ToUTF16(name());
else if (!help.empty())
text = help;
else if (!name().empty())
text = base::UTF8ToUTF16(name()); text = base::UTF8ToUTF16(name());
else if (!description.empty())
text = description;
else if (!value().empty()) else if (!value().empty())
text = base::UTF8ToUTF16(value()); text = base::UTF8ToUTF16(value());
......
#<skip - this is definitely wrong
android.webkit.WebView focusable focused scrollable android.webkit.WebView focusable focused scrollable
android.view.View android.view.View
android.widget.Button clickable focusable name='InnerText0' android.widget.Button clickable focusable name='InnerText0'
android.widget.Button clickable focusable name='Title1' android.widget.Button clickable focusable name='InnerText1'
android.widget.Button clickable focusable name='AriaLabel2' android.widget.Button clickable focusable name='InnerText2'
android.widget.Button clickable focusable name='LabelledBy3' android.widget.Button clickable focusable name='InnerText3'
android.widget.Button clickable focusable name='LabelledBy4' android.widget.Button clickable focusable name='InnerText4'
android.widget.Button clickable focusable name='DescribedBy5' android.widget.Button clickable focusable name='InnerText5'
#<skip - last one should be DescribedBy5
android.webkit.WebView focusable focused scrollable android.webkit.WebView focusable focused scrollable
android.view.View android.view.View
android.widget.CheckBox checkable clickable focusable name='Title0' android.widget.CheckBox checkable clickable focusable name='Title0'
android.widget.CheckBox checkable clickable focusable name='Title1' android.widget.CheckBox checkable clickable focusable name='Label1'
android.widget.CheckBox checkable clickable focusable name='AriaLabel2' android.widget.CheckBox checkable clickable focusable name='AriaLabel2'
android.widget.CheckBox checkable clickable focusable name='LabelledBy3' android.widget.CheckBox checkable clickable focusable name='LabelledBy3'
android.widget.CheckBox checkable clickable focusable name='LabelledBy4' android.widget.CheckBox checkable clickable focusable name='LabelledBy4'
android.widget.CheckBox checkable clickable focusable name='DescribedBy5' android.widget.CheckBox checkable focusable
#<skip - calc is wrong
android.webkit.WebView focusable focused scrollable android.webkit.WebView focusable focused scrollable
android.view.View android.view.View
android.widget.EditText clickable editable_text focusable name='Title0' input_type=1 android.widget.EditText clickable editable_text focusable name='Title0'
android.widget.EditText clickable editable_text focusable name='Title1' input_type=1 android.widget.EditText clickable editable_text focusable name='Title1'
android.widget.EditText clickable editable_text focusable name='AriaLabel2' input_type=1 android.widget.EditText clickable editable_text focusable name='Label2'
android.widget.EditText clickable editable_text focusable name='LabelledBy3' input_type=1 android.widget.EditText clickable editable_text focusable name='Label3'
android.widget.EditText editable_text focusable input_type=1 android.widget.EditText editable_text focusable
android.widget.EditText clickable editable_text focusable name='Title5' input_type=1 android.widget.EditText clickable editable_text focusable name='Title5'
android.widget.EditText clickable editable_text focusable name='LabelledBy6' input_type=1 android.widget.EditText clickable editable_text focusable name='Label6'
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