New issue
Advanced search Search tips

Issue 811502 link

Starred by 1 user

Issue metadata

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

Blocked on: View detail
issue 778507
issue 818386
issue 822575
issue 812470
issue 851075
issue 861669

Blocking:
issue 708452



Sign in to add a comment

[LayoutNG] Support text selection by mouse/touch

Project Member Reported by xiaoche...@chromium.org, Feb 12 2018

Issue description

We should make the following operations works with LayoutNG enabled:

P1. Setting selection by mouse click + dragging

P1. Setting selection by long tap (on touch device)

P2. Setting selection with granularity by mouse double/triple click + dragging
 
P3. Setting caret selection in contenteditable by mouse click or tap
Blockedon: 778507
This is the meta bug.

Issue 778507 is dedicated to "Setting selection with granularity by mouse double/triple click + dragging".
Project Member

Comment 3 by bugdroid1@chromium.org, Feb 14 2018

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

commit d3484f957f49e74811eeda8fcee7b3af24c02d40
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed Feb 14 03:41:31 2018

Convert editing/selection/anchor-focus{1,2,3}.html with selection_test

This patch converts the layout tests with selection_test to promote the
usage of W3C testharness, and also as a preparation for implementing
text hit-testing in LayoutNG.

Bug: 679977, 811502
Change-Id: I83ced4c1af102c56471f2083bbc5593b4ee68b43
Reviewed-on: https://chromium-review.googlesource.com/915138
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#536638}
[delete] https://crrev.com/fe4fcad1c032cfd42ff96ac8c3c8531d7924e9d2/third_party/WebKit/LayoutTests/editing/selection/anchor-focus1-expected.txt
[modify] https://crrev.com/d3484f957f49e74811eeda8fcee7b3af24c02d40/third_party/WebKit/LayoutTests/editing/selection/anchor-focus1.html
[delete] https://crrev.com/fe4fcad1c032cfd42ff96ac8c3c8531d7924e9d2/third_party/WebKit/LayoutTests/editing/selection/anchor-focus2-expected.txt
[modify] https://crrev.com/d3484f957f49e74811eeda8fcee7b3af24c02d40/third_party/WebKit/LayoutTests/editing/selection/anchor-focus2.html
[delete] https://crrev.com/fe4fcad1c032cfd42ff96ac8c3c8531d7924e9d2/third_party/WebKit/LayoutTests/editing/selection/anchor-focus3-expected.txt
[modify] https://crrev.com/d3484f957f49e74811eeda8fcee7b3af24c02d40/third_party/WebKit/LayoutTests/editing/selection/anchor-focus3.html

Blockedon: 812470

Comment 5 by e...@chromium.org, Feb 15 2018

Labels: -Pri-1 Pri-2
Project Member

Comment 6 by bugdroid1@chromium.org, Feb 23 2018

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

commit f3d398c2bb9b77f12ace98435b2ac1e6cd634bfb
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri Feb 23 18:27:42 2018

[LayoutNG] Fix hit test local point in text fragments

This patch fixes the local point when hit test ends up in text fragments:

When HitTestResult's inner node is a text node, the local point should be
local to the container block flow, not the text fragment being hit-tested.
We current have the latter, which is fixed in this patch.

Bug: 811502
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: I3104c126b5ee3968f25dffa15042a45a051be160
Reviewed-on: https://chromium-review.googlesource.com/915041
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#538829}
[modify] https://crrev.com/f3d398c2bb9b77f12ace98435b2ac1e6cd634bfb/third_party/WebKit/Source/core/paint/ng/ng_box_fragment_painter.cc
[modify] https://crrev.com/f3d398c2bb9b77f12ace98435b2ac1e6cd634bfb/third_party/WebKit/Source/core/paint/ng/ng_box_fragment_painter.h

Project Member

Comment 7 by bugdroid1@chromium.org, Feb 28 2018

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

commit b452077848d6498b0556a36ab7114d0696c736e0
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed Feb 28 01:15:13 2018

[LayoutNG] Implement PositionForPoint() for normal block flows and inlines

This patch implements NG versions (or, InlineBox-free versions) of
PositionForPoint() of LayoutBlockFlow, LayoutInline and LayoutText, so that
we can obtain a DOM position when hit testing in normal block flows and
inline layout in NG.

Note that this patch doesn't handle bidirectional text.

See design doc for details: https://goo.gl/Pf5zVB

