Commit 5ef90f37 authored by Jacques Newman's avatar Jacques Newman Committed by Commit Bot

Do not allow inert elements into the browser-side AX tree.

Bug: 996992
Change-Id: Ib36a9a42a97a27ed8fc4ad4f377abd49185a2e36
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1814460Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Jacques Newman <janewman@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#699549}
parent 54c6ac50
android.webkit.WebView focusable scrollable android.webkit.WebView focusable scrollable
++android.view.View
++android.app.Dialog role_description='dialog' ++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 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.' ++++android.view.View role_description='link' clickable focusable focused link name='Link inside the dialog.'
++android.view.View
[document web] [document web]
++[section]
++[dialog] modal ++[dialog] modal
++++[text] name='The dialog subtree should be the only text content in the accessibility tree. ' ++++[text] name='The dialog subtree should be the only text content in the accessibility tree. '
++++[link] name='Link inside the dialog.' ++++[link] name='Link inside the dialog.'
++++++[text] name='Link inside the dialog.' ++++++[text] name='Link inside the dialog.'
++[section]
rootWebArea rootWebArea
++genericContainer ignored invisible
++++region ignored invisible
++++++popUpButton collapsed ignored invisible value='This should be pruned out of the tree.'
++++button ignored invisible name='Choose File' value='No file chosen'
++genericContainer ignored invisible
++dialog ignored invisible
++genericContainer
++dialog ++dialog
++++staticText name='The dialog subtree should be the only text content in the accessibility tree. ' ++++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. ' ++++++inlineTextBox name='The dialog subtree should be the only text content in the accessibility tree. '
++++link name='Link inside the dialog.' ++++link name='Link inside the dialog.'
++++++staticText name='Link inside the dialog.' ++++++staticText name='Link inside the dialog.'
++++++++inlineTextBox name='Link inside the dialog.' ++++++++inlineTextBox name='Link inside the dialog.'
++genericContainer
AXWebArea AXWebArea
++AXGroup
++AXGroup AXSubrole=AXApplicationDialog ++AXGroup AXSubrole=AXApplicationDialog
++++AXStaticText AXValue='The dialog subtree should be the only text content in the accessibility tree. ' ++++AXStaticText AXValue='The dialog subtree should be the only text content in the accessibility tree. '
++++AXLink AXTitle='Link inside the dialog.' ++++AXLink AXTitle='Link inside the dialog.'
++++++AXStaticText AXValue='Link inside the dialog.' ++++++AXStaticText AXValue='Link inside the dialog.'
++AXGroup
document document
++group
++dialog Window.IsModal=true ++dialog Window.IsModal=true
++++description Name='The dialog subtree should be the only text content in the accessibility tree. ' ++++description Name='The dialog subtree should be the only text content in the accessibility tree. '
++++link Name='Link inside the dialog.' ++++link Name='Link inside the dialog.'
++group
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
++IA2_ROLE_SECTION
++ROLE_SYSTEM_DIALOG IA2_STATE_MODAL ++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_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_LINK name='Link inside the dialog.' FOCUSABLE
++++++ROLE_SYSTEM_STATICTEXT name='Link inside the dialog.' ++++++ROLE_SYSTEM_STATICTEXT name='Link inside the dialog.'
++IA2_ROLE_SECTION
android.webkit.WebView focusable focused scrollable android.webkit.WebView focusable focused scrollable
++android.view.View
++android.app.Dialog role_description='dialog' ++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.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.' ++++android.widget.Button role_description='button' clickable focusable name='This is in the active dialog and should be in the tree.'
++android.view.View
[document web] [document web]
++[section]
++[dialog] modal ++[dialog] modal
++++[text] name='This is the now active dialog. Of course it should be in the tree. ' ++++[text] name='This is the now active dialog. Of course it should be in the tree. '
++++[push button] name='This is in the active dialog and should be in the tree.' ++++[push button] name='This is in the active dialog and should be in the tree.'
++[section]
rootWebArea rootWebArea
++genericContainer ignored invisible
++++region ignored invisible
++++++popUpButton collapsed ignored invisible value='This should be pruned out of the tree.'
++++button ignored invisible name='This button should not be in the tree.'
++genericContainer ignored invisible
++dialog ignored invisible
++genericContainer
++dialog ++dialog
++++staticText name='This is the now active dialog. Of course it should be in the tree. ' ++++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. ' ++++++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.' ++++button name='This is in the active dialog and should be in the tree.'
++genericContainer
AXWebArea AXWebArea
++AXGroup
++AXGroup AXSubrole=AXApplicationDialog ++AXGroup AXSubrole=AXApplicationDialog
++++AXStaticText AXValue='This is the now active dialog. Of course it should be in the tree. ' ++++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.' ++++AXButton AXTitle='This is in the active dialog and should be in the tree.'
++AXGroup
document document
++group
++dialog Window.IsModal=true ++dialog Window.IsModal=true
++++description Name='This is the now active dialog. Of course it should be in the tree. ' ++++description 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.' ++++button Name='This is in the active dialog and should be in the tree.'
++group
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
++IA2_ROLE_SECTION
++ROLE_SYSTEM_DIALOG IA2_STATE_MODAL ++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_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 ++++ROLE_SYSTEM_PUSHBUTTON name='This is in the active dialog and should be in the tree.' FOCUSABLE
++IA2_ROLE_SECTION
...@@ -1211,6 +1211,11 @@ bool AXObject::ComputeAccessibilityIsIgnoredButIncludedInTree() const { ...@@ -1211,6 +1211,11 @@ bool AXObject::ComputeAccessibilityIsIgnoredButIncludedInTree() const {
if (!GetNode()) if (!GetNode())
return false; return false;
// Disallow inert nodes from the tree to ensure the dialog is always the
// first child of the root.
if (GetNode()->IsInert())
return false;
// If the node is part of the user agent shadow dom, or has the explicit // If the node is part of the user agent shadow dom, or has the explicit
// internal Role::kIgnored, they aren't interesting for paragraph navigation // internal Role::kIgnored, they aren't interesting for paragraph navigation
// or LabelledBy/DescribedBy relationships. // or LabelledBy/DescribedBy relationships.
......
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