Commit d4c6044e authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

The BODY element shouldn't be unignored just because it has a tabindex.

We made a change to the ignored calculation in crrev.com/c/990537 that
ended up making it so that <body tabindex=-1> would no longer be ignored,
but this leads to weird side effects.

Note that in our accessibility tree now, the root "web area" element is
not the same as the HTML BODY element, which is usually ignored. Firefox
seems to treat the BODY as the root of the tree, in comparison. It'd be
interesting to try to fix that, but that'd be a huge change.

Bug: 862100
Change-Id: Ibfa54570bd20205d76cb66f50211431a32704bb2
Reviewed-on: https://chromium-review.googlesource.com/1179075Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585262}
parent e45ca592
...@@ -1003,6 +1003,10 @@ IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityBody) { ...@@ -1003,6 +1003,10 @@ IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityBody) {
RunHtmlTest(FILE_PATH_LITERAL("body.html")); RunHtmlTest(FILE_PATH_LITERAL("body.html"));
} }
IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityBodyTabIndex) {
RunHtmlTest(FILE_PATH_LITERAL("body-tabindex.html"));
}
IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityBoundsInherits) { IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityBoundsInherits) {
RunHtmlTest(FILE_PATH_LITERAL("bounds-inherits.html")); RunHtmlTest(FILE_PATH_LITERAL("bounds-inherits.html"));
} }
......
rootWebArea
++paragraph
++++staticText name='This test is for the body tag with a tabindex'
++++++inlineTextBox name='This test is for the body tag with a tabindex'
<!DOCTYPE html>
<html>
<body tabindex="-1">
<p>This test is for the body tag with a tabindex</p>
</body>
</html>
...@@ -677,7 +677,7 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored( ...@@ -677,7 +677,7 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored(
if (layout_object_->IsBR()) if (layout_object_->IsBR())
return false; return false;
if (CanSetFocusAttribute()) if (CanSetFocusAttribute() && GetNode() && !IsHTMLBodyElement(GetNode()))
return false; return false;
if (IsLink()) if (IsLink())
......
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