Skip to content

Commit c72c93d

Browse files
aleventhalChromium LUCI CQ
authored and
Chromium LUCI CQ
committed
Revert "Remove unneeded included child code"
Original change: CL:3472799 Reason for revert: https://crbug.com/1300458 > Ever since CL:2946971, AXNodeObject::ChildrenChanged() will only > be called on included nodes. That change improved performance, > because it led to much better de-duping of children changed > events in large subtrees. Bug: None Change-Id: Ic9655af317d6e1c77c32ca5e306ad5b753950c07 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3489308 Auto-Submit: Aaron Leventhal <[email protected]> Reviewed-by: Daniel Libby <[email protected]> Commit-Queue: Daniel Libby <[email protected]> Cr-Commit-Position: refs/heads/main@{#974933}
1 parent 6060e69 commit c72c93d

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

third_party/blink/renderer/modules/accessibility/ax_node_object.cc

+20-3
Original file line numberDiff line numberDiff line change
@@ -4585,9 +4585,26 @@ void AXNodeObject::ChildrenChangedWithCleanLayout() {
45854585
// now layout is clean.
45864586
SetNeedsToUpdateChildren();
45874587

4588-
SANITIZER_CHECK(LastKnownIsIncludedInTreeValue())
4589-
<< "Should only fire children changed on included nodes: "
4590-
<< ToString(true, true);
4588+
// The caller, AXObjectCacheImpl::ChildrenChangedWithCleanLayout(), is only
4589+
// Between the time that AXObjectCacheImpl::ChildrenChanged() determines
4590+
// which included parent to use and now, it's possible that the parent will
4591+
// no longer be ignored. This is rare, but is covered by this test:
4592+
// external/wpt/accessibility/crashtests/delayed-ignored-change.html/
4593+
//
4594+
// If this object is no longer included in the tree, then our parent needs to
4595+
// recompute its included-in-the-tree children vector. (And if our parent
4596+
// isn't included in the tree either, it will recursively update its parent
4597+
// and so on.)
4598+
//
4599+
// The first ancestor that's included in the tree will
4600+
// be the one that actually fires the ChildrenChanged
4601+
// event notification.
4602+
if (!LastKnownIsIncludedInTreeValue()) {
4603+
if (AXObject* ax_parent = CachedParentObject()) {
4604+
ax_parent->ChildrenChangedWithCleanLayout();
4605+
return;
4606+
}
4607+
}
45914608

45924609
// TODO(accessibility) Move this up.
45934610
if (!CanHaveChildren())
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<html class="test-wait">
2+
<style>
3+
body { font-size: x-large; }
4+
.hidden { visibility: hidden; }
5+
</style>
6+
<rb class="hidden">
7+
<textarea></textarea>
8+
</rb>
9+
<script>
10+
document.addEventListener('load', () => {
11+
window.requestIdleCallback(() => {
12+
document.querySelector('style').remove();
13+
document.documentElement.className = '';
14+
});
15+
}, true);
16+
</script>
17+
</html>

0 commit comments

Comments
 (0)