Bug: 811502
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I6d63d066881c286644304532ba7c9246ad461a6d
Reviewed-on: https://chromium-review.googlesource.com/915052
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@{#539612}
[modify] https://crrev.com/b452077848d6498b0556a36ab7114d0696c736e0/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[add] https://crrev.com/b452077848d6498b0556a36ab7114d0696c736e0/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-empty-line.html
[modify] https://crrev.com/b452077848d6498b0556a36ab7114d0696c736e0/third_party/WebKit/Source/core/layout/LayoutInline.cpp
[modify] https://crrev.com/b452077848d6498b0556a36ab7114d0696c736e0/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/b452077848d6498b0556a36ab7114d0696c736e0/third_party/WebKit/Source/core/layout/ng/inline/ng_physical_line_box_fragment.cc
[modify] https://crrev.com/b452077848d6498b0556a36ab7114d0696c736e0/third_party/WebKit/Source/core/layout/ng/inline/ng_physical_line_box_fragment.h
[modify] https://crrev.com/b452077848d6498b0556a36ab7114d0696c736e0/third_party/WebKit/Source/core/layout/ng/inline/ng_physical_text_fragment.cc
[modify] https://crrev.com/b452077848d6498b0556a36ab7114d0696c736e0/third_party/WebKit/Source/core/layout/ng/inline/ng_physical_text_fragment.h
[modify] https://crrev.com/b452077848d6498b0556a36ab7114d0696c736e0/third_party/WebKit/Source/core/layout/ng/layout_ng_mixin.cc
[modify] https://crrev.com/b452077848d6498b0556a36ab7114d0696c736e0/third_party/WebKit/Source/core/layout/ng/layout_ng_mixin.h
[modify] https://crrev.com/b452077848d6498b0556a36ab7114d0696c736e0/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.cc
[modify] https://crrev.com/b452077848d6498b0556a36ab7114d0696c736e0/third_party/WebKit/Source/core/layout/ng/ng_physical_box_fragment.h
[modify] https://crrev.com/b452077848d6498b0556a36ab7114d0696c736e0/third_party/WebKit/Source/core/layout/ng/ng_physical_container_fragment.cc
[modify] https://crrev.com/b452077848d6498b0556a36ab7114d0696c736e0/third_party/WebKit/Source/core/layout/ng/ng_physical_container_fragment.h
[modify] https://crrev.com/b452077848d6498b0556a36ab7114d0696c736e0/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h

Blockedon: 818386
Blockedon: 822575
Project Member

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

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

commit 84db68af52473d3434a811af3b9aac124fb58d6a
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon Apr 30 23:16:36 2018

Simply bidi adjustment logic in LayoutText

LayoutText's CreatePositionWithAffinityForBoxAfterAdjustingOffsetForBiDi()
does no adjustment when the direction of |box| is the same as the
containing block.

The current code returns the "unadjusted" offset after checking whether
|offset| is at left or right edge of |box|, which is unnecessary. This
patch moves it out before the check.

Bug: 811502
Change-Id: Icf26191a3fc5aaa829b8dfb5e0319d9bb8fcdc1d
Reviewed-on: https://chromium-review.googlesource.com/1035918
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554915}
[modify] https://crrev.com/84db68af52473d3434a811af3b9aac124fb58d6a/third_party/blink/renderer/core/layout/layout_text.cc

Project Member

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

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

commit 3c8b9e3571a92dcc89508d7610ea28fa071350d6
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed May 02 08:29:47 2018

Use InlineBoxTraversal for bidi adjustment in LayoutText

InlineBoxTraversal encapsulates some common traversal logic for bidi
adjustment. This patch applies the class in LayoutText, replacing
traversal code by calling InlineBoxTraversal's member functions, to
reduce code duplication.

Bug: 811502
Change-Id: I027e7e69f225873a89a20a193e7591465b29ad71
Reviewed-on: https://chromium-review.googlesource.com/1036462
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555329}
[modify] https://crrev.com/3c8b9e3571a92dcc89508d7610ea28fa071350d6/third_party/blink/renderer/core/layout/layout_text.cc

Project Member

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

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

commit a198920d1a0a4d109dbed44ccbc1febf28399913
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue May 08 17:43:13 2018

Add script-generated unit tests for bidi adjustment in hit testing

This patch adds unit tests to record the current behavior of bidi
adjustment in hit testing.

Test cases generated by https://jsfiddle.net/zxdavu94/8/
Baselines matched by https://jsfiddle.net/fyj66tn9/

