Commit 34d90966 authored by Katie D's avatar Katie D Committed by Commit Bot

Elements that are positioned should not be ignored for a11y.

This fixes a bug with absolutely positioned webviews in apps
such as Hangouts.

Note that AutomationApiTest.LocationInWebView fails without the
change to AXLayoutObject.cpp.

Bug: 801995
Change-Id: I1a3e8e66f3f64b7ec6f619076374438aad901d65
Reviewed-on: https://chromium-review.googlesource.com/894182Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533239}
parent 8442e044
<!DOCTYPE html>
<html>
<head>
<title>Frame with WebView</title>
......
android.webkit.WebView focusable scrollable
++android.view.View
++android.app.Dialog role_description='dialog'
++++android.view.View name='The dialog subtree should be the only text content in the accessibility tree. '
++++android.view.View role_description='link' clickable focusable focused link name='Link inside the dialog.'
\ No newline at end of file
++++android.view.View role_description='link' clickable focusable focused link name='Link inside the dialog.'
rootWebArea
++genericContainer
++dialog
++++staticText name='The dialog subtree should be the only text content in the accessibility tree. '
++++++inlineTextBox name='The dialog subtree should be the only text content in the accessibility tree. '
++++link name='Link inside the dialog.'
++++++staticText name='Link inside the dialog.'
++++++++inlineTextBox name='Link inside the dialog.'
\ No newline at end of file
++++++++inlineTextBox name='Link inside the dialog.'
AXWebArea
++AXGroup
++AXGroup AXSubrole=AXApplicationDialog
++++AXStaticText AXValue='The dialog subtree should be the only text content in the accessibility tree. '
++++AXLink AXTitle='Link inside the dialog.'
......
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
++IA2_ROLE_SECTION
++ROLE_SYSTEM_DIALOG IA2_STATE_MODAL
++++ROLE_SYSTEM_STATICTEXT name='The dialog subtree should be the only text content in the accessibility tree. '
++++ROLE_SYSTEM_LINK name='Link inside the dialog.' FOCUSABLE
++++++ROLE_SYSTEM_STATICTEXT name='Link inside the dialog.'
\ No newline at end of file
++++++ROLE_SYSTEM_STATICTEXT name='Link inside the dialog.'
android.webkit.WebView focusable focused scrollable
++android.view.View
++android.app.Dialog role_description='dialog'
++++android.view.View name='This is the now active dialog. Of course it should be in the tree. '
++++android.widget.Button role_description='button' clickable focusable name='This is in the active dialog and should be in the tree.'
\ No newline at end of file
++++android.widget.Button role_description='button' clickable focusable name='This is in the active dialog and should be in the tree.'
rootWebArea
++genericContainer
++dialog
++++staticText name='This is the now active dialog. Of course it should be in the tree. '
++++++inlineTextBox name='This is the now active dialog. Of course it should be in the tree. '
++++button name='This is in the active dialog and should be in the tree.'
\ No newline at end of file
++++button name='This is in the active dialog and should be in the tree.'
AXWebArea
++AXGroup
++AXGroup AXSubrole=AXApplicationDialog
++++AXStaticText AXValue='This is the now active dialog. Of course it should be in the tree. '
++++AXButton AXTitle='This is in the active dialog and should be in the tree.'
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
++IA2_ROLE_SECTION
++ROLE_SYSTEM_DIALOG IA2_STATE_MODAL
++++ROLE_SYSTEM_STATICTEXT name='This is the now active dialog. Of course it should be in the tree. '
++++ROLE_SYSTEM_PUSHBUTTON name='This is in the active dialog and should be in the tree.' FOCUSABLE
\ No newline at end of file
++++ROLE_SYSTEM_PUSHBUTTON name='This is in the active dialog and should be in the tree.' FOCUSABLE
......@@ -719,8 +719,12 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored(
if (IsGenericFocusableElement() && node->hasChildren())
return false;
// Positioned elements and scrollable containers are important for
// determining bounding boxes.
if (IsScrollableContainer())
return false;
if (layout_object_->IsPositioned())
return false;
// Ignore layout objects that are block flows with inline children. These
// are usually dummy layout objects that pad out the tree, but there are
......
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