New issue
Advanced search Search tips

Issue 822575 link

Starred by 1 user

Issue metadata

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

Blocking:
issue 811502



Sign in to add a comment

[LayoutNG] Implement LocalCaretRectOfPosition()

Project Member Reported by xiaoche...@chromium.org, Mar 16 2018

Issue description

This is the tracking bug for implementation of LocalCaretRectOfPosition() for LayoutNG.
 
Blocking: 811502
Project Member

Comment 2 by bugdroid1@chromium.org, Mar 19 2018

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

commit 6390f257d52c6a55dee057d4e30f1da6ee0cf454
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon Mar 19 03:50:29 2018

Add BiDi-related test cases to LocalCaretRectTest

This patch adds test cases of LocalCaretRectOfPosition() for
positions at BiDi boundaries but not logical line boundaries.

Test cases are named in format:

In{BlockDir}Block{BaseRunDir}BaseRun{Side}{NestedRun}{Deep}

- BlockDir: Direction of containing block, either 'Ltr' or 'Rtl'
- BaseRunDir: Direction of the lowest BiDi level in the block,
  either 'Ltr' or 'Rtl'
- Side: Location of caret, either 'Before' or 'After' a nested
  BiDi run
- NestedRun: Information of nested BiDi run(s) at the caret location.
- Deep: Whether the caret position in DOM is affiliated to the inner
  most text node (i.e., 'Deep') or not

See https://goo.gl/fV2sSN for more details about test generation.

Bug: 822575
Change-Id: I171c17ace0ca38ef051db7a5c6ab14cc870be009
Reviewed-on: https://chromium-review.googlesource.com/965882
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543966}
[modify] https://crrev.com/6390f257d52c6a55dee057d4e30f1da6ee0cf454/third_party/WebKit/Source/core/editing/BUILD.gn
[add] https://crrev.com/6390f257d52c6a55dee057d4e30f1da6ee0cf454/third_party/WebKit/Source/core/editing/LocalCaretRectBiDiTest.cpp

Project Member

Comment 3 by bugdroid1@chromium.org, Mar 20 2018

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

commit b4e88ba3334b5b2cc4acecb3920b869c0820257e
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Mar 20 05:00:55 2018

At BiDi test cases for LocalCaretRect at line boundaries

This is a sibling patch of crrev.com/c/965882, adding script-generated
test cases of LocalCaretRect in bidirectional text at line logical
boundaries.

Test cases are named in format:

In{Ltr,Rtl}BlockLine{Begin,End}{NestedRunInfo}

where NestedRunInfo indicates the number of nested runs at the
caret position, and the direction of the lowest level in these
runs.

See https://goo.gl/fV2sSN for more details about test generation.

Bug: 822575
Change-Id: I34b3633ee8fe62ab4f7c7dacf4b96d19f0d72879
Reviewed-on: https://chromium-review.googlesource.com/969886
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544287}
[modify] https://crrev.com/b4e88ba3334b5b2cc4acecb3920b869c0820257e/third_party/WebKit/Source/core/editing/LocalCaretRectBiDiTest.cpp

Project Member

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

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

commit 118ff98495eb9141fde213b7782d6bd500a4afc2
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri Apr 06 05:44:02 2018

Refactor AdjustInlineBoxPositionForPrimaryDirection to make it symmetric

This patch refactors the function by wrapping certain logic into
IsEndOfDifferentDirection(), so that the remaining function body is
symmetric for left and right edge of |inline_box|.

This allows further refactoring, and also eases implementation of NG
version of bidi adjustment.

Bug: 822575
Change-Id: I40874a50fd07592d42afe6f596bc3481b41b9932
Reviewed-on: https://chromium-review.googlesource.com/997135
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548686}
[modify] https://crrev.com/118ff98495eb9141fde213b7782d6bd500a4afc2/third_party/WebKit/Source/core/editing/InlineBoxPosition.cpp

Project Member

Comment 5 by bugdroid1@chromium.org, Apr 6 2018

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

commit eff9809b3b5f70aa6e0f9a90b9996f87655a28e2
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri Apr 06 06:19:07 2018

DCHECK validity of |caret_offset| in AdjustInlineBoxPositionForTextDirectionInternal()

The function accepts |caret_offset| at either left or right edge of
|inline_box|. This patch adds DCHECKs to ensure it.

Bug: 822575
Change-Id: I247361097f37f0cd9922442ea8c050f88136d9fc
Reviewed-on: https://chromium-review.googlesource.com/999021
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548695}
[modify] https://crrev.com/eff9809b3b5f70aa6e0f9a90b9996f87655a28e2/third_party/WebKit/Source/core/editing/InlineBoxPosition.cpp

Project Member

Comment 6 by bugdroid1@chromium.org, Apr 6 2018

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

