New issue
Advanced search Search tips

Issue 830956 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Task

Blocking:
issue 771398



Sign in to add a comment

[LayoutNG] Add API for exposing line structure to other components

Project Member Reported by xiaoche...@chromium.org, Apr 9 2018

Issue description

Legacy implementation performs ad hoc DOM/Flat Tree/Layout Tree traversal to understand line structure, which leads to a lot of inconsistency.

In LayoutNG, we should let layout code expose API for exposing line structure for other components.
 
Blocking: 771398
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/207f48ca5f19a9df3153ead0349b278873e7416f

commit 207f48ca5f19a9df3153ead0349b278873e7416f
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu Apr 12 01:47:24 2018

Add a new VisibleUnitsLine unit test

This patch records some InSameLine() call results as a preparation for
implementing NG InSameLine().

Bug: 830956
Change-Id: Ia1a2a9b80363fa20be570638f057ccc8895d7a30
Reviewed-on: https://chromium-review.googlesource.com/1008173
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549997}
[modify] https://crrev.com/207f48ca5f19a9df3153ead0349b278873e7416f/third_party/blink/renderer/core/editing/visible_units_line_test.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Apr 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1adbfdec22e0e18135c47aad3e2b018b8dc26c32

commit 1adbfdec22e0e18135c47aad3e2b018b8dc26c32
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon Apr 16 21:17:30 2018

[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}
[modify] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/blink/renderer/core/editing/ng_flat_tree_shorthands.cc
[modify] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/blink/renderer/core/editing/ng_flat_tree_shorthands.h
[modify] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/blink/renderer/core/editing/visible_units_line.cc
[modify] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/blink/renderer/core/editing/visible_units_line_test.cc
[modify] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/blink/renderer/core/layout/BUILD.gn
[add] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/blink/renderer/core/layout/ng/inline/ng_line_utils.cc
[add] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/blink/renderer/core/layout/ng/inline/ng_line_utils.h

Project Member

Comment 4 by bugdroid1@chromium.org, Apr 17 2018

Labels: merge-merged-testbranch
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1adbfdec22e0e18135c47aad3e2b018b8dc26c32

commit 1adbfdec22e0e18135c47aad3e2b018b8dc26c32
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon Apr 16 21:17:30 2018

[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}
[modify] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/blink/renderer/core/editing/ng_flat_tree_shorthands.cc
[modify] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/blink/renderer/core/editing/ng_flat_tree_shorthands.h
[modify] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/blink/renderer/core/editing/visible_units_line.cc
[modify] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/blink/renderer/core/editing/visible_units_line_test.cc
[modify] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/blink/renderer/core/layout/BUILD.gn
[add] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/blink/renderer/core/layout/ng/inline/ng_line_utils.cc
[add] https://crrev.com/1adbfdec22e0e18135c47aad3e2b018b8dc26c32/third_party/blink/renderer/core/layout/ng/inline/ng_line_utils.h

Comment 5 by e...@chromium.org, Apr 30 2018

Labels: -Pri-1 Pri-2

Sign in to add a comment