[LayoutNG] Implement InSameLine()
This patch implements the LayoutNG version of InSameLine() on top of ComputeNGCaretPosition(): 1. Use ComputeNGCaretPosition() to find the fragment for a position 2. Traverse up from the fragment to obtain line box 3. Compare line boxes to decide if positions are in the same line The implementation is simple in concept but inefficient, since ComputeNGCaretPosition() traverses the whole block flow. Follow up work will optimize ComputeNGCaretPosition() to reduce traversal. Bug: 830956 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng Change-Id: I34a7bc19953bd5995b70afa1b2890d15ef8da744 Reviewed-on: https://chromium-review.googlesource.com/1008631 Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Reviewed-by:Yoichi Osato <yoichio@chromium.org> Reviewed-by:
Koji Ishii <kojii@chromium.org> Reviewed-by:
Yoshifumi Inoue <yosin@chromium.org> Cr-Commit-Position: refs/heads/master@{#551119}
Showing
Please register or sign in to comment