commit 099a01702350aafe8525b28b58d7e74359fafaba
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri Apr 06 21:08:54 2018

Reduce usage of |caret_offset| in AdjustInlineBoxPositionForTextDirectionInternal

This is a requested change from crrev.com/c/997134.

With usage of |caret_offset| reduced, it makes the refactoring in
crrev.com/c/997134 more intuitive.

Bug: 822575
Change-Id: Idebc62ed65859fc1eecbb09b8f7c33eeefd82364
Reviewed-on: https://chromium-review.googlesource.com/999004
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548928}
[modify] https://crrev.com/099a01702350aafe8525b28b58d7e74359fafaba/third_party/WebKit/Source/core/editing/InlineBoxPosition.cpp

Project Member

Comment 7 by bugdroid1@chromium.org, Apr 11 2018

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

commit 41e59c50625a032d1764a917f62f194fbb409e26
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed Apr 11 04:45:28 2018

[LayoutNG] Introduce NGPaintFragmentTraversal::PreviousLineOf()

This patch adds a utility function to obtain the paint fragment of the
previous line of a line box.

It is a preparation patch for crrev.com/c/1000952

Bug: 822575
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I28f7d01ed0da28e5691c77cda12d2b19ca3244e4
Reviewed-on: https://chromium-review.googlesource.com/1005892
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549763}
[modify] https://crrev.com/41e59c50625a032d1764a917f62f194fbb409e26/third_party/blink/renderer/core/BUILD.gn
[modify] https://crrev.com/41e59c50625a032d1764a917f62f194fbb409e26/third_party/blink/renderer/core/paint/ng/ng_paint_fragment_traversal.cc
[modify] https://crrev.com/41e59c50625a032d1764a917f62f194fbb409e26/third_party/blink/renderer/core/paint/ng/ng_paint_fragment_traversal.h
[add] https://crrev.com/41e59c50625a032d1764a917f62f194fbb409e26/third_party/blink/renderer/core/paint/ng/ng_paint_fragment_traversal_test.cc

Project Member

Comment 8 by bugdroid1@chromium.org, Apr 11 2018

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

commit d3690e57e891e436d0ed44b8cdda25c078c4df3b
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed Apr 11 18:01:52 2018

[LayoutNG] Introduce NGPaintFragmentTraversal::InlineDescendantsOf()

This patch adds a utility function to obtain the inline descendants
of a paint fragment.

It is a preparation patch for crrev.com/c/1000952

Bug: 822575
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Id5fcb927a3621607708637984e414f30b50f6d88
Reviewed-on: https://chromium-review.googlesource.com/1006059
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549930}
[modify] https://crrev.com/d3690e57e891e436d0ed44b8cdda25c078c4df3b/third_party/blink/renderer/core/paint/ng/ng_paint_fragment_traversal.cc
[modify] https://crrev.com/d3690e57e891e436d0ed44b8cdda25c078c4df3b/third_party/blink/renderer/core/paint/ng/ng_paint_fragment_traversal.h
[modify] https://crrev.com/d3690e57e891e436d0ed44b8cdda25c078c4df3b/third_party/blink/renderer/core/paint/ng/ng_paint_fragment_traversal_test.cc

Project Member

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

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

commit 15d6d41fca7ea9729497a51ee33f2c45b3f76123
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu Apr 12 09:27:27 2018

[LayoutNG] Rewrite ng_caret_rect.cc on top of NGPaintFragment

This patch rewrites the NG implementation of LocalCaretRectOfPosition()
on top of NGPaintFragment instead of NGPhysicalFragment. Since paint
fragments store parent pointers but physical fragments don't, this patch
utilizes parent pointers to stop keeping track of line boxes for each
inline fragment, which simplifies the implementation.

As a side product, this patch also removes a non-self-contained member
function NGPhysicalLineBoxFragment::HasSoftWrapFromPreviousLine().

Bug: 822575
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: Idfd2af884a1933daa1d2bac265d51757949cbb14
Reviewed-on: https://chromium-review.googlesource.com/1000952
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550110}
[modify] https://crrev.com/15d6d41fca7ea9729497a51ee33f2c45b3f76123/third_party/blink/renderer/core/layout/ng/inline/ng_caret_rect.cc
[modify] https://crrev.com/15d6d41fca7ea9729497a51ee33f2c45b3f76123/third_party/blink/renderer/core/layout/ng/inline/ng_caret_rect.h
[modify] https://crrev.com/15d6d41fca7ea9729497a51ee33f2c45b3f76123/third_party/blink/renderer/core/layout/ng/inline/ng_caret_rect_test.cc

Project Member

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

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

commit 5651e5838c817d4c6f8a0f8145c6386d5c9f1242
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu Apr 12 16:44:11 2018