Bug: 811502
Change-Id: I334adc887794fa5dc3d5bf57b2fd5c47518f40a1
Reviewed-on: https://chromium-review.googlesource.com/1049268
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@{#556858}
[modify] https://crrev.com/a198920d1a0a4d109dbed44ccbc1febf28399913/third_party/blink/renderer/core/editing/BUILD.gn
[add] https://crrev.com/a198920d1a0a4d109dbed44ccbc1febf28399913/third_party/blink/renderer/core/editing/hit_testing_bidi_test.cc

Project Member

Comment 13 by bugdroid1@chromium.org, May 9 2018

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

commit a85787ffd7dac0ce60fdd812e8ece64a57902263
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed May 09 01:09:10 2018

Minor cleanup to RenderedPosition

RenderedPosition is no longer a general purpose class, and is being
deprecated.

This patch removes unused member functions and cleans up comments for it.

Bug: 811502
Change-Id: Ifc49e2c1dd554b0fc51126a692c7873591f61dca
Reviewed-on: https://chromium-review.googlesource.com/1050928
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557043}
[modify] https://crrev.com/a85787ffd7dac0ce60fdd812e8ece64a57902263/third_party/blink/renderer/core/editing/rendered_position.cc
[modify] https://crrev.com/a85787ffd7dac0ce60fdd812e8ece64a57902263/third_party/blink/renderer/core/editing/rendered_position.h
[modify] https://crrev.com/a85787ffd7dac0ce60fdd812e8ece64a57902263/third_party/blink/renderer/core/editing/selection_controller.cc
[modify] https://crrev.com/a85787ffd7dac0ce60fdd812e8ece64a57902263/third_party/blink/renderer/core/layout/line/inline_box.h

Project Member

Comment 14 by bugdroid1@chromium.org, May 11 2018

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

commit 685e00f8c13b716e700db74476f2fea0d2c54b8d
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri May 11 02:13:33 2018

Simplify RenderedPosition equivalence relationship

RenderedPosition defines an "equivalence" relationship that,
when we have two adjacent inline boxes, the following two RPs are
considered equivalent:
- RP at the rightmost offset in the left-hand-side box
- RP at the leftmost offset in the right-hand-side box

However, with RenderedPosition being used only in SelectionController
for bidi adjustment, such general operation isn't needed:
- There's no need to check equivalence for RPs that are not at bidi
  boundaries
- For RPs at bidi boundaries, we can move the RP to the box with higher
  bidi level, and then compare the RPs directly

Therefore, this patch changes RP's constructor that, if an RP is
created at bidi boundary, make sure it's in the box with higher bidi
level. In this way, there's no need to define equivalence, and existing
call sites can simply check equality.

This is a preparation patch for implementing same bidi adjustment
in layout NG.

Bug: 811502
Change-Id: Ic4171e60efb47a31a9f1916a185953c1fc660bb7
Reviewed-on: https://chromium-review.googlesource.com/1052988
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557768}
[modify] https://crrev.com/685e00f8c13b716e700db74476f2fea0d2c54b8d/third_party/blink/renderer/core/editing/rendered_position.cc
[modify] https://crrev.com/685e00f8c13b716e700db74476f2fea0d2c54b8d/third_party/blink/renderer/core/editing/rendered_position.h
[modify] https://crrev.com/685e00f8c13b716e700db74476f2fea0d2c54b8d/third_party/blink/renderer/core/editing/selection_controller.cc

Project Member

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

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

commit e0b0dbf5dfe70e0d042a7838a244afdad5824603
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri May 11 03:38:09 2018

Unify RenderedPosition::PositionAtLeft/RightBoundaryOfBiDiRun

The above two functions are the same if the RenderedPosition is always
located in the InlineBox with a higher bidi level.

With crrev.com/c/1052988, the condition is already satisfied. Hence,
this patch merges the two functions into one.

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

Project Member

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

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

commit dee8da7ff5ff4e3d03899bc75260a84cc6a93736
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon May 14 02:44:10 2018

Refactor bidi adjustment code in SelectionController

This patch refactors bidi adjustment code in SelectonController by
introducing ShouldAdjustBase/ExtentAtBidiBoundary(), so that
adjustment criteria and adjustment result computation are separated.

Bug: 811502
Change-Id: I197322426f1f108c9aeae971c599b5bff5a7fc46
Reviewed-on: https://chromium-review.googlesource.com/1053122
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558179}
[modify] https://crrev.com/dee8da7ff5ff4e3d03899bc75260a84cc6a93736/third_party/blink/renderer/core/editing/rendered_position.cc
[modify] https://crrev.com/dee8da7ff5ff4e3d03899bc75260a84cc6a93736/third_party/blink/renderer/core/editing/rendered_position.h
[modify] https://crrev.com/dee8da7ff5ff4e3d03899bc75260a84cc6a93736/third_party/blink/renderer/core/editing/selection_controller.cc

Project Member

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

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

commit dec2a91858b34c5b9fc27c5aaefa9c863b93ca6c
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon May 14 05:39:43 2018

Specialize RenderedPosition for bidi adjustment in SelectionController

This patch removes the general member functions in RenderedPosition
that inspect properties of bidi runs, and replace them by functions
providing the exact information needed by SelectionController, which
is the only client of RenderedPosition.

Details:
- Introduced RenderedPosition::BidiBoundaryType, so that we can obtain
  whether an RP is at bidi boundary without re-comparing its offset.
- Replaced almost all existing member functions by
 - AtBidiBoundary(), replacing AtL/RBoundaryOfBidiRun()
 - BidiRunContains(other_rp), replacing
   |other_rp == this->L/RBoundaryOfBidiRun(other_rp.BidiLevelOnR/L())|
 - IsPossiblyOtherBoundaryOf(other_rp), replacing
   |this->AtL/RBoundaryOfBidiRun(other_rp.BidiLevelOnL/R())|


