Skip to content

Commit

Permalink
Avoid adding nested pseudo elements twice in a11y tree
Browse files Browse the repository at this point in the history
Some nested pseudo elements can get added twice in the tree,
when their layout parent and DOM parent lead to different AXObjects
that can both add them.

A good solution will pass both of these tests:
All/DumpAccessibilityTreeTest.AccessibilityCSSFirstLetter/blink
external/wpt/accessibility/crashtests/bdo-table-cell.html

This code will go away once legacy layout is completely removed.
See discussion in CL.

Bug: 1314808
Change-Id: I6a993cd3981719240737a79be79afd3b65ca42b5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3591572
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Daniel Libby <dlibby@microsoft.com>
Reviewed-by: Mason Freed <masonf@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#996484}
  • Loading branch information
aleventhal authored and DanielRyanSmith committed Apr 27, 2022
1 parent b6c8672 commit bd96e09
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions accessibility/crashtests/bdo-table-cell.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!doctype html>
<link rel="help" href="https://crbug.com/1314808">
<style>
item:after { display: block; content: open-quote; }
item { display: list-item; }
</style>
<bdo style="direction:rtl">
x<mark></mark>
</bdo>
<span style="display: table-cell; column-width: 0px;"></span>
<script>
const new_listitem_child = document.createElement('item');
document.querySelector('mark').appendChild(new_listitem_child);
</script>


<!--
ax_object.cc(739)] Check failed: child != this. Previous parent still has |this| child:\n
ERR: "\\"ListMarker\\" axid#14 <::marker> needsToUpdateChildren" should be a child of "\\"ListItem\\" axid#12 <item> needsToUpdateChildren" not of "\\"GenericContainer\\" axid#13 <::after> #children=2"\n
-->

0 comments on commit bd96e09

Please sign in to comment.