[LayoutNG] Remove an unused member function of NGPhysicalLineBoxFragment

The function is unused after crrev.com/c/1000952. It's also a bad-designed
function due to the requirement of a seemingly redundant parameter.

Hence, this patch removes it.

Bug: 822575
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Iefdc4a9f6cde0d8f5edfc6d4c75750b1655f6c39
Reviewed-on: https://chromium-review.googlesource.com/1007973
Reviewed-by: Aleks Totic <atotic@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550241}
[modify] https://crrev.com/5651e5838c817d4c6f8a0f8145c6386d5c9f1242/third_party/blink/renderer/core/layout/ng/inline/ng_physical_line_box_fragment.cc
[modify] https://crrev.com/5651e5838c817d4c6f8a0f8145c6386d5c9f1242/third_party/blink/renderer/core/layout/ng/inline/ng_physical_line_box_fragment.h

Project Member

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

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

commit 0720948fb85788d6c5f7a5cabeadae753113d05d
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon Apr 16 20:55:04 2018

[LayoutNG] Refactor ng_caret_rect.h/cc

This patch refactors functions in ng_caret_rect.h/cc so that:

1. Functions stop passing around the containing NG inline formatting context.

2. Part of ComputeNGLocalCaretRect() is wrapped into a new overload of
   ComputeNGCaretPosition() taking PositionWithAffinity parameter.

This is a preparation patch for implementing NG line-related functions
in crrev.com/c/1008631

Bug: 822575
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I9ee8d90b327fec9684c0bdbf52bee6dad6fafb7f
Reviewed-on: https://chromium-review.googlesource.com/1011217
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551109}
[modify] https://crrev.com/0720948fb85788d6c5f7a5cabeadae753113d05d/third_party/blink/renderer/core/editing/local_caret_rect.cc
[modify] https://crrev.com/0720948fb85788d6c5f7a5cabeadae753113d05d/third_party/blink/renderer/core/editing/ng_flat_tree_shorthands.cc
[modify] https://crrev.com/0720948fb85788d6c5f7a5cabeadae753113d05d/third_party/blink/renderer/core/editing/ng_flat_tree_shorthands.h
[modify] https://crrev.com/0720948fb85788d6c5f7a5cabeadae753113d05d/third_party/blink/renderer/core/layout/ng/inline/ng_caret_rect.cc
[modify] https://crrev.com/0720948fb85788d6c5f7a5cabeadae753113d05d/third_party/blink/renderer/core/layout/ng/inline/ng_caret_rect.h

Project Member

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

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

commit 8230fc83f6b1821ed40005c5728d87dc73413d97
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Apr 17 04:45:02 2018

Unify left and right edge algorithms in AdjustInlineBoxPositionForPrimaryDirection

The above mentioned function is symmetric when adjusting left and right
edge of an inline box.

This patch enforces the symmetry by unifying the algorithms with a
template. It is also preparation for crrev.com/c/997134.

Bug: 822575
Change-Id: Iacb6a77c3e43c598d2405d7f859e5f619e138a0b
Reviewed-on: https://chromium-review.googlesource.com/1013059
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551240}
[modify] https://crrev.com/8230fc83f6b1821ed40005c5728d87dc73413d97/third_party/blink/renderer/core/editing/inline_box_position.cc

Project Member

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

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

commit 6cd9f0d1c04b34f2cab5e08bbcfa8adca2c9d398
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Apr 17 05:07:13 2018

[LayoutNG] Split ng_caret_position.h/cc off ng_caret_rect.h/cc

The current ng_caret_rect.h/cc contains two different parts:
1. Computation of NGCaretPosition
2. Conversion from NGCaretPosition to LocalCaretRect

The two parts are very different that, NGCaretPosition is a building
block of other Layout NG components (e.g., ng_line_utils), while
LocalCaretRect is only passed to legacy.

For better code health, this patch splits them into different files.

Bug: 822575
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I1dbc1b683d54c2f066cf84c21e7388bb07f8e3f1
Reviewed-on: https://chromium-review.googlesource.com/1014800
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551249}
[modify] https://crrev.com/6cd9f0d1c04b34f2cab5e08bbcfa8adca2c9d398/third_party/blink/renderer/core/BUILD.gn
[modify] https://crrev.com/6cd9f0d1c04b34f2cab5e08bbcfa8adca2c9d398/third_party/blink/renderer/core/layout/BUILD.gn
[add] https://crrev.com/6cd9f0d1c04b34f2cab5e08bbcfa8adca2c9d398/third_party/blink/renderer/core/layout/ng/inline/ng_caret_position.cc
[add] https://crrev.com/6cd9f0d1c04b34f2cab5e08bbcfa8adca2c9d398/third_party/blink/renderer/core/layout/ng/inline/ng_caret_position.h
[rename] https://crrev.com/6cd9f0d1c04b34f2cab5e08bbcfa8adca2c9d398/third_party/blink/renderer/core/layout/ng/inline/ng_caret_position_test.cc
[modify] https://crrev.com/6cd9f0d1c04b34f2cab5e08bbcfa8adca2c9d398/third_party/blink/renderer/core/layout/ng/inline/ng_caret_rect.cc
[modify] https://crrev.com/6cd9f0d1c04b34f2cab5e08bbcfa8adca2c9d398/third_party/blink/renderer/core/layout/ng/inline/ng_caret_rect.h
[modify] https://crrev.com/6cd9f0d1c04b34f2cab5e08bbcfa8adca2c9d398/third_party/blink/renderer/core/layout/ng/inline/ng_line_utils.cc

