Re-land: Use PaintInvalidator to optimize AX bounding boxes
Original patch: http://crrev.com/c/2319411 Revert: http://crrev.com/c/2326560 See diff between first and last patchsets. The revert was due to the new DCHECK added in render_accessibility_impl.cc. I carefully debugged all of the failures and there was only one real failure (slider thumbs) which are now fixed with a few lines of code to explicitly invalidate them. The other failures were all false positives - in every case, the bounds of a LayoutObject had changed but the paint invalidation simply hadn't come yet - but it eventually came and all bounding boxes became correct. So I'm just removing the DCHECK. The performance win is great, and we're not seeing any cases where bounds aren't invalidated where they should be. We can revisit if we see failures in the wild. Original description: Previously, any time there was a layout, the accessibility serialization code would scan every AXObject to see if any needed to update their bounding box. Instead, replace this with a mechanism that uses PaintInvalidator to mark AXObjects that might have dirty bounding boxes. Existing tests already provide some coverage; if you comment out the code in paint_invalidator.cc, a handful of browser tests fail. To provide even more coverage, a debug-only check walks the entire tree and ensures that no nodes have incorrect bounding boxes. If you try commenting out the code in paint_invalidator.cc now, hundreds of browser tests fail. This provides some good confidence that it's working correctly. Finally, add a new blink perf test demonstrating a simple scenario where this results in a dramatic speedup, just by focusing links in a document with a few thousand nodes. Bug: 1109081 Change-Id: Ia6bdbbac243c816a613d7b44807c91534b33221e AX-Relnotes: makes accessibility less sluggish on very large web pages Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2333573Reviewed-by:Xianzhu Wang <wangxianzhu@chromium.org> Reviewed-by:
Nektarios Paisios <nektar@chromium.org> Reviewed-by:
Kentaro Hara <haraken@chromium.org> Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org> Cr-Commit-Position: refs/heads/master@{#795148}
Showing
Please register or sign in to comment