Commit a298cdf6 authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Chromium LUCI CQ

Avoid DCHECK() in NextOnLine(), PreviousOnLine()

Avoid "Check failed: false. We don't support iterating over objects
excluded from the accessibility tree." by using
ParentObjectIncludedInTree() while computing
NextOnLine(), PreviousOnLine().

Bug: 1153437
Change-Id: Iebd58d44912dcf9ac20b3e0e618af3e7b7b56b4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2576625Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834692}
parent 157f7d56
...@@ -2122,6 +2122,11 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityNavigation) { ...@@ -2122,6 +2122,11 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityNavigation) {
RunHtmlTest(FILE_PATH_LITERAL("navigation.html")); RunHtmlTest(FILE_PATH_LITERAL("navigation.html"));
} }
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest,
AccessibilityNextOnLineCheckFailure) {
RunCSSTest(FILE_PATH_LITERAL("next-on-line-check-failure.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityNoscript) { IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityNoscript) {
RunHtmlTest(FILE_PATH_LITERAL("noscript.html")); RunHtmlTest(FILE_PATH_LITERAL("noscript.html"));
} }
......
rootWebArea
++genericContainer ignored
++++genericContainer ignored
++++list
++++++staticText name='0'
++++++++inlineTextBox name='0'
<style>
ul::before { content: counter(section); -webkit-column-count: 65536;}
</style>
<script>
function boom() {
let ul = document.createElement('ul');
document.documentElement.appendChild(ul);
}
window.onload = boom;
</script>
...@@ -1086,7 +1086,7 @@ static AXObject* NextOnLineInternalNG(const AXObject& ax_object) { ...@@ -1086,7 +1086,7 @@ static AXObject* NextOnLineInternalNG(const AXObject& ax_object) {
ax_object.AXObjectCache().GetOrCreate(runner_layout_object)) ax_object.AXObjectCache().GetOrCreate(runner_layout_object))
return result; return result;
} }
if (!ax_object.ParentObject()) if (!ax_object.ParentObjectIncludedInTree())
return nullptr; return nullptr;
// Returns next object of parent, since next of |ax_object| isn't appeared on // Returns next object of parent, since next of |ax_object| isn't appeared on
// line. // line.
...@@ -1142,7 +1142,7 @@ AXObject* AXLayoutObject::NextOnLine() const { ...@@ -1142,7 +1142,7 @@ AXObject* AXLayoutObject::NextOnLine() const {
} }
if (!result) { if (!result) {
AXObject* parent = ParentObject(); AXObject* parent = ParentObjectIncludedInTree();
// Our parent object could have been created based on an ignored inline or // Our parent object could have been created based on an ignored inline or
// inline block spanning multiple lines. We need to ensure that we are // inline block spanning multiple lines. We need to ensure that we are
// really at the end of our parent before attempting to connect to the // really at the end of our parent before attempting to connect to the
...@@ -1210,7 +1210,7 @@ static AXObject* PreviousOnLineInlineNG(const AXObject& ax_object) { ...@@ -1210,7 +1210,7 @@ static AXObject* PreviousOnLineInlineNG(const AXObject& ax_object) {
return nullptr; return nullptr;
// Returns previous object of parent, since next of |ax_object| isn't appeared // Returns previous object of parent, since next of |ax_object| isn't appeared
// on line. // on line.
return ax_object.ParentObject()->PreviousOnLine(); return ax_object.ParentObjectIncludedInTree()->PreviousOnLine();
} }
AXObject* AXLayoutObject::PreviousOnLine() const { AXObject* AXLayoutObject::PreviousOnLine() const {
...@@ -1259,7 +1259,7 @@ AXObject* AXLayoutObject::PreviousOnLine() const { ...@@ -1259,7 +1259,7 @@ AXObject* AXLayoutObject::PreviousOnLine() const {
} }
if (!result) { if (!result) {
AXObject* parent = ParentObject(); AXObject* parent = ParentObjectIncludedInTree();
// Our parent object could have been created based on an ignored inline or // Our parent object could have been created based on an ignored inline or
// inline block spanning multiple lines. We need to ensure that we are // inline block spanning multiple lines. We need to ensure that we are
// really at the start of our parent before attempting to connect to the // really at the start of our parent before attempting to connect to the
......
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