Project Member

Comment 14 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/+/5651e5838c817d4c6f8a0f8145c6386d5c9f1242

commit 5651e5838c817d4c6f8a0f8145c6386d5c9f1242
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu Apr 12 16:44:11 2018

[LayoutNG] Remove an unused member function of NGPhysicalLineBoxFragment

The function is unused after crrev.com/c/1000952. It's also a bad-designed
function due to the requirement of a seemingly redundant parameter.

Hence, this patch removes it.

Bug: 822575
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Iefdc4a9f6cde0d8f5edfc6d4c75750b1655f6c39
Reviewed-on: https://chromium-review.googlesource.com/1007973
Reviewed-by: Aleks Totic <atotic@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550241}
[modify] https://crrev.com/5651e5838c817d4c6f8a0f8145c6386d5c9f1242/third_party/blink/renderer/core/layout/ng/inline/ng_physical_line_box_fragment.cc
[modify] https://crrev.com/5651e5838c817d4c6f8a0f8145c6386d5c9f1242/third_party/blink/renderer/core/layout/ng/inline/ng_physical_line_box_fragment.h

Project Member

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

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

commit 0720948fb85788d6c5f7a5cabeadae753113d05d
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon Apr 16 20:55:04 2018

[LayoutNG] Refactor ng_caret_rect.h/cc

This patch refactors functions in ng_caret_rect.h/cc so that:

1. Functions stop passing around the containing NG inline formatting context.

2. Part of ComputeNGLocalCaretRect() is wrapped into a new overload of
   ComputeNGCaretPosition() taking PositionWithAffinity parameter.

This is a preparation patch for implementing NG line-related functions
in crrev.com/c/1008631

Bug: 822575
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I9ee8d90b327fec9684c0bdbf52bee6dad6fafb7f
Reviewed-on: https://chromium-review.googlesource.com/1011217
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551109}
[modify] https://crrev.com/0720948fb85788d6c5f7a5cabeadae753113d05d/third_party/blink/renderer/core/editing/local_caret_rect.cc
[modify] https://crrev.com/0720948fb85788d6c5f7a5cabeadae753113d05d/third_party/blink/renderer/core/editing/ng_flat_tree_shorthands.cc
[modify] https://crrev.com/0720948fb85788d6c5f7a5cabeadae753113d05d/third_party/blink/renderer/core/editing/ng_flat_tree_shorthands.h
[modify] https://crrev.com/0720948fb85788d6c5f7a5cabeadae753113d05d/third_party/blink/renderer/core/layout/ng/inline/ng_caret_rect.cc
[modify] https://crrev.com/0720948fb85788d6c5f7a5cabeadae753113d05d/third_party/blink/renderer/core/layout/ng/inline/ng_caret_rect.h

Project Member

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

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

commit cfaac651097ce436c12a0e56de3e7c6995908e05
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Apr 17 19:21:54 2018

Deduplicate code in AdjustInlineBoxPositionForTextDirection() with templates

This patch deduplicates code in the function to improve code health,
and also as a preparation for implementing NG version of bidi adjustment.

Bug: 822575
Change-Id: Ia975338ff11d2e53d73f084e4b55419b03c2938c
Reviewed-on: https://chromium-review.googlesource.com/997134
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551429}
[modify] https://crrev.com/cfaac651097ce436c12a0e56de3e7c6995908e05/third_party/blink/renderer/core/editing/inline_box_position.cc

Project Member

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

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

commit 947ca03495f4dcf9606f66bbedd2e0c7c30c55a7
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Apr 17 23:53:56 2018

[LayoutNG] Fix coordinate space of NG LocalCaretRect() in vertical-rl

LocalCaretRect should use the "flipped blocks" coordinate space for
vertical-rl writing mode. This patch applies that in the NG implementation.

Note: this patch only changes behavior for text-anchored carets. When
caret is anchored to atomic inline, there is no reference as the legacy
behavior is broken, and LocalCaretRect is consumed by legacy.