Bug: 811502
Change-Id: I0b59b76e8060a5953295e09c98fcf7127a636ecc
Reviewed-on: https://chromium-review.googlesource.com/1056220
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558202}
[modify] https://crrev.com/dec2a91858b34c5b9fc27c5aaefa9c863b93ca6c/third_party/blink/renderer/core/editing/rendered_position.cc
[modify] https://crrev.com/dec2a91858b34c5b9fc27c5aaefa9c863b93ca6c/third_party/blink/renderer/core/editing/rendered_position.h
[modify] https://crrev.com/dec2a91858b34c5b9fc27c5aaefa9c863b93ca6c/third_party/blink/renderer/core/editing/selection_controller.cc

Project Member

Comment 18 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 19 by bugdroid1@chromium.org, May 16 2018

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

commit a5c0c49085979fddbfc0e7e37c486fcc5bb65cda
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed May 16 03:26:23 2018

Remove unreachable branches from CreatePositionWithAffinityForBoxAfterAdjustingOffsetForBiDi

Bug: 811502
Change-Id: I61c0fc8170e943e93ad2d085122e5ccd32302263
Reviewed-on: https://chromium-review.googlesource.com/1060432
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558955}
[modify] https://crrev.com/a5c0c49085979fddbfc0e7e37c486fcc5bb65cda/third_party/blink/renderer/core/layout/layout_text.cc

Project Member

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

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

commit f95316ca7de9727cbaa873de8220b85dbec10983
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed May 16 03:53:22 2018

Fix hit testing on replaced elements with RTL resolved direction

When hit-testing in a replaced element, existing code hard maps its left
half to the DOM position before the element, and right half to the position
after the element, which is wrong if the element is in an RTL bidi run.

This patch introduced LayoutBox::ResolvedDirection() to obtain the direction
of the bidi run that an atomic inline box belongs to, and applies it to fix
the hit-testing behavior on replaced elements in bidi text.

Note: this patch also fixed the behavior in LayoutNG, as LayoutNG currently
shares LayoutReplaced::PositionForPoint() with legacy.

Bug: 811502,  834066 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I1800f9a655c2330e4ff4dda048246e3f6d62a798
Reviewed-on: https://chromium-review.googlesource.com/1056029
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
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@{#558964}
[modify] https://crrev.com/f95316ca7de9727cbaa873de8220b85dbec10983/third_party/WebKit/LayoutTests/editing/assert_selection.js
[add] https://crrev.com/f95316ca7de9727cbaa873de8220b85dbec10983/third_party/WebKit/LayoutTests/editing/selection/mouse/drag_selects_bidi_image.html
[modify] https://crrev.com/f95316ca7de9727cbaa873de8220b85dbec10983/third_party/blink/renderer/core/layout/layout_box.cc
[modify] https://crrev.com/f95316ca7de9727cbaa873de8220b85dbec10983/third_party/blink/renderer/core/layout/layout_box.h
[modify] https://crrev.com/f95316ca7de9727cbaa873de8220b85dbec10983/third_party/blink/renderer/core/layout/layout_replaced.cc

Project Member

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

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

commit 9a125e84b03f3e05299103f85ca0ae1f7fb7f3f4
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu May 17 03:32:40 2018

Fix hit testing outside RTL atomic inlines

LayoutBlock::PositionForPointIfOutsideAtomicInlineLevel() hard-maps
the left side of an atomic inline to the DOM position at its start, and
the right side to its end, which is wrong if the atomic inline is RTL.

This patch fixes the issue.

Note: this patch doesn't fix selection flickering when dragging mouse
over an atomic inline surrounded by bidi text, due to bugs in bidi
adjustment in SelectionController.

Bug: 811502,  834066 
Change-Id: Id1687922f3d713cb2eb4b8668cb0687196a2fc44
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Reviewed-on: https://chromium-review.googlesource.com/1062831
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559413}
[add] https://crrev.com/9a125e84b03f3e05299103f85ca0ae1f7fb7f3f4/third_party/WebKit/LayoutTests/editing/selection/mouse/drag_selects_rtl_inline_block.html
[modify] https://crrev.com/9a125e84b03f3e05299103f85ca0ae1f7fb7f3f4/third_party/blink/renderer/core/layout/layout_block.cc

Project Member

Comment 22 by bugdroid1@chromium.org, May 18 2018

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

commit e431581ba7cbea0b9d6965ccbba8f4e6d195cbfc
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri May 18 20:55:19 2018

Merge LayoutText's hit test bidi adjustment into BidiAdjustment class

This patch merges the bidi adjustment into BidiAdjustment class as a
preparation for generalizing the code to be used in LayoutNG.

