[FragmentItem] Add NGInlineBackwardCursor
Hit-testing requires traversing siblings in the reverse order, which is not easy for either |NGPaintFragment| nor |NGFragmentItem|. Currently |NGBoxFragmentPainter| copies all siblings to a list and iterate the list in the reverse order. This is not very efficient, but hit-testing is the only user today, and seems to be fast enough. In order to abstract the operation, this patch adds |NGInlineBackwardCursor|. This is a separate class, to avoid increasing stack size for every use of |NGInlineCursor|. We may revisit this if more users appear. Bug: 982194 Change-Id: Ie07564dccbcfc3ff7222392fc6f483c95e0579eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1939152Reviewed-by:Yoshifumi Inoue <yosin@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#719568}
Showing
Please register or sign in to comment