Bug: 822575
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I4019f560f8410ef14c7d52312d7fc1de8db6ee28
Reviewed-on: https://chromium-review.googlesource.com/1011296
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551528}
[modify] https://crrev.com/947ca03495f4dcf9606f66bbedd2e0c7c30c55a7/third_party/blink/renderer/core/editing/local_caret_rect_test.cc
[modify] https://crrev.com/947ca03495f4dcf9606f66bbedd2e0c7c30c55a7/third_party/blink/renderer/core/layout/ng/inline/ng_caret_rect.cc

Project Member

Comment 18 by bugdroid1@chromium.org, Apr 24 2018

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

commit 834d7bb7dca054e348c9e43933c15cdc10313677
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Apr 24 04:10:58 2018

Stop using RenderedPosition in SelectionModifierWord

SelectionMofidierWord uses RenderedPosition instances without using
the bidi-related functionalities.

Since RenderedPosition is a wrapper of InlineBoxPosition with bidi
utility functions added, this patch changes SelectionModifierWord to
use InlineBoxPosition directly for simplicity.

Bug: 822575
Change-Id: I96d7294814e425fc17ae9d774b68019dca974400
Reviewed-on: https://chromium-review.googlesource.com/1025021
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552992}
[modify] https://crrev.com/834d7bb7dca054e348c9e43933c15cdc10313677/third_party/blink/renderer/core/editing/selection_modifier_word.cc

Project Member

Comment 19 by bugdroid1@chromium.org, Apr 24 2018

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

commit 67598c39201f9ee1282953dd0deec0adf336a7fd
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Apr 24 04:33:19 2018

Stop calling LayoutObjectFromPosition in RenderedPosition

LayoutObjectFromPosition() is a hacky utility function to set
|RenderedPosition::layout_object_| when |inline_box_| is nullptr.

With previous refactoring, there is no usage of |layout_object_| when
|inline_box_| is nullptr, so we no longer need to set a non-null
|layout_object_| for null |inline_box_|.

Hence, this patch removes the call sites in RenderedPosition.

Note: the function cannot be removed because it is still indirectly
called by AX via LayoutObjectContainsPosition(). A follow-up patch
will move it to AX.

Bug: 822575
Change-Id: I720193c9926212153c56552115b5be9619ea20bc
Reviewed-on: https://chromium-review.googlesource.com/1025034
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552996}
[modify] https://crrev.com/67598c39201f9ee1282953dd0deec0adf336a7fd/third_party/blink/renderer/core/editing/rendered_position.cc

Project Member

Comment 20 by bugdroid1@chromium.org, Apr 24 2018

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

commit 85d8d125def54d5c6ce28fec310f8cf5738caf48
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Apr 24 05:42:19 2018

Stop using RenderedPosition in VisibleUnitsLine

VisibleUnitsLine uses RenderedPosition instances without using
the bidi-related functionalities.

Since RenderedPosition is a wrapper of InlineBoxPosition with bidi
utility functions added, this patch changes VisibleUnitsLine to
use InlineBoxPosition directly for simplicity.

Bug: 822575
Change-Id: I158ddfb3dec1ead3f8b66e1255f3465f3f0353a2
Reviewed-on: https://chromium-review.googlesource.com/1024645
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553008}
[modify] https://crrev.com/85d8d125def54d5c6ce28fec310f8cf5738caf48/third_party/blink/renderer/core/editing/visible_units_line.cc

Project Member

Comment 21 by bugdroid1@chromium.org, Apr 26 2018

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

commit b5b7d92d7ca5bb8115af1ab601003fc2f543585e
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu Apr 26 07:09:21 2018

Remove redundant member RenderedPosition::layout_object_

The member is always equal to:

LineLayoutAPIShim::LayoutObjectFrom(inline_box_->GetLineLayoutItem())

Hence, this patch removes it for better code health.

Bug: 822575
Change-Id: Ib9c231daa8658aa2b9212e9754bd50c76b0affbc
Reviewed-on: https://chromium-review.googlesource.com/1026643
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553939}
[modify] https://crrev.com/b5b7d92d7ca5bb8115af1ab601003fc2f543585e/third_party/blink/renderer/core/editing/rendered_position.cc
[modify] https://crrev.com/b5b7d92d7ca5bb8115af1ab601003fc2f543585e/third_party/blink/renderer/core/editing/rendered_position.h

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

Labels: -Pri-1 Pri-2
Project Member

Comment 23 by bugdroid1@chromium.org, May 2 2018

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

commit 5c695f2f530bc1bd6d31f4a491ec6fe4d8bfb96e
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed May 02 22:46:21 2018

Introduce Character::IsBidiControl()

This patch introduces a utility function to check if a unicode character
is a bidi control character defined in UAX9:

http://unicode.org/reports/tr9/#Directional_Formatting_Characters