Bug: 811502
Change-Id: Ic6775e116be49f2cb0d2f971afdeb3532bf634d3
Reviewed-on: https://chromium-review.googlesource.com/1062492
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560025}
[modify] https://crrev.com/e431581ba7cbea0b9d6965ccbba8f4e6d195cbfc/third_party/blink/renderer/core/editing/inline_box_traversal.cc
[modify] https://crrev.com/e431581ba7cbea0b9d6965ccbba8f4e6d195cbfc/third_party/blink/renderer/core/editing/inline_box_traversal.h
[modify] https://crrev.com/e431581ba7cbea0b9d6965ccbba8f4e6d195cbfc/third_party/blink/renderer/core/layout/layout_text.cc

Project Member

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

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

commit 00921cf03a53ee58490a62987b75821ce7d95ae4
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed May 23 00:21:29 2018

[LayoutNG] Move PositionForPoint() implementation to paint fragments

This patch moves the NG implementation of PositionForPoint() from
physical fragments to paint fragments as a preparation for
implementing NG hit-testing bidi adjustment (*), which requires
traversal among paint fragments.

(*) crrev.com/c/1064480

Bug: 811502
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: I449ac545e5ccefff5c5b6cbe7988b2f3c9280c4a
Reviewed-on: https://chromium-review.googlesource.com/1067699
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560849}
[modify] https://crrev.com/00921cf03a53ee58490a62987b75821ce7d95ae4/third_party/blink/renderer/core/layout/ng/inline/ng_physical_line_box_fragment.cc
[modify] https://crrev.com/00921cf03a53ee58490a62987b75821ce7d95ae4/third_party/blink/renderer/core/layout/ng/inline/ng_physical_line_box_fragment.h
[modify] https://crrev.com/00921cf03a53ee58490a62987b75821ce7d95ae4/third_party/blink/renderer/core/layout/ng/inline/ng_physical_text_fragment.cc
[modify] https://crrev.com/00921cf03a53ee58490a62987b75821ce7d95ae4/third_party/blink/renderer/core/layout/ng/inline/ng_physical_text_fragment.h
[modify] https://crrev.com/00921cf03a53ee58490a62987b75821ce7d95ae4/third_party/blink/renderer/core/layout/ng/layout_ng_mixin.cc
[modify] https://crrev.com/00921cf03a53ee58490a62987b75821ce7d95ae4/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc
[modify] https://crrev.com/00921cf03a53ee58490a62987b75821ce7d95ae4/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.h
[modify] https://crrev.com/00921cf03a53ee58490a62987b75821ce7d95ae4/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.cc
[modify] https://crrev.com/00921cf03a53ee58490a62987b75821ce7d95ae4/third_party/blink/renderer/core/layout/ng/ng_physical_container_fragment.h
[modify] https://crrev.com/00921cf03a53ee58490a62987b75821ce7d95ae4/third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h
[modify] https://crrev.com/00921cf03a53ee58490a62987b75821ce7d95ae4/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc
[modify] https://crrev.com/00921cf03a53ee58490a62987b75821ce7d95ae4/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.h

Project Member

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

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

commit cdb58d355dbd805ba971ba1619cc9bdd2457ae35
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed May 23 03:22:35 2018

[LayoutNG] Implement bidi adjustment for hit tests

This patch adds an NG version of BidiAdjustment::AdjustForHitTest, and
calls it at the end of NG hit testing (PositionForPoint), so that the
output is also bidi-adjusted as its legacy counterpart.

Bug: 811502
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: I0415e9b89e518b88718670a0dc8f065df242e1fb
Reviewed-on: https://chromium-review.googlesource.com/1064480
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560918}
[modify] https://crrev.com/cdb58d355dbd805ba971ba1619cc9bdd2457ae35/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/cdb58d355dbd805ba971ba1619cc9bdd2457ae35/third_party/blink/renderer/core/editing/hit_testing_bidi_test.cc
[modify] https://crrev.com/cdb58d355dbd805ba971ba1619cc9bdd2457ae35/third_party/blink/renderer/core/editing/inline_box_traversal.cc
[modify] https://crrev.com/cdb58d355dbd805ba971ba1619cc9bdd2457ae35/third_party/blink/renderer/core/editing/inline_box_traversal.h
[modify] https://crrev.com/cdb58d355dbd805ba971ba1619cc9bdd2457ae35/third_party/blink/renderer/core/layout/ng/inline/ng_caret_position.cc
[modify] https://crrev.com/cdb58d355dbd805ba971ba1619cc9bdd2457ae35/third_party/blink/renderer/core/layout/ng/inline/ng_caret_position.h
[modify] https://crrev.com/cdb58d355dbd805ba971ba1619cc9bdd2457ae35/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc

Project Member

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

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

commit 020e7bbf873eea1b2c8e45c07beb1e8fa7283451
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed May 23 19:16:48 2018

Move SelectionController's bidi adjustment into inline_box_traversal.cc

This patch merges the bidi adjustment algorithm in SelectionController
into inline_box_traversal.cc. Since RenderedPositionis only used by
the algorithm, it is also merged there to ease future refactoring.

This is also a preparation patch for implementing NG bidi adjustment
for SelectionController.

With this patch, all bidi adjustment code have been gathered in
inline_box_traversal.cc.

Bug: 811502
Change-Id: I0aedcb0fb6b5700b5214362cb75be450a7f1e1b0
Reviewed-on: https://chromium-review.googlesource.com/1069543
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@{#561197}
[modify] https://crrev.com/020e7bbf873eea1b2c8e45c07beb1e8fa7283451/third_party/blink/renderer/core/editing/inline_box_traversal.cc
[modify] https://crrev.com/020e7bbf873eea1b2c8e45c07beb1e8fa7283451/third_party/blink/renderer/core/editing/inline_box_traversal.h
[modify] https://crrev.com/020e7bbf873eea1b2c8e45c07beb1e8fa7283451/third_party/blink/renderer/core/editing/rendered_position.cc
[modify] https://crrev.com/020e7bbf873eea1b2c8e45c07beb1e8fa7283451/third_party/blink/renderer/core/editing/rendered_position.h
[modify] https://crrev.com/020e7bbf873eea1b2c8e45c07beb1e8fa7283451/third_party/blink/renderer/core/editing/rendered_position_test.cc
[modify] https://crrev.com/020e7bbf873eea1b2c8e45c07beb1e8fa7283451/third_party/blink/renderer/core/editing/selection_controller.cc
[modify] https://crrev.com/020e7bbf873eea1b2c8e45c07beb1e8fa7283451/third_party/blink/renderer/core/frame/local_frame_view.cc

Project Member

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

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

commit 8ca9db2b2cc381525b83c434bedc89834ff614fe
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed May 23 20:47:23 2018

Remove offset_ from RangeSelectionAdjuster::RenderedPosition

|RangeSelectionAdjuster::RenderedPosition::offset_| is a redundant
member of the class. It is used at only two places and can be replaced:

1. In GetPosition(), where the RenderedPosition must be at bidi boundary,
   in which case |offset_| is implied by |bidi_boundary_type_|.


2. In operator==(). However,
  - If |inline_box_| or |bidi_boundary_type_| of the two operands
    differ, we don't need to compare |offset_|
  - If |bidi_boundary_type_| is not |kNotBoundary|, |offset_| is implied
    and doesn't need to be compared
  - If |bidi_boundary_type_| is |kNotBoundary| (for both operands), we
    can early-stop the bidi adjustment, and still don't need the exact
    value of |offset_|

Hence, this patch removes the member, and modifies the two use sites
accordingly.

This patch also helps generalizing |RangeSelectionAdjuster| for
LayoutNG, where we don't necessarily have an offset on
|NGPaintFragment|.

Bug: 811502
Change-Id: I14bd6236073dcf262c34f98209d57871665f463c
Reviewed-on: https://chromium-review.googlesource.com/1070471
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561247}
[modify] https://crrev.com/8ca9db2b2cc381525b83c434bedc89834ff614fe/third_party/blink/renderer/core/editing/inline_box_traversal.cc

Project Member

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

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

commit 7c9bf4798e00154f9a4f448ce2be321a83893d7d
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu May 24 20:32:24 2018

[LayoutNG] Implement bidi adjustment for SelectionController

This patch generalizes RenderedPosition to store an AbsoluteInlineBox,
so that it also works with LayoutNG. As a result, bidi adjustment for
SelectionController is enabled in LayoutNG.

Bug: 811502
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: I27d2ebe8e091173c4d298f15eb47b60f76c15312
Reviewed-on: https://chromium-review.googlesource.com/1070564
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561612}
[modify] https://crrev.com/7c9bf4798e00154f9a4f448ce2be321a83893d7d/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/7c9bf4798e00154f9a4f448ce2be321a83893d7d/third_party/blink/renderer/core/editing/inline_box_traversal.cc
[modify] https://crrev.com/7c9bf4798e00154f9a4f448ce2be321a83893d7d/third_party/blink/renderer/core/editing/ng_flat_tree_shorthands.cc
[modify] https://crrev.com/7c9bf4798e00154f9a4f448ce2be321a83893d7d/third_party/blink/renderer/core/editing/ng_flat_tree_shorthands.h
[modify] https://crrev.com/7c9bf4798e00154f9a4f448ce2be321a83893d7d/third_party/blink/renderer/core/paint/ng/ng_paint_fragment_traversal.h

Project Member

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

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

commit 459b1280eae63831b17f44a9747fe34c50dcdf81
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri May 25 22:01:31 2018

[LayoutNG] Fix hit testing on first letter

If an NGPhysicalTextFragment is created from first-letter, its
GetNode() method returns nullptr, which leads to false negative
when hit-testing on this fragment.

This patch adds a new method to obtain the text node for first-
letter fragments, and applies it in hit test code, so that we
can correctly obtain the text node when hit-testing the first
letter.

Bug: 811502
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: I70e5cd4948f248a6e51e3a1732273779ef36509c
Reviewed-on: https://chromium-review.googlesource.com/1072691
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>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562030}
[modify] https://crrev.com/459b1280eae63831b17f44a9747fe34c50dcdf81/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/459b1280eae63831b17f44a9747fe34c50dcdf81/third_party/blink/renderer/core/layout/ng/inline/ng_physical_text_fragment.cc
[modify] https://crrev.com/459b1280eae63831b17f44a9747fe34c50dcdf81/third_party/blink/renderer/core/layout/ng/inline/ng_physical_text_fragment.h
[modify] https://crrev.com/459b1280eae63831b17f44a9747fe34c50dcdf81/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc

Project Member

Comment 29 by bugdroid1@chromium.org, Jun 1 2018

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

commit 05fea9e685e19bb450ad6db7521f84f590939f84
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri Jun 01 19:18:37 2018

[LayoutNG] Fix hit testing on pseudo elements

In legacy, when hit testing on a pseudo element or its anonymous
descendants, HitTestResult stores the pseudo element and the associated
non-pseudo node separately in:
- inner_possibly_pseudo_node_
- inner_node_

This patch implements the same behavior in LayoutNG. The key function
is NGPaintFragment::NodeForHitTest() for obtaining the correct pseudo
element from an anonymous fragment. In order to obtain the pseudo
element from fragment tree, this patch also modified NGInlineItem
such that we always create box fragments for pseudo elements that
can be hit test targets (::before, ::after and ::first-letter).

Note: crrev.com/c/1072691 tried to fixed hit testing on first letter,
but is an unsuccessful attempt as it breaks the design that
HitTestResult can store pseudo node,

Bug: 811502
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: I5ff078f8986d335e4422bcde030413fa84278ed2
Reviewed-on: https://chromium-review.googlesource.com/1079896
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@{#563750}
[modify] https://crrev.com/05fea9e685e19bb450ad6db7521f84f590939f84/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/05fea9e685e19bb450ad6db7521f84f590939f84/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-generated-content/010-expected.txt
[modify] https://crrev.com/05fea9e685e19bb450ad6db7521f84f590939f84/third_party/blink/renderer/core/layout/ng/inline/ng_inline_item.cc
[modify] https://crrev.com/05fea9e685e19bb450ad6db7521f84f590939f84/third_party/blink/renderer/core/layout/ng/inline/ng_physical_text_fragment.cc
[modify] https://crrev.com/05fea9e685e19bb450ad6db7521f84f590939f84/third_party/blink/renderer/core/layout/ng/inline/ng_physical_text_fragment.h
[modify] https://crrev.com/05fea9e685e19bb450ad6db7521f84f590939f84/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
[modify] https://crrev.com/05fea9e685e19bb450ad6db7521f84f590939f84/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc
[modify] https://crrev.com/05fea9e685e19bb450ad6db7521f84f590939f84/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.h

Project Member

Comment 30 by bugdroid1@chromium.org, Jun 6 2018

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

commit a748ef4a070d27254f1a96caec7f4b580c58b0d0
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed Jun 06 22:43:22 2018

[LayoutNG] Fix offset accumulation for hit test fallback

Current LayoutNG hit test code computes wrong |accumulated_offset|
when falling back to legacy. It tries to maintain an additional
offset for legacy, but fails to do so.

This patch computes the fallback offset directly from NG offset, which
fixes legacy fallback, and also removes the legacy offset maintenance
code.

Bug: 811502
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: I06b2df66dc2a36efaf32077ea26a3abb4a26eb49
Reviewed-on: https://chromium-review.googlesource.com/1089800
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565070}
[modify] https://crrev.com/a748ef4a070d27254f1a96caec7f4b580c58b0d0/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/a748ef4a070d27254f1a96caec7f4b580c58b0d0/third_party/blink/renderer/core/layout/layout_inline.cc
[modify] https://crrev.com/a748ef4a070d27254f1a96caec7f4b580c58b0d0/third_party/blink/renderer/core/layout/ng/layout_ng_mixin.cc
[modify] https://crrev.com/a748ef4a070d27254f1a96caec7f4b580c58b0d0/third_party/blink/renderer/core/paint/ng/ng_block_flow_painter.cc
[modify] https://crrev.com/a748ef4a070d27254f1a96caec7f4b580c58b0d0/third_party/blink/renderer/core/paint/ng/ng_block_flow_painter.h
[modify] https://crrev.com/a748ef4a070d27254f1a96caec7f4b580c58b0d0/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.cc
[modify] https://crrev.com/a748ef4a070d27254f1a96caec7f4b580c58b0d0/third_party/blink/renderer/core/paint/ng/ng_box_fragment_painter.h

Project Member

Comment 31 by bugdroid1@chromium.org, Jun 7 2018

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

commit c9b557f2d649e2052f189d213d6229ac7bc457ee
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu Jun 07 00:08:44 2018

[LayoutNG] Handle inline continuations in PositionForPoint()

When calling PositionForPoint() on an inline element with continuation,
we need to find the correct block flow to enter. Legacy has such
handling, but NG currently doesn't.

As NG currently doesn't build its own tree, which means continuation
info is only available in legacy layout tree, this patch makes NG
PositionForPoint() reuse the legacy handling code to find the correct
block flow.

Bug: 811502
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I7155d09cc4f820580b2f72d316fabc345dd4d848
Reviewed-on: https://chromium-review.googlesource.com/1087826
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565111}
[modify] https://crrev.com/c9b557f2d649e2052f189d213d6229ac7bc457ee/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/c9b557f2d649e2052f189d213d6229ac7bc457ee/third_party/blink/renderer/core/layout/layout_inline.cc

Blockedon: 851075
Project Member

Comment 33 by bugdroid1@chromium.org, Jun 22 2018

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

commit bb08a30ba9329a32054ff66b9a1b1aa6d2af0081
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri Jun 22 07:34:14 2018

[LayoutNG] Set the correct TextAffinity for PositionForPoint0

This patch implements the behavior that, when clicking at the end of
a line, we set an upstream caret selection to indicate that the
the selection is at the end of the first line instead of the beginning
of the second line, though they may have the same DOM position.

This patch fixes accessibility/selection-affinity.html, whose failure
is no longer relevant to Range.getClientRects().

Bug: 811502
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I0e2d9a9b93e9371a0fb604a0550a376b6035e09d
Reviewed-on: https://chromium-review.googlesource.com/1111466
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569550}
[modify] https://crrev.com/bb08a30ba9329a32054ff66b9a1b1aa6d2af0081/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/bb08a30ba9329a32054ff66b9a1b1aa6d2af0081/third_party/blink/renderer/core/layout/ng/inline/ng_caret_position.cc
[modify] https://crrev.com/bb08a30ba9329a32054ff66b9a1b1aa6d2af0081/third_party/blink/renderer/core/layout/ng/inline/ng_caret_position.h
[modify] https://crrev.com/bb08a30ba9329a32054ff66b9a1b1aa6d2af0081/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc

Blockedon: 861669
Project Member

Comment 35 by bugdroid1@chromium.org, Jul 26

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

commit 89a28385c3a3fe5de33faade7e40b1936b9d7819
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu Jul 26 03:03:44 2018

[LayoutNG] Fix off-by-one hit test failure at vertical-rl line edges

The hit test "point" is not really a point, but a pixel with 1px width
and height. Ignoring this leads to off-by-one errors when converting
a physical point into logical in vertical-rl writing mode.

This patch fixes the issue by using 1px width and height in the
conversion, instead of 0.

Note: This patch contains an all-pass NG baseline because the legacy
baseline contains a failure line.

Bug: 811502
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ie3f01469b4902c3c9647d40be92ccb9c26467f0d
Reviewed-on: https://chromium-review.googlesource.com/1150814
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578178}
[modify] https://crrev.com/89a28385c3a3fe5de33faade7e40b1936b9d7819/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[add] https://crrev.com/89a28385c3a3fe5de33faade7e40b1936b9d7819/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/writing-mode/flipped-blocks-hit-test-line-edges-expected.txt
[modify] https://crrev.com/89a28385c3a3fe5de33faade7e40b1936b9d7819/third_party/blink/renderer/core/paint/ng/ng_paint_fragment.cc

Project Member

Comment 36 by bugdroid1@chromium.org, Aug 7

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

commit 3be6290ce53f80af308cd3d0f4e64a8a963e84f7
Author: Yoichi Osato <yoichio@chromium.org>
Date: Tue Aug 07 05:21:35 2018

[LayoutNG] Simplify a failing continuations-with-move-caret-to-boundary.html.

This patch simplifies the tests that confirms text selection upon drag
selects differently on mac.
I will move the test to selection/mouse.

Bug: 811502, 866120
Change-Id: Id9bb292236b709b65a98be1eff3fc778da02264b
Reviewed-on: https://chromium-review.googlesource.com/1163348
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581139}
[modify] https://crrev.com/3be6290ce53f80af308cd3d0f4e64a8a963e84f7/third_party/WebKit/LayoutTests/editing/selection/continuations-with-move-caret-to-boundary.html
[delete] https://crrev.com/4f08052f98dee02f9ec6912ce3050e41143ee599/third_party/WebKit/LayoutTests/editing/selection/continuations-without-move-caret-to-boundary.html

Sign in to add a comment