Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(799)

Issue 2398583002: Do not de-select text across continuations (Closed)

Created:
4 years, 2 months ago by pdr.
Modified:
4 years, 2 months ago
Reviewers:
tkent, yosin_UTC9, eae
CC:
blink-reviews, blink-reviews-layout_chromium.org, chromium-reviews, eae+blinkwatch, jchaffraix+rendering, leviw+renderwatch, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Do not de-select text across continuations When determining the end position for a selection ending on a continuation's margin, we would incorrectly de-select all content below the continuation's containing block. This affects sites like hackernews, such as selecting text in: https://news.ycombinator.com/item?id=347261 This patch is a buy-one-get-one-free with two fixes in one patch (both fixes are required): 1) Continuations should be tested immediately because ancestors of a continuation will not check them. In LayoutInline::positionForPoint, we need to check our continuations first, before an early return, because the containing block will not return to test the continuations. 2) Continuations do not need an adjustment for their position to "translate the coords from the pre-anonymous block to the post-anonymous block." This code was not tested and seems wrong because the point is already in the correct coordinate space. Here's an example of a layout tree dump (included as a new test as well): LayoutView LayoutBlockFlow LayoutBlockFlow (anonymous) LayoutInline continuation=(next block flow) FONT LayoutText #text "AAAAAAAAAA" LayoutBlockFlow (anonymous) continuation=(next sibling block flow) LayoutBlockFlow P LayoutText #text "BBBBBBBBBB" LayoutBlockFlow P LayoutText #text "CCCCCCCCCC" LayoutBlockFlow (anonymous) LayoutInline FONT This patch is solving a bug when selecting from the beginning of AA...AA to the margin between BB...BB and CC...CC. Before this patch, BB...BB would not be selected. BUG=468497 Committed: https://crrev.com/084f254759294c0789432816d2516b70abae3b9d Cr-Commit-Position: refs/heads/master@{#423639}

Patch Set 1 #

Patch Set 2 : Make failures more obvious #

Patch Set 3 : Add tests for different editing behaviors #

Total comments: 2

Patch Set 4 : Switch to non-pixel tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+213 lines, -14 lines) Patch
A third_party/WebKit/LayoutTests/editing/selection/continuations-with-move-caret-to-boundary.html View 1 2 3 1 chunk +101 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/editing/selection/continuations-without-move-caret-to-boundary.html View 1 2 3 1 chunk +101 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutInline.cpp View 1 2 3 1 chunk +11 lines, -14 lines 0 comments Download

Messages

Total messages: 26 (18 generated)
pdr.
https://codereview.chromium.org/2398583002/diff/40001/third_party/WebKit/Source/core/layout/LayoutInline.cpp File third_party/WebKit/Source/core/layout/LayoutInline.cpp (left): https://codereview.chromium.org/2398583002/diff/40001/third_party/WebKit/Source/core/layout/LayoutInline.cpp#oldcode946 third_party/WebKit/Source/core/layout/LayoutInline.cpp:946: // Translate the coords from the pre-anonymous block to ...
4 years, 2 months ago (2016-10-06 04:52:32 UTC) #9
yosin_UTC9
C++ changes seems to be good. Bun in case, +eae@ For layout tests, I think ...
4 years, 2 months ago (2016-10-06 05:36:52 UTC) #11
pdr.
On 2016/10/06 at 05:36:52, yosin wrote: > C++ changes seems to be good. Bun in ...
4 years, 2 months ago (2016-10-06 18:32:59 UTC) #15
eae
My name is eae and I approve of this change list. LGTM
4 years, 2 months ago (2016-10-06 18:51:35 UTC) #18
pdr.
On 2016/10/06 at 18:51:35, eae wrote: > My name is eae and I approve of ...
4 years, 2 months ago (2016-10-06 19:51:28 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2398583002/60001
4 years, 2 months ago (2016-10-06 19:52:11 UTC) #23
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 2 months ago (2016-10-06 19:59:20 UTC) #24
commit-bot: I haz the power
4 years, 2 months ago (2016-10-06 20:01:49 UTC) #26
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/084f254759294c0789432816d2516b70abae3b9d
Cr-Commit-Position: refs/heads/master@{#423639}

Powered by Google App Engine
This is Rietveld 408576698