This is also preparation for crrev.com/c/1039145

Bug: 822575
Change-Id: I6a011f7fc871c3508c811c41cb21208139fa71cd
Reviewed-on: https://chromium-review.googlesource.com/1040648
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555588}
[modify] https://crrev.com/5c695f2f530bc1bd6d31f4a491ec6fe4d8bfb96e/third_party/blink/renderer/platform/text/character.cc
[modify] https://crrev.com/5c695f2f530bc1bd6d31f4a491ec6fe4d8bfb96e/third_party/blink/renderer/platform/text/character.h
[modify] https://crrev.com/5c695f2f530bc1bd6d31f4a491ec6fe4d8bfb96e/third_party/blink/renderer/platform/text/character_property.h
[modify] https://crrev.com/5c695f2f530bc1bd6d31f4a491ec6fe4d8bfb96e/third_party/blink/renderer/platform/text/character_property_data_generator.cc
[modify] https://crrev.com/5c695f2f530bc1bd6d31f4a491ec6fe4d8bfb96e/third_party/blink/renderer/platform/text/character_property_data_generator.h
[modify] https://crrev.com/5c695f2f530bc1bd6d31f4a491ec6fe4d8bfb96e/third_party/blink/renderer/platform/text/character_test.cc

Project Member

Comment 24 by bugdroid1@chromium.org, May 3 2018

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

commit 7442d6e4e1f40aed18c17dcd8f480e922ce1e56a
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu May 03 06:18:02 2018

Revert "Stop using RenderedPosition in VisibleUnitsLine"

This reverts commit 85d8d125def54d5c6ce28fec310f8cf5738caf48.

Reason for revert: causing  crbug.com/838075 

Original change's description:
> Stop using RenderedPosition in VisibleUnitsLine
> 
> VisibleUnitsLine uses RenderedPosition instances without using
> the bidi-related functionalities.
> 
> Since RenderedPosition is a wrapper of InlineBoxPosition with bidi
> utility functions added, this patch changes VisibleUnitsLine to
> use InlineBoxPosition directly for simplicity.
> 
> Bug: 822575
> Change-Id: I158ddfb3dec1ead3f8b66e1255f3465f3f0353a2
> Reviewed-on: https://chromium-review.googlesource.com/1024645
> Reviewed-by: Yoichi Osato <yoichio@chromium.org>
> Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#553008}

TBR=yosin@chromium.org,yoichio@chromium.org,xiaochengh@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 822575,  838075 
Change-Id: Ifa8429f7749d5c6bdb6dda3f2ed3471c523756ce
Reviewed-on: https://chromium-review.googlesource.com/1040611
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555673}
[modify] https://crrev.com/7442d6e4e1f40aed18c17dcd8f480e922ce1e56a/third_party/blink/renderer/core/editing/visible_units_line.cc

Project Member

Comment 25 by bugdroid1@chromium.org, May 4 2018

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

commit 05a08534ab89dd1179b68dc0bfd13ea8c74764c3
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri May 04 00:07:24 2018

Reland "Stop using RenderedPosition in VisibleUnitsLine"

This is a reland of 85d8d125def54d5c6ce28fec310f8cf5738caf48

Original change's description:
> Stop using RenderedPosition in VisibleUnitsLine
>
> VisibleUnitsLine uses RenderedPosition instances without using
> the bidi-related functionalities.
>
> Since RenderedPosition is a wrapper of InlineBoxPosition with bidi
> utility functions added, this patch changes VisibleUnitsLine to
> use InlineBoxPosition directly for simplicity.
>
> Bug: 822575
> Change-Id: I158ddfb3dec1ead3f8b66e1255f3465f3f0353a2
> Reviewed-on: https://chromium-review.googlesource.com/1024645
> Reviewed-by: Yoichi Osato <yoichio@chromium.org>
> Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#553008}

Tbr: yosin@chromium.org, yoichio@chromium.org
Bug: 822575
Change-Id: I1fd854234f2c9265a758578023e07e220e63b86a
Reviewed-on: https://chromium-review.googlesource.com/1042615
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555917}
[modify] https://crrev.com/05a08534ab89dd1179b68dc0bfd13ea8c74764c3/third_party/blink/renderer/core/editing/visible_units_line.cc

Project Member

Comment 26 by bugdroid1@chromium.org, May 7 2018

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

commit d1ecd3d3fe418a5e285bdc646b45f22d8059f9c8
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon May 07 20:10:37 2018

[LayoutNG] Skip bidi formatting characters when computing caret positions

An inline formatting context may contain bidi formatting characters in
its |text_content_| string, but never generate text fragments for
them (*). Therefore, bidi formatting characters do not introduce new
caret positions, and should be ignored when computing caret positions.

Therefore, if the passed text offset is outside a text fragment, but
is only separated by bidi formatting characters, the offset should be
considered as inside the fragment. This patch adds such handling.

(*) Not exactly. If there's a text node containing bidi formatting
characters, we currently generate text fragments containing both bidi
formatting characters and normal text.

Bug: 822575
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I4b6bbfa9db455d21f0ace2c32d1f876cbd0655a9
Reviewed-on: https://chromium-review.googlesource.com/1039145
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556545}
[modify] https://crrev.com/d1ecd3d3fe418a5e285bdc646b45f22d8059f9c8/third_party/blink/renderer/core/editing/local_caret_rect_test.cc
[modify] https://crrev.com/d1ecd3d3fe418a5e285bdc646b45f22d8059f9c8/third_party/blink/renderer/core/layout/ng/inline/ng_caret_position.cc
[modify] https://crrev.com/d1ecd3d3fe418a5e285bdc646b45f22d8059f9c8/third_party/blink/renderer/core/layout/ng/inline/ng_offset_mapping.cc
[modify] https://crrev.com/d1ecd3d3fe418a5e285bdc646b45f22d8059f9c8/third_party/blink/renderer/core/layout/ng/inline/ng_offset_mapping.h

Project Member

Comment 27 by bugdroid1@chromium.org, May 8 2018

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

commit ae85143fd0910171680646dc97feafe20f7de19e
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue May 08 03:23:43 2018

Make InlineBoxTraversal return const pointers and/or references

InlineBoxTraversal is not supposed to alter the layout tree, so its
member functions should return const pointers.

Some member functions always return non-null values, so their return
types are changed to const references to beffer clarity.

This is also a preparation patch for crrev.com/c/1038058, splitting off
some of its trivial changes to reduce the size of the big patch.

Bug: 822575
Change-Id: I9c32814a88d42e9115be97425b0e0015c4d1779d
Reviewed-on: https://chromium-review.googlesource.com/1048785
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556674}
[modify] https://crrev.com/ae85143fd0910171680646dc97feafe20f7de19e/third_party/blink/renderer/core/editing/inline_box_position.cc
[modify] https://crrev.com/ae85143fd0910171680646dc97feafe20f7de19e/third_party/blink/renderer/core/editing/inline_box_traversal.cc
[modify] https://crrev.com/ae85143fd0910171680646dc97feafe20f7de19e/third_party/blink/renderer/core/editing/inline_box_traversal.h
[modify] https://crrev.com/ae85143fd0910171680646dc97feafe20f7de19e/third_party/blink/renderer/core/editing/rendered_position.cc
[modify] https://crrev.com/ae85143fd0910171680646dc97feafe20f7de19e/third_party/blink/renderer/core/editing/selection_modifier_character.cc
[modify] https://crrev.com/ae85143fd0910171680646dc97feafe20f7de19e/third_party/blink/renderer/core/layout/layout_text.cc

Project Member

Comment 28 by bugdroid1@chromium.org, May 15 2018

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

commit 345274f33b36aaf28654655e197a309a586f9a26
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue May 15 00:20:43 2018

[LayoutNG] Introduce NGPhysicalFragment::ResolvedDirection()

This patch introduces NGPhysicalFragment::ResolvedDirection() for text
and atomic inline fragments to obtain the resolved direction in bidi
inline layout (which can be different from CSS 'direction' property).

This patch is split from crrev.com/c/1038058 and has LGTM there. It is
a preparation for the following patches:
- crrev.com/c/1038058: bidi adjustment for caret position computation
- crrev.com/c/1056395: fix caret rect on atomic inlines in bidi text
- crrev.com/c/1056029: fix hit testing on atomic inlines in bidi text

Bug: 811502, 822575
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I1e5fa1817ff987264181547d05e10774ff286fe5
Reviewed-on: https://chromium-review.googlesource.com/1058085
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558545}
[modify] https://crrev.com/345274f33b36aaf28654655e197a309a586f9a26/third_party/blink/renderer/core/layout/ng/inline/ng_physical_text_fragment.cc
[modify] https://crrev.com/345274f33b36aaf28654655e197a309a586f9a26/third_party/blink/renderer/core/layout/ng/inline/ng_physical_text_fragment.h
[modify] https://crrev.com/345274f33b36aaf28654655e197a309a586f9a26/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc
[modify] https://crrev.com/345274f33b36aaf28654655e197a309a586f9a26/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h
[modify] https://crrev.com/345274f33b36aaf28654655e197a309a586f9a26/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.cc
[modify] https://crrev.com/345274f33b36aaf28654655e197a309a586f9a26/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h

Project Member

Comment 29 by bugdroid1@chromium.org, May 15 2018

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

commit 59b99a67a59e5a0731c3e87fed2ccd7d01968bd7
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue May 15 04:43:41 2018

[LayoutNG] Compute caret rect at the correct side of atomic inline in bidi text

When computing caret rect for a caret position before/after an atomic inline
box, whether the caret rect is to the left or right of the box depends on the
resolved direction of the atomic inline, not the CSS 'direction' property.

This patch changes the implementation to check the resolved direction.

Bug: 822575
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ibc09e6679faf94ad7882bfba7560d44fd36fd7d8
Reviewed-on: https://chromium-review.googlesource.com/1056395
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558612}
[modify] https://crrev.com/59b99a67a59e5a0731c3e87fed2ccd7d01968bd7/third_party/blink/renderer/core/editing/local_caret_rect_test.cc
[modify] https://crrev.com/59b99a67a59e5a0731c3e87fed2ccd7d01968bd7/third_party/blink/renderer/core/layout/ng/inline/ng_caret_rect.cc

Project Member

Comment 30 by bugdroid1@chromium.org, May 16 2018

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

commit 452d92b664ef3b621434870b3e94ae7e9e0943af
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed May 16 21:17:15 2018

Merge AdjustInlineBoxPositionForTextDirection() into inline_box_traversal.cc

This patch merges the template function into inline_box_traversal.cc
to reuse the left and right traversal strategies defined there, and also
hide implementation details of bidi adjustment

This is also a preparation for implementing NG bidi implementation by
generalizing existing code: crrev.com/c/1038058

Bug: 822575
Change-Id: Ie64f005b3e5f510cf3664000ecb5fd5d157b6bac
Reviewed-on: https://chromium-review.googlesource.com/1048974
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559290}
[modify] https://crrev.com/452d92b664ef3b621434870b3e94ae7e9e0943af/third_party/blink/renderer/core/editing/inline_box_position.cc
[modify] https://crrev.com/452d92b664ef3b621434870b3e94ae7e9e0943af/third_party/blink/renderer/core/editing/inline_box_traversal.cc
[modify] https://crrev.com/452d92b664ef3b621434870b3e94ae7e9e0943af/third_party/blink/renderer/core/editing/inline_box_traversal.h

Project Member

Comment 31 by bugdroid1@chromium.org, May 17 2018

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

commit 1dcf382f2a8deff5a8e7a35de55149c52b6709ba
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu May 17 20:51:58 2018

[LayoutNG] Generalize legacy bidi adjustment code for NG caret position calculation

This patch generalizes legacy bidi adjustment code in inline_box_traversal.cc and
applies it to LayoutNG caret position calculation.

Details:

1. paint/ng/ng_paint_fragment_traversal.h/cc:
 - Added a (parent, index) struct to represent an NGPaintFragment, allowing fast
   previous/next sibling operations.
 - Added traversal functions for inline NGPaintFragments using the above struct.

2. editing/inline_box_traversal.cc:
 - Defines AbstractInlineBox class, abstracting similarities between InlineBox and
   inline NGPaintFragment.
 - Defines AbstractInlineBoxAndSideAffinity struct to represent a caret position at
   the left or right side of a leaf InlineBox or inline NGPaintFragment
 - Generalizes existing bidi adjustment algorithm on AbstractInlineBox

3. Adds an NG override for BidiAdjustment::AdjustForCaretPositionResolution(), and
   applies it in NG caret position calculation code.

Bug: 822575
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_layout_ng;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I34b0681f0485484e97ba9089e1f39b7207185592
Reviewed-on: https://chromium-review.googlesource.com/1062712
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559667}
[modify] https://crrev.com/1dcf382f2a8deff5a8e7a35de55149c52b6709ba/third_party/blink/renderer/core/editing/inline_box_traversal.cc
[modify] https://crrev.com/1dcf382f2a8deff5a8e7a35de55149c52b6709ba/third_party/blink/renderer/core/editing/inline_box_traversal.h
[modify] https://crrev.com/1dcf382f2a8deff5a8e7a35de55149c52b6709ba/third_party/blink/renderer/core/editing/local_caret_rect_bidi_test.cc
[modify] https://crrev.com/1dcf382f2a8deff5a8e7a35de55149c52b6709ba/third_party/blink/renderer/core/editing/local_caret_rect_test.cc
[modify] https://crrev.com/1dcf382f2a8deff5a8e7a35de55149c52b6709ba/third_party/blink/renderer/core/layout/ng/inline/ng_caret_position.cc
[modify] https://crrev.com/1dcf382f2a8deff5a8e7a35de55149c52b6709ba/third_party/blink/renderer/core/paint/ng/ng_paint_fragment_traversal.cc
[modify] https://crrev.com/1dcf382f2a8deff5a8e7a35de55149c52b6709ba/third_party/blink/renderer/core/paint/ng/ng_paint_fragment_traversal.h

Sign in to add a comment