Remove |IsPartOfCulledInlineBox| for hit-testing culled inlines
This patch reverts the heuristic logic for hit-testing culled inlines added in r807114 <crrev.com/c/1127976>. This change makes hit-testing of a small number of really long lines (such as minimized HTML source) faster. The test in crbug.com/128937 improves from 180ms to 40ms. Reverting manually because r807114 has a test, which we don't want to revert. Summarizing the history of changes around hit-test performance of culled inlines: 1. Initially, NG took a different approach than legacy, to traverse fragments and check |LayoutObject| ancestors to find culled inlines. Legacy traverses |LayoutObject| tree. 2. r793989 crrev.com/c/2332083 changed to traverse |LayoutObject| to fix |getBoundingClientRect| performance. 3. r807114 crrev.com/c/1127976 reverted it only for descendant cursors. Hit-testing uses this codepath. This improved the performance for a large number of lines, but sacrificed a small number of really long lines. 4. r815524 crrev.com/c/2463086 added an early return to |NGBoxFragmentPainter::HitTestLineBoxFragment|. This improves NG more than the 3rd fix did, producing the similar performance as legacy both for a large number of lines and for a small number of lines. The 3rd fix still improves when there are many lines. This revert reduces `blink_perf/layout/culled-inline-hittest` from 3ms to 4ms, but: * The 4th fix made it fast enough to not need the improvement. * The sacrifice for a small number of lines is high. * The maintainance cost for |IsPartOfCulledInlineBox| is high. hence reverting the 3rd fix. If this revert causes issues in some other cases, we could bring this logic back in, with stricter conditions (only for a large number of lines). But the numbers look good enough and legacy does not have this heuristic that I don't think this will be needed. Bug: 1128937, 1127976 Change-Id: Ib411cf43727d2ba34a935fde98139a3f34261df6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463026Reviewed-by:Yoshifumi Inoue <yosin@chromium.org> Reviewed-by:
Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#815948}
Showing
Please register or sign in to comment