New issue
Advanced search Search tips

Issue 739062 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Task

Blocking:
issue 708452



Sign in to add a comment

Brush up SelectionState marking and LayoutObject invalidation

Project Member Reported by yoichio@chromium.org, Jul 4 2017

Issue description

Currently LayoutSelection find start/end LayoutObject with VisibleSelection.
Let's split them.
This is ready for Selection painting on NG.
 
Current all-in-one patch:
https://codereview.chromium.org/2962143002/

There are many layout test failures but they are all false-negative because
1. They should not consider editing boundary because it limits only user selection not
 Selection API.
2. They should not expect Selection canonicalized.

Project Member

Comment 2 by bugdroid1@chromium.org, Jul 4 2017

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

commit 1fecbb3b2566b6f261942206b243bb7057c210ca
Author: yoichio <yoichio@chromium.org>
Date: Tue Jul 04 08:58:45 2017

Convert editing/selection/node-removal-2.html using assert_selection().

TEST=LayoutTests/editing/selection/select_all/select_all_in_contenteditable.html
BUG= 739062 

Review-Url: https://codereview.chromium.org/2972603002
Cr-Commit-Position: refs/heads/master@{#484070}

[modify] https://crrev.com/1fecbb3b2566b6f261942206b243bb7057c210ca/third_party/WebKit/LayoutTests/editing/selection/node-removal-2.html
[delete] https://crrev.com/6a610960559b0f6c03b24c024146cf9ba28627bb/third_party/WebKit/LayoutTests/platform/linux/editing/selection/node-removal-2-expected.png
[delete] https://crrev.com/6a610960559b0f6c03b24c024146cf9ba28627bb/third_party/WebKit/LayoutTests/platform/linux/editing/selection/node-removal-2-expected.txt
[delete] https://crrev.com/6a610960559b0f6c03b24c024146cf9ba28627bb/third_party/WebKit/LayoutTests/platform/mac/editing/selection/node-removal-2-expected.png
[delete] https://crrev.com/6a610960559b0f6c03b24c024146cf9ba28627bb/third_party/WebKit/LayoutTests/platform/mac/editing/selection/node-removal-2-expected.txt
[delete] https://crrev.com/6a610960559b0f6c03b24c024146cf9ba28627bb/third_party/WebKit/LayoutTests/platform/win/editing/selection/node-removal-2-expected.png
[delete] https://crrev.com/6a610960559b0f6c03b24c024146cf9ba28627bb/third_party/WebKit/LayoutTests/platform/win/editing/selection/node-removal-2-expected.txt

Project Member

Comment 3 by bugdroid1@chromium.org, Jul 4 2017

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

commit dcd16e1cb508aa2a8379eb489c13ab8780bda0bb
Author: yoichio <yoichio@chromium.org>
Date: Tue Jul 04 09:36:04 2017

Remove line break in LayoutTests/editing/selection/selection-button-text.html

Selection painting with SelectAll collapses last line breaks. This should be fixed.
However, there are many layout tests which have expect.png of such painting
 even the tests confirm another issue.
This CL makes such test independent from the SelectAll behavior.

BUG= 739062 

Review-Url: https://codereview.chromium.org/2964903002
Cr-Commit-Position: refs/heads/master@{#484077}

[modify] https://crrev.com/dcd16e1cb508aa2a8379eb489c13ab8780bda0bb/third_party/WebKit/LayoutTests/editing/selection/selection-button-text.html

Project Member

Comment 4 by bugdroid1@chromium.org, Jul 4 2017

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

commit 41ace186a3e2cb6001a328ca88c9795ace2f11cd
Author: yoichio <yoichio@chromium.org>
Date: Tue Jul 04 09:43:25 2017

Convert fast/forms/form-added-to-table.html using testharness.
The test just confirms not crash so we don't need txt/png references.

BUG= 739062 

Review-Url: https://codereview.chromium.org/2972623002
Cr-Commit-Position: refs/heads/master@{#484078}

[modify] https://crrev.com/41ace186a3e2cb6001a328ca88c9795ace2f11cd/third_party/WebKit/LayoutTests/fast/forms/form-added-to-table.html
[delete] https://crrev.com/dcd16e1cb508aa2a8379eb489c13ab8780bda0bb/third_party/WebKit/LayoutTests/platform/linux/fast/forms/form-added-to-table-expected.png
[delete] https://crrev.com/dcd16e1cb508aa2a8379eb489c13ab8780bda0bb/third_party/WebKit/LayoutTests/platform/linux/fast/forms/form-added-to-table-expected.txt
[delete] https://crrev.com/dcd16e1cb508aa2a8379eb489c13ab8780bda0bb/third_party/WebKit/LayoutTests/platform/mac/fast/forms/form-added-to-table-expected.png
[delete] https://crrev.com/dcd16e1cb508aa2a8379eb489c13ab8780bda0bb/third_party/WebKit/LayoutTests/platform/mac/fast/forms/form-added-to-table-expected.txt
[delete] https://crrev.com/dcd16e1cb508aa2a8379eb489c13ab8780bda0bb/third_party/WebKit/LayoutTests/platform/win/fast/forms/form-added-to-table-expected.png
[delete] https://crrev.com/dcd16e1cb508aa2a8379eb489c13ab8780bda0bb/third_party/WebKit/LayoutTests/platform/win/fast/forms/form-added-to-table-expected.txt

Project Member

Comment 5 by bugdroid1@chromium.org, Jul 4 2017

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

commit 417c8e572bca610c9e92003f50ea6b9339a3da5a
Author: yoichio <yoichio@chromium.org>
Date: Tue Jul 04 10:01:38 2017

Convert editing/selection/3690719.html using assert_selection().

3690719 was introduced to confirm select all behavior in content editable:
https://chromium.googlesource.com/chromium/src/+/8c8a84b04e24083fc6729245cb2681c569f13485
We don't need test it on the google page.

TEST=LayoutTests/editing/selection/select_all/select_all_in_contenteditable.html
BUG= 739062 , 679977

Review-Url: https://codereview.chromium.org/2970773002
Cr-Commit-Position: refs/heads/master@{#484080}

[modify] https://crrev.com/417c8e572bca610c9e92003f50ea6b9339a3da5a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/417c8e572bca610c9e92003f50ea6b9339a3da5a/third_party/WebKit/LayoutTests/TestExpectations
[delete] https://crrev.com/de8088188edebdcfbc05eb14cd5a238c25ae2fc2/third_party/WebKit/LayoutTests/editing/selection/3690719.html
[add] https://crrev.com/417c8e572bca610c9e92003f50ea6b9339a3da5a/third_party/WebKit/LayoutTests/editing/selection/select_all/select_all_in_contenteditable.html
[delete] https://crrev.com/de8088188edebdcfbc05eb14cd5a238c25ae2fc2/third_party/WebKit/LayoutTests/platform/linux/editing/selection/3690719-expected.png
[delete] https://crrev.com/de8088188edebdcfbc05eb14cd5a238c25ae2fc2/third_party/WebKit/LayoutTests/platform/linux/editing/selection/3690719-expected.txt
[delete] https://crrev.com/de8088188edebdcfbc05eb14cd5a238c25ae2fc2/third_party/WebKit/LayoutTests/platform/mac/editing/selection/3690719-expected.png
[delete] https://crrev.com/de8088188edebdcfbc05eb14cd5a238c25ae2fc2/third_party/WebKit/LayoutTests/platform/mac/editing/selection/3690719-expected.txt
[delete] https://crrev.com/de8088188edebdcfbc05eb14cd5a238c25ae2fc2/third_party/WebKit/LayoutTests/platform/win/editing/selection/3690719-expected.png
[delete] https://crrev.com/de8088188edebdcfbc05eb14cd5a238c25ae2fc2/third_party/WebKit/LayoutTests/platform/win/editing/selection/3690719-expected.txt

Project Member

Comment 6 by bugdroid1@chromium.org, Jul 4 2017

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

commit 2bd6b65887a825a931aa8887e21cc400cfe42e72
Author: yoichio <yoichio@chromium.org>
Date: Tue Jul 04 10:21:13 2017

Select exact nodes in fast/ruby/select-ruby.html

Selection painting collapses last line breaks. This should be fixed.
However, there are many layout tests which have expect.png of such painting
 even the tests confirm another issue.
This CL makes such test independent from the painting behavior.

BUG= 739062 

Review-Url: https://codereview.chromium.org/2969973002
Cr-Commit-Position: refs/heads/master@{#484082}

[modify] https://crrev.com/2bd6b65887a825a931aa8887e21cc400cfe42e72/third_party/WebKit/LayoutTests/fast/ruby/select-ruby.html

Project Member

Comment 7 by bugdroid1@chromium.org, Jul 4 2017

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

commit 27bc93cab77ed26d3b94c675f6079d9f1e83711f
Author: yoichio <yoichio@chromium.org>
Date: Tue Jul 04 10:41:27 2017

Select exact nodes in fast/selectors/shadow-host-div-with-*.html

Selection painting collapses last line breaks. This should be fixed.
However, there are many layout tests which have expect.png of such painting
 even the tests confirm another issue.
This CL makes such test independent from the painting behavior.

BUG= 739062 

Review-Url: https://codereview.chromium.org/2967903002
Cr-Commit-Position: refs/heads/master@{#484084}

[modify] https://crrev.com/27bc93cab77ed26d3b94c675f6079d9f1e83711f/third_party/WebKit/LayoutTests/fast/selectors/shadow-host-div-with-span.html
[modify] https://crrev.com/27bc93cab77ed26d3b94c675f6079d9f1e83711f/third_party/WebKit/LayoutTests/fast/selectors/shadow-host-div-with-text.html

Project Member

Comment 8 by bugdroid1@chromium.org, Jul 4 2017

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

commit 4ff2d41025006a482ea0d5fb40fb4aa3a585e3d3
Author: yoichio <yoichio@chromium.org>
Date: Tue Jul 04 11:07:47 2017

Make CalcSelection return EphemeralRange.

This is preparation to split LayoutSelection::start and end:
https://codereview.chromium.org/2962143002/

BUG= 739062 
TEST=No change in behavior

Review-Url: https://codereview.chromium.org/2970653003
Cr-Commit-Position: refs/heads/master@{#484086}

[modify] https://crrev.com/4ff2d41025006a482ea0d5fb40fb4aa3a585e3d3/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 9 by bugdroid1@chromium.org, Jul 5 2017

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

commit b30a6dddc14804ad52d22db845f119baf3ca6dd8
Author: yoichio <yoichio@chromium.org>
Date: Wed Jul 05 03:33:43 2017

Select exact nodes in fast/text/selection-*.html

Selection painting collapses last line breaks. This should be fixed.
However, there are many layout tests which have expect.png of such painting
 even the tests confirm another issue.
This CL makes such test independent from the painting behavior.

BUG= 739062 

Review-Url: https://codereview.chromium.org/2967973002
Cr-Commit-Position: refs/heads/master@{#484184}

[modify] https://crrev.com/b30a6dddc14804ad52d22db845f119baf3ca6dd8/third_party/WebKit/LayoutTests/fast/text/selection-painting-hidpi.html
[modify] https://crrev.com/b30a6dddc14804ad52d22db845f119baf3ca6dd8/third_party/WebKit/LayoutTests/fast/text/selection-rect-line-height-too-big.html
[modify] https://crrev.com/b30a6dddc14804ad52d22db845f119baf3ca6dd8/third_party/WebKit/LayoutTests/fast/text/selection-rect-line-height-too-small.html
[modify] https://crrev.com/b30a6dddc14804ad52d22db845f119baf3ca6dd8/third_party/WebKit/LayoutTests/fast/text/selection-rect-rounding.html

Project Member

Comment 10 by bugdroid1@chromium.org, Jul 5 2017

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

commit 37deacfdee01657c0451e7a24ecdc8456cb49626
Author: yoichio <yoichio@chromium.org>
Date: Wed Jul 05 06:06:16 2017

Remove unusable test: editing/selection/selection-actions.html

The test was introduced 12 ago to confirm user key navigation not crash
(I guess it came from "VisiblePosition" traversing):
https://chromium.googlesource.com/chromium/src/+/41b612685b1d71129123b1ae4ffd5c1a240327af

However all methods in the test calls Selection.modify(). We test that
 method behavior in addition to not crashing in layout tests.
Thus, we don't need the layout test just confirming not crash.

BUG= 739062 

Review-Url: https://codereview.chromium.org/2970903002
Cr-Commit-Position: refs/heads/master@{#484194}

[modify] https://crrev.com/37deacfdee01657c0451e7a24ecdc8456cb49626/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[delete] https://crrev.com/70b9dcb8dae67c7c101a1c4c8f17da2adbcf98ab/third_party/WebKit/LayoutTests/editing/selection/selection-actions.html
[delete] https://crrev.com/70b9dcb8dae67c7c101a1c4c8f17da2adbcf98ab/third_party/WebKit/LayoutTests/platform/linux/editing/selection/selection-actions-expected.png
[delete] https://crrev.com/70b9dcb8dae67c7c101a1c4c8f17da2adbcf98ab/third_party/WebKit/LayoutTests/platform/linux/editing/selection/selection-actions-expected.txt
[delete] https://crrev.com/70b9dcb8dae67c7c101a1c4c8f17da2adbcf98ab/third_party/WebKit/LayoutTests/platform/mac/editing/selection/selection-actions-expected.png
[delete] https://crrev.com/70b9dcb8dae67c7c101a1c4c8f17da2adbcf98ab/third_party/WebKit/LayoutTests/platform/mac/editing/selection/selection-actions-expected.txt
[delete] https://crrev.com/70b9dcb8dae67c7c101a1c4c8f17da2adbcf98ab/third_party/WebKit/LayoutTests/platform/win/editing/selection/selection-actions-expected.png
[delete] https://crrev.com/70b9dcb8dae67c7c101a1c4c8f17da2adbcf98ab/third_party/WebKit/LayoutTests/platform/win/editing/selection/selection-actions-expected.txt

Project Member

Comment 11 by bugdroid1@chromium.org, Jul 5 2017

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

commit b12a50aed06cf44cc5ecadc229adcc82d1794717
Author: yoichio <yoichio@chromium.org>
Date: Wed Jul 05 11:12:51 2017

Introduce ComputeSelectionMode in LayoutSelection

We don't need return valid EphemeralRange if we have visible caret.

BUG= 739062 

Review-Url: https://codereview.chromium.org/2972773002
Cr-Commit-Position: refs/heads/master@{#484242}

[modify] https://crrev.com/b12a50aed06cf44cc5ecadc229adcc82d1794717/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 12 by bugdroid1@chromium.org, Jul 6 2017

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

commit f61adbb9d883cb400f479a442322836ca732edee
Author: yoichio <yoichio@chromium.org>
Date: Thu Jul 06 10:59:26 2017

Convert svg/foreignObject/viewport-foreignobject-crash.html using testharness.
The test just confirms not crash so we don't need reference.

BUG= 739062 

Review-Url: https://codereview.chromium.org/2967343002
Cr-Commit-Position: refs/heads/master@{#484540}

[delete] https://crrev.com/4c22d51c1a040d068c3ffba38b16554672ae2372/third_party/WebKit/LayoutTests/svg/foreignObject/viewport-foreignobject-crash-expected.html
[modify] https://crrev.com/f61adbb9d883cb400f479a442322836ca732edee/third_party/WebKit/LayoutTests/svg/foreignObject/viewport-foreignobject-crash.html

Project Member

Comment 13 by bugdroid1@chromium.org, Jul 7 2017

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

commit af5eed337751ca4f227f80a722c3c374dcf7973e
Author: yoichio <yoichio@chromium.org>
Date: Fri Jul 07 09:55:25 2017

Refactor FrameSelection::RevealSelection

Early return and delay rect computation until need.

BUG= 739062 

Review-Url: https://codereview.chromium.org/2972153002
Cr-Commit-Position: refs/heads/master@{#484870}

[modify] https://crrev.com/af5eed337751ca4f227f80a722c3c374dcf7973e/third_party/WebKit/Source/core/editing/FrameSelection.cpp

Project Member

Comment 14 by bugdroid1@chromium.org, Jul 10 2017

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

commit a6a78b205297ad9733dbe8d828dcc43cfad7667e
Author: yoichio <yoichio@chromium.org>
Date: Mon Jul 10 09:21:40 2017

Use Layoutselection::SelectionBounds() in RevealSelection()

Before this patch, we use VisibleUnit::ComputeTextRect() to compute
 a rect to scroll.
However, ComputeTextRect() calls InlineTextBox::LocalSelectionRect() which
 depends on InlineTextBox current SelectionState.
To avoid that, update SeletionState and get a rect directly from
 LayoutSelection::SelectionBounds().

BUG= 739062 ,  740401 
TEST=LayoutTests/editing/input/scroll-with-tab-to-input-regression.html

Review-Url: https://codereview.chromium.org/2979513002
Cr-Commit-Position: refs/heads/master@{#485214}

[modify] https://crrev.com/a6a78b205297ad9733dbe8d828dcc43cfad7667e/third_party/WebKit/Source/core/editing/FrameSelection.cpp
[modify] https://crrev.com/a6a78b205297ad9733dbe8d828dcc43cfad7667e/third_party/WebKit/Source/core/editing/FrameSelection.h

Project Member

Comment 15 by bugdroid1@chromium.org, Jul 12 2017

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

commit a1cb0a9d4d102742e19707f6daeb654b4a533368
Author: Yoichi Osato <yoichio@chromium.org>
Date: Wed Jul 12 11:02:22 2017

Replace VisibleSelection in Layoutselection::CalcSelection with VisiblePosition

This is preparation to split LayoutSelection start/end calculation w/o 
canonicalization.
This CL also fixes issue that Selection API consider editable boundary incorrectly

Bug:  739062 
Change-Id: I84623287faebcb3bc5c497abf1d9560a54f5d751
Reviewed-on: https://chromium-review.googlesource.com/566208
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#485920}
[modify] https://crrev.com/a1cb0a9d4d102742e19707f6daeb654b4a533368/third_party/WebKit/LayoutTests/platform/linux/editing/selection/mixed-editability-2-expected.png
[modify] https://crrev.com/a1cb0a9d4d102742e19707f6daeb654b4a533368/third_party/WebKit/LayoutTests/platform/mac/editing/selection/mixed-editability-2-expected.png
[modify] https://crrev.com/a1cb0a9d4d102742e19707f6daeb654b4a533368/third_party/WebKit/LayoutTests/platform/win/editing/selection/mixed-editability-2-expected.png
[modify] https://crrev.com/a1cb0a9d4d102742e19707f6daeb654b4a533368/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 16 by bugdroid1@chromium.org, Jul 13 2017

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

commit 1d2dccbc966f9595241ebce9501238af6bf2125a
Author: yoichio <yoichio@chromium.org>
Date: Thu Jul 13 05:20:59 2017

Range::BoundingRect() must independent from Selection.

Range::BoundingRect() returns different Rect depending on whether 
included Text nodes are selected or not. 
Since Range itself lives independently from user selection,
 this function also should be away from Selection.

The root cause is InlineTextBox::LocalSelectionRect(), which is
 called by BoundingRect(), depends on SelectionState.
LocalSelectionRect() refers current SelectionState so that
 paint invalidation invalids wrapping  line endings.

This patch change LocalSelectionRect(start,end) to have another
 boolean option which decides if we use current SelectionState.
(core/layout/*)

This patch also fixes InlineTextBox::GetSelectionState() can 
 update SelectionState by calling LayoutSelection::SelectionStartEnd().
Callers of SelectionStartEnd() must know SelectionState but 
 Commit() in SelectionStartEnd() can change the state.
(core/editing/LayoutSelection.*)


Bug:  739062 
Change-Id: I98987940cd014d302c13d1370111a6664740e646
Reviewed-on: https://chromium-review.googlesource.com/567791
Commit-Queue: 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@{#486277}
[modify] https://crrev.com/1d2dccbc966f9595241ebce9501238af6bf2125a/third_party/WebKit/Source/core/dom/RangeTest.cpp
[modify] https://crrev.com/1d2dccbc966f9595241ebce9501238af6bf2125a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/1d2dccbc966f9595241ebce9501238af6bf2125a/third_party/WebKit/Source/core/editing/LayoutSelection.h
[modify] https://crrev.com/1d2dccbc966f9595241ebce9501238af6bf2125a/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/1d2dccbc966f9595241ebce9501238af6bf2125a/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
[modify] https://crrev.com/1d2dccbc966f9595241ebce9501238af6bf2125a/third_party/WebKit/Source/core/layout/line/InlineTextBox.h
[modify] https://crrev.com/1d2dccbc966f9595241ebce9501238af6bf2125a/third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp
[modify] https://crrev.com/1d2dccbc966f9595241ebce9501238af6bf2125a/third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.h

Project Member

Comment 17 by bugdroid1@chromium.org, Jul 14 2017

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

commit 3cecd80780e895d0f1c6e72e93f52ce5a75bb029
Author: Yoichi Osato <yoichio@chromium.org>
Date: Fri Jul 14 02:37:43 2017

Remove VisibleSelection creation from BlockCursor calculation.

This is preparation to split LayoutSelection start/end calculation w/o 
canonicalization.

Bug:  739062 
Change-Id: Ic318f07693a25e160060cb413f3c6edbb8f9e6b1
Reviewed-on: https://chromium-review.googlesource.com/569553
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486643}
[modify] https://crrev.com/3cecd80780e895d0f1c6e72e93f52ce5a75bb029/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 18 by bugdroid1@chromium.org, Jul 14 2017

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

commit e6b12333c6b5ce96fffa6fd1059ae42484da432f
Author: yoichio <yoichio@chromium.org>
Date: Fri Jul 14 07:09:40 2017

Introduce LayoutSelection::SelectionStart()/End() to TouchAdjustment.

Since integers returned by SelectionStartEnd() don't relate 
each other if start LayoutObject != end LayoutObject.
To emphasize that for readability, we should split it.

Bug:  739062 
Change-Id: I9609262fe2aeb63a49fa95a4d17de66c167d92f8
Reviewed-on: https://chromium-review.googlesource.com/566268
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Kent Tamura <tkent@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486695}
[modify] https://crrev.com/e6b12333c6b5ce96fffa6fd1059ae42484da432f/third_party/WebKit/Source/core/editing/FrameSelection.cpp
[modify] https://crrev.com/e6b12333c6b5ce96fffa6fd1059ae42484da432f/third_party/WebKit/Source/core/editing/FrameSelection.h
[modify] https://crrev.com/e6b12333c6b5ce96fffa6fd1059ae42484da432f/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/e6b12333c6b5ce96fffa6fd1059ae42484da432f/third_party/WebKit/Source/core/editing/LayoutSelection.h
[modify] https://crrev.com/e6b12333c6b5ce96fffa6fd1059ae42484da432f/third_party/WebKit/Source/core/page/TouchAdjustment.cpp

Project Member

Comment 19 by bugdroid1@chromium.org, Jul 14 2017

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

commit e4584af3301f632a8ea7e5639f111729c7ec03af
Author: Yoichi Osato <yoichio@chromium.org>
Date: Fri Jul 14 10:55:17 2017

Order start and end before canonicalization in LayoutSelection::CalcSelection

This is preparation to split LayoutSelection start/end calculation w/o 
canonicalization.

Bug:  739062 
Change-Id: I8574fec9a82433e0b7313499db2f3068d9388b22
Reviewed-on: https://chromium-review.googlesource.com/571523
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#486725}
[modify] https://crrev.com/e4584af3301f632a8ea7e5639f111729c7ec03af/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 20 by bugdroid1@chromium.org, Jul 19 2017

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

commit cb183afb3c6af0261c3aaa27f2f85d9a31168ec4
Author: Yoichi Osato <yoichio@chromium.org>
Date: Wed Jul 19 08:11:06 2017

Move the end of traversing LayoutObject to SelectionPaintRange member

Instead of calculating the stop LayoutObject, compute it in 
SelectionPaintRange constructor.

This is preparation for splitting SelectionState marking and
 invalidation.

Bug:  739062 
Change-Id: I97083643ca9beb010f879b5c5048d71ce1783ed8
Reviewed-on: https://chromium-review.googlesource.com/577327
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487789}
[modify] https://crrev.com/cb183afb3c6af0261c3aaa27f2f85d9a31168ec4/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/cb183afb3c6af0261c3aaa27f2f85d9a31168ec4/third_party/WebKit/Source/core/editing/LayoutSelection.h

Project Member

Comment 21 by bugdroid1@chromium.org, Jul 20 2017

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

commit 3d7ec41e78e7647fb23d8a5d5fad698696679588
Author: yoichio <yoichio@chromium.org>
Date: Thu Jul 20 02:04:14 2017

Introduce LayoutSelection::SelectionStart()/End() to LayoutText.

Since integers returned by SelectionStartEnd() don't relate 
each other except start LayoutObject == end LayoutObject.
To emphasize that for readability, we should split it.

Bug:  739062 
Change-Id: I81011fcbdbff0f17c3ff8917e1dca1101b89712e
Reviewed-on: https://chromium-review.googlesource.com/577432
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488095}
[modify] https://crrev.com/3d7ec41e78e7647fb23d8a5d5fad698696679588/third_party/WebKit/Source/core/layout/LayoutText.cpp

Project Member

Comment 22 by bugdroid1@chromium.org, Jul 20 2017

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

commit 24652e9fb200670425858704c789802b37ac31d2
Author: yoichio <yoichio@chromium.org>
Date: Thu Jul 20 02:47:30 2017

Remove redundant selection judge from EmbeddedContentPainter

EmbeddedContentPainter::IsSelected() is used to decide if paint 
 selection or not.
This function is strange because it refers selection_start/end.
That's because seletion_start/end means offset in the layout object
 and since replaced element neither be text nor have child 
LayoutObject.
Thus we should just consider SelectionState is kNone or not.

Bug:  739062 
Change-Id: I249d8c2acef959ad437f3a636a490f42b61270e0
Reviewed-on: https://chromium-review.googlesource.com/575126
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488109}
[modify] https://crrev.com/24652e9fb200670425858704c789802b37ac31d2/third_party/WebKit/Source/core/paint/EmbeddedContentPainter.cpp

Project Member

Comment 23 by bugdroid1@chromium.org, Jul 20 2017

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

commit 7add13b6fbbc1420658f5f5e67841c80d35d4c34
Author: Yoichi Osato <yoichio@chromium.org>
Date: Thu Jul 20 07:12:24 2017

Introduce local SelectionMarkingRange class into LayoutSelection.cpp

Since we can split marking SelectionState and invalidate painted
 LayoutObject.
SelectionPaintRange has both info but we should split it.
This patch introduces SelectionMarkingRange which is just
 copy from SelectionPaintRange class.
I will drop unused functionality from each class in later patches.

Bug:  739062 
Change-Id: I6ffececbf96228f1b7593ac82e49632b1a348760
Reviewed-on: https://chromium-review.googlesource.com/578701
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488158}
[modify] https://crrev.com/7add13b6fbbc1420658f5f5e67841c80d35d4c34/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/7add13b6fbbc1420658f5f5e67841c80d35d4c34/third_party/WebKit/Source/core/editing/LayoutSelection.h

Project Member

Comment 24 by bugdroid1@chromium.org, Jul 20 2017

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

commit b0635479412bc56ee99dac52d5d08107aa28c979
Author: Yoichi Osato <yoichio@chromium.org>
Date: Thu Jul 20 11:34:34 2017

Reuse SelectionPaintRange::Iterator as SelectionMarkingRange::Iterator.

As copied, they are exactly same.

Bug:  739062 
Change-Id: I96e564362c50a2519b6a4358b609ea58119c70a0
Reviewed-on: https://chromium-review.googlesource.com/578970
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488197}
[modify] https://crrev.com/b0635479412bc56ee99dac52d5d08107aa28c979/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 25 by bugdroid1@chromium.org, Jul 21 2017

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

commit b3892ae2e8a1fbf297a8f6e39415c88aa2535c04
Author: Yoichi Osato <yoichio@chromium.org>
Date: Fri Jul 21 02:35:43 2017

Revert "Move the end of traversing LayoutObject to SelectionPaintRange member"

This reverts commit cb183afb3c6af0261c3aaa27f2f85d9a31168ec4.

Reason for revert: We should calculate traverse stop LayoutObject
 just-in-time because we clear selection when any LayoutObject which 
selectionState is not kNone is removed and traverse stop LayoutObject
 is usually not marked in-selection.
That means we might access invalid stop LayoutObject if it is 
 removed.


Original change's description:
> Move the end of traversing LayoutObject to SelectionPaintRange member
> 
> Instead of calculating the stop LayoutObject, compute it in 
> SelectionPaintRange constructor.
> 
> This is preparation for splitting SelectionState marking and
>  invalidation.
> 
> Bug:  739062 
> Change-Id: I97083643ca9beb010f879b5c5048d71ce1783ed8
> Reviewed-on: https://chromium-review.googlesource.com/577327
> Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
> Commit-Queue: Yoichi Osato <yoichio@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#487789}

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

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

Bug:  739062 
Change-Id: Ia15d820b3cabb86cfeae3f8c0323284ae5ca5a23
Reviewed-on: https://chromium-review.googlesource.com/579347
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488557}
[modify] https://crrev.com/b3892ae2e8a1fbf297a8f6e39415c88aa2535c04/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/b3892ae2e8a1fbf297a8f6e39415c88aa2535c04/third_party/WebKit/Source/core/editing/LayoutSelection.h

Project Member

Comment 26 by bugdroid1@chromium.org, Jul 21 2017

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

commit b01aeaab51db1e4a92a2886fa817f32fad7b2534
Author: Yoichi Osato <yoichio@chromium.org>
Date: Fri Jul 21 04:37:43 2017

Remove redundant conditional in LayutSelection::UpdateLayoutObjectState

That condition is used to consider "if LayoutObject state is still
same but offset is changed, we should invalidate it".
However since |new_selected_map| includes start and end LO, even if
 we don't invalidate in this loop, we invalidate them in just below
 loop.

Bug:  739062 
Change-Id: I6ab6770565b8852260a226f208923d3b20492af9
Reviewed-on: https://chromium-review.googlesource.com/578968
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488583}
[modify] https://crrev.com/b01aeaab51db1e4a92a2886fa817f32fad7b2534/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 27 by bugdroid1@chromium.org, Jul 21 2017

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

commit 0a7509deb2b3ea467f410507ab01db754a06fd47
Author: yoichio <yoichio@chromium.org>
Date: Fri Jul 21 05:00:35 2017

Use LayoutSelection::SelectionStart()/End() instead of SelectionStartEnd in InlineTextBox.

Since integers returned by SelectionStartEnd() don't relate 
each other except start LayoutObject == end LayoutObject.
To emphasize that for readability, we should split SelectionStartEnd
 to each SelectionStart and SelectionEnd.

Bug:  739062 
Change-Id: Iacb552ea21ea36fc1769d295eaaadec59b8b20b4
Reviewed-on: https://chromium-review.googlesource.com/577986
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488585}
[modify] https://crrev.com/0a7509deb2b3ea467f410507ab01db754a06fd47/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp

Project Member

Comment 28 by bugdroid1@chromium.org, Jul 25 2017

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

commit f88b1b47594ebba08774469a5f236055104c0381
Author: Yoichi Osato <yoichio@chromium.org>
Date: Tue Jul 25 10:42:14 2017

Simplify invalidation in LayoutSelection

We invalidate each LayoutObject which is
- included in new selection range and
 has valid SelectionState(!= kNone).
- included in old selection range

This CL refines invalidation algorithm w/o comparing old-new
 SelectionState so that
- we can only have Set<LayoutObject> instead of HashMap<LayoutObject.,SelectionState>
- we can update SelectionState w/o recording old state.

This is preparation to traverse LayoutObjects on flat tree.

Bug:  739062 
Change-Id: I8e96d866f05bfb6f87cb43a23d85b51d5d2bb153
Reviewed-on: https://chromium-review.googlesource.com/582673
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489272}
[modify] https://crrev.com/f88b1b47594ebba08774469a5f236055104c0381/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 29 by bugdroid1@chromium.org, Jul 26 2017

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

commit 3a60b020bf35bc4ba48bf85e71acffd76de43360
Author: yoichio <yoichio@chromium.org>
Date: Wed Jul 26 02:57:34 2017

Remove InlineBox::HasSelectedChildren().

No one use the property since:
https://codereview.chromium.org/1642223002

I'm not sure why we share bitfield between |HasSelectedChildren| and
 |CanHaveLeadingExpansion|, which was introduced:
 https://bugs.webkit.org/show_bug.cgi?id=57106
But I don't see the reason and valid usage path 
 from |SetHasSelectedChildren()| to |CanHaveLeadingExpansion()|.

Bug:  739062 
Change-Id: Ic893f745ea51c8c90da3610e506f297606a92ac1
Reviewed-on: https://chromium-review.googlesource.com/583977
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489538}
[modify] https://crrev.com/3a60b020bf35bc4ba48bf85e71acffd76de43360/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
[modify] https://crrev.com/3a60b020bf35bc4ba48bf85e71acffd76de43360/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
[modify] https://crrev.com/3a60b020bf35bc4ba48bf85e71acffd76de43360/third_party/WebKit/Source/core/layout/LayoutListMarker.cpp
[modify] https://crrev.com/3a60b020bf35bc4ba48bf85e71acffd76de43360/third_party/WebKit/Source/core/layout/LayoutReplaced.cpp
[modify] https://crrev.com/3a60b020bf35bc4ba48bf85e71acffd76de43360/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/3a60b020bf35bc4ba48bf85e71acffd76de43360/third_party/WebKit/Source/core/layout/line/InlineBox.h
[modify] https://crrev.com/3a60b020bf35bc4ba48bf85e71acffd76de43360/third_party/WebKit/Source/core/layout/line/RootInlineBox.h

Project Member

Comment 30 by bugdroid1@chromium.org, Jul 26 2017

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

commit 5252bf14ab5992b9633257b532157ef21128c687
Author: Yoichi Osato <yoichio@chromium.org>
Date: Wed Jul 26 09:47:22 2017

Move set SelectionState and collect invalidation set

Move the process just after getting start/end LayoutObjects
(from old:L303 to new:L423).
For moving, this CL also appends SelectionMarkingRange::PaintInvalidationSet.
This is preparation to let the process traverse
 on flat tree.

Bug:  739062 
Change-Id: I53216ca713ecf9746e68a76305284c43b0cf3f18
Reviewed-on: https://chromium-review.googlesource.com/585336
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489592}
[modify] https://crrev.com/5252bf14ab5992b9633257b532157ef21128c687/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 31 by bugdroid1@chromium.org, Jul 26 2017

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

commit 3050c92629b82edce0c74dcddce7cf836a39f046
Author: Yoichi Osato <yoichio@chromium.org>
Date: Wed Jul 26 11:00:09 2017

Repaint selection even if SelectionPaintRange is same to previous.

We didn't anything if we have same {LayoutObject,offset}s but
 we need to repaint in the case where just CSS display property is
updated.

Bug:  739062 ,  639830 
Change-Id: I2a9c7d69a87119dbc7679d1213ca39e8b277f7d3
Reviewed-on: https://chromium-review.googlesource.com/584665
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489605}
[add] https://crrev.com/3050c92629b82edce0c74dcddce7cf836a39f046/third_party/WebKit/LayoutTests/paint/selection/text-selection-update-style-expected.txt
[add] https://crrev.com/3050c92629b82edce0c74dcddce7cf836a39f046/third_party/WebKit/LayoutTests/paint/selection/text-selection-update-style.html
[modify] https://crrev.com/3050c92629b82edce0c74dcddce7cf836a39f046/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection-after-remove-expected.txt
[modify] https://crrev.com/3050c92629b82edce0c74dcddce7cf836a39f046/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection-after-remove-expected.txt
[add] https://crrev.com/3050c92629b82edce0c74dcddce7cf836a39f046/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-update-style-expected.png
[modify] https://crrev.com/3050c92629b82edce0c74dcddce7cf836a39f046/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection-after-remove-expected.txt
[add] https://crrev.com/3050c92629b82edce0c74dcddce7cf836a39f046/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-update-style-expected.png
[modify] https://crrev.com/3050c92629b82edce0c74dcddce7cf836a39f046/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 32 by bugdroid1@chromium.org, Jul 28 2017

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

commit ebe5d3ac1cb1f5ec3221467b8263f6e107c4c4be
Author: Yoichi Osato <yoichio@chromium.org>
Date: Fri Jul 28 06:35:32 2017

Move canonicalization just before getting LayoutObjects.

Move CreateVisiblePosition from CalcSelection to CalcSelectionRangeAndSetSelectionState
 so that we can focus on traversing algorithm.

This is preparation to let the process traverse on flat tree.

Bug:  739062 

Change-Id: Ieac379cb9dbf8f6bf7e59ebbd29e255b99f30b1a
Reviewed-on: https://chromium-review.googlesource.com/588809
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490300}
[modify] https://crrev.com/ebe5d3ac1cb1f5ec3221467b8263f6e107c4c4be/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 33 by bugdroid1@chromium.org, Aug 4 2017

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

commit 1d3f2f6aca0f08ed8ac3fe8203921744d8d91b87
Author: Yoichi Osato <yoichio@chromium.org>
Date: Fri Aug 04 10:31:47 2017

Traverse on flat tree to mark and invalidate kInside LayoutObject in LayoutSelection

We mark and invalidate LayoutObject by
- finding first/last LayoutObject by canonicalization and
- traverse on layout tree
However we can those operation at once by traversing flat tree.
For that, this CL changes SelectionState::kInside marking from layout tree to flat tree.
I will change kStart/kEnd marking.
Core part is L517-L549, which replaces old SetSelectionState and CollectInvalidationSet.

LayoutSelectionTest.cpp:
 It traverses LayoutTree using NextInPreorder() and confirm each SelectionState
 and ShouldInvalidateSelection bit.
 This CL introduces InsertLayoutObjectAndAncestorBlocks() from CollectInvalidationSet()
 to construct PaintInvalidationSet in SetShouldInvalidateSelection().

Test expectations update:
 Since we traverse on flat tree, we skip pseudo element, or list style marker.

Bug:  739062 
Change-Id: I0717340fb7eef2c130d1281c2c9f5d8ff9b9b586
Reviewed-on: https://chromium-review.googlesource.com/593529
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Walter Korman <wkorman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491988}
[modify] https://crrev.com/1d3f2f6aca0f08ed8ac3fe8203921744d8d91b87/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/selection-background-color-of-image-list-style-expected.png
[modify] https://crrev.com/1d3f2f6aca0f08ed8ac3fe8203921744d8d91b87/third_party/WebKit/LayoutTests/platform/linux/fast/lists/markers-in-selection-expected.png
[modify] https://crrev.com/1d3f2f6aca0f08ed8ac3fe8203921744d8d91b87/third_party/WebKit/LayoutTests/platform/mac/fast/backgrounds/selection-background-color-of-image-list-style-expected.png
[modify] https://crrev.com/1d3f2f6aca0f08ed8ac3fe8203921744d8d91b87/third_party/WebKit/LayoutTests/platform/mac/fast/lists/markers-in-selection-expected.png
[modify] https://crrev.com/1d3f2f6aca0f08ed8ac3fe8203921744d8d91b87/third_party/WebKit/LayoutTests/platform/win/fast/backgrounds/selection-background-color-of-image-list-style-expected.png
[modify] https://crrev.com/1d3f2f6aca0f08ed8ac3fe8203921744d8d91b87/third_party/WebKit/LayoutTests/platform/win/fast/lists/markers-in-selection-expected.png
[modify] https://crrev.com/1d3f2f6aca0f08ed8ac3fe8203921744d8d91b87/third_party/WebKit/Source/core/editing/BUILD.gn
[modify] https://crrev.com/1d3f2f6aca0f08ed8ac3fe8203921744d8d91b87/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/1d3f2f6aca0f08ed8ac3fe8203921744d8d91b87/third_party/WebKit/Source/core/editing/LayoutSelection.h
[add] https://crrev.com/1d3f2f6aca0f08ed8ac3fe8203921744d8d91b87/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp

Project Member

Comment 34 by bugdroid1@chromium.org, Aug 8 2017

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

commit ac04325a74a0a668600ded74c3cfea689f17634c
Author: Yoichi Osato <yoichio@chromium.org>
Date: Tue Aug 08 09:12:34 2017

Find first paintable LayoutObject w/o canonicalization.

It is straightforward to find first paintable LayoutObject traversing
 on flat tree rather than canonicalization, which considers
editability, upstream or so and they don't relate to selection painting.


Bug:  739062 
Change-Id: I94f47ee3563ff25ebb920021036107b31764e32f
Reviewed-on: https://chromium-review.googlesource.com/602844
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492577}
[modify] https://crrev.com/ac04325a74a0a668600ded74c3cfea689f17634c/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 36 by bugdroid1@chromium.org, Aug 10 2017

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

commit 0b075b51c4e1b84849cfc87ab37b9ca746e73513
Author: Yoichi Osato <yoichio@chromium.org>
Date: Thu Aug 10 06:33:50 2017

Brush up LayoutSelectionTest

Enable Invalidation test and clean up code.
This patch does:
- Move TestNextLayoutObject functions to local static.
- Define Next() to traverse LayoutObject tree.
- Define enum InvalidateOption to test SelectionState::kNone and
 ShouldInvalidation(L51, L247)
- Improve macro for short code(L97).

Bug:  739062 
Change-Id: Ia6154d3273d529ac5268ef261d2199a3f8c421a9
Reviewed-on: https://chromium-review.googlesource.com/609051
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493310}
[modify] https://crrev.com/0b075b51c4e1b84849cfc87ab37b9ca746e73513/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/0b075b51c4e1b84849cfc87ab37b9ca746e73513/third_party/WebKit/Source/core/editing/LayoutSelection.h
[modify] https://crrev.com/0b075b51c4e1b84849cfc87ab37b9ca746e73513/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp

Project Member

Comment 37 by bugdroid1@chromium.org, Aug 16 2017

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

commit 5432ec0c90b5f5d1c9802c1a676e2bff491fd957
Author: yoichio <yoichio@chromium.org>
Date: Wed Aug 16 10:42:27 2017

Adapt assert_selection to editing/execCommand/5481523.html

Convert editing/execCommand/5481523.html to indent-table-twice.html

Bug:  739062 ,679977
Change-Id: Ieb1cafdb5a9bf73bf0d41486d321a12ce6175dec
Reviewed-on: https://chromium-review.googlesource.com/609568
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#494744}
[modify] https://crrev.com/5432ec0c90b5f5d1c9802c1a676e2bff491fd957/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[delete] https://crrev.com/841a2089c6241c63fdf92c0bb96593cff34d6b8b/third_party/WebKit/LayoutTests/editing/execCommand/5481523.html
[delete] https://crrev.com/841a2089c6241c63fdf92c0bb96593cff34d6b8b/third_party/WebKit/LayoutTests/platform/linux/editing/execCommand/5481523-expected.png
[delete] https://crrev.com/841a2089c6241c63fdf92c0bb96593cff34d6b8b/third_party/WebKit/LayoutTests/platform/linux/editing/execCommand/5481523-expected.txt
[delete] https://crrev.com/841a2089c6241c63fdf92c0bb96593cff34d6b8b/third_party/WebKit/LayoutTests/platform/mac/editing/execCommand/5481523-expected.png
[delete] https://crrev.com/841a2089c6241c63fdf92c0bb96593cff34d6b8b/third_party/WebKit/LayoutTests/platform/mac/editing/execCommand/5481523-expected.txt
[delete] https://crrev.com/841a2089c6241c63fdf92c0bb96593cff34d6b8b/third_party/WebKit/LayoutTests/platform/win/editing/execCommand/5481523-expected.png
[delete] https://crrev.com/841a2089c6241c63fdf92c0bb96593cff34d6b8b/third_party/WebKit/LayoutTests/platform/win/editing/execCommand/5481523-expected.txt

Project Member

Comment 38 by bugdroid1@chromium.org, Aug 21 2017

Project Member

Comment 39 by bugdroid1@chromium.org, Aug 23 2017

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

commit bbcefe73280faa1c5b52349df11f45906ce14d44
Author: Yoichi Osato <yoichio@chromium.org>
Date: Wed Aug 23 23:39:31 2017

Find last paintable LayoutObject w/o canonicalization.

This CL stops truncating end line wrapping in selection painting.
See LayoutTests/paint/invalidation/*.png diffs. We now paint end line
 wrapping if we select all text like "foo\n". Firefox also paints
 same.
By removing canonicalization, we also paint exact text w/o line wrapping
 if text doesn't contain line wrapping
(see editing/selection/range-between-block-and-inline.html).

Following is implement details.
This CL mainly changes loop process(L416-) and finding offsets(L438).
L416:
 |start_layout_object|: Move offset calculating later.
 |end_layout_object|: Assigned each last LayoutObject.
 If we find new last LayoutObject, we mark previous one as kInside.

L438:
 Define ComputeStart/EndOffset to compute each offset. We should
 return valid Optional<int> only if LayoutObject is text.

SelectionPaintRange::Iterator::Iterator:
 We use just |end_layout_object->NextInPreorder()| as stop object
 because now |end_layout_object| is exactly end object in LayoutTree.
This makes code much clean.

Bug:  739062 ,  756358 
Change-Id: Ibe4c07cc9b88fb7369b533db9eb6e0f974b2f3ae
Reviewed-on: https://chromium-review.googlesource.com/607743
Reviewed-by: Walter Korman <wkorman@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#496868}
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/paint/invalidation/selection-change-in-iframe-with-relative-parent-expected.txt
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/paint/invalidation/selection-clear-after-move-expected.txt
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/linux/editing/selection/range-between-block-and-inline-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/linux/editing/selection/replaced-boundaries-3-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/delete-into-nested-block-expected.txt
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection-partial-invalidation-between-blocks-expected.txt
[copy] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/linux/paint/selection/text-selection-inline-block-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/linux/paint/selection/text-selection-newline-clipped-by-overflow-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/linux/paint/selection/text-selection-newline-rtl-double-linebreak-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/selection/replaced-boundaries-3-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac-mac10.11/editing/selection/replaced-boundaries-3-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac-mac10.9/editing/selection/replaced-boundaries-3-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac-retina/editing/selection/replaced-boundaries-3-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/editing/selection/range-between-block-and-inline-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/editing/selection/replaced-boundaries-3-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/delete-into-nested-block-expected.txt
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection-partial-invalidation-between-blocks-expected.txt
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-includes-newline-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-lr-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.png
[copy] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-inline-block-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-newline-across-blocks-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-newline-br-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-newline-clipped-by-overflow-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-newline-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-newline-rtl-double-linebreak-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-newline-rtl-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-newline-span-across-line-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-newline-span-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-newline-vertical-lr-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/mac/paint/selection/text-selection-newline-vertical-rl-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/editing/selection/range-between-block-and-inline-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/editing/selection/replaced-boundaries-3-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/delete-into-nested-block-expected.txt
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection-partial-invalidation-between-blocks-expected.txt
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-includes-newline-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-lr-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.png
[rename] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-inline-block-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-newline-across-blocks-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-newline-br-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-newline-clipped-by-overflow-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-newline-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-newline-rtl-double-linebreak-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-newline-rtl-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-newline-span-across-line-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-newline-span-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-newline-vertical-lr-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/LayoutTests/platform/win/paint/selection/text-selection-newline-vertical-rl-expected.png
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/Source/core/editing/LayoutSelection.h
[modify] https://crrev.com/bbcefe73280faa1c5b52349df11f45906ce14d44/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp

Project Member

Comment 40 by bugdroid1@chromium.org, Aug 28 2017

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

commit c178bc0c8bda0757acb5d6521bf50559e11f508b
Author: yoichio <yoichio@chromium.org>
Date: Mon Aug 28 07:02:11 2017

Remove SelectionStartEnd functions.

We use SelectionStart() and SelectionEnd() instead.
No one use SelectionStartEnd() any more.

Bug:  739062 
Change-Id: I114c59f70cf9afe71e8b9d869c3c567af819995c
Reviewed-on: https://chromium-review.googlesource.com/584557
Commit-Queue: 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@{#497702}
[modify] https://crrev.com/c178bc0c8bda0757acb5d6521bf50559e11f508b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
[modify] https://crrev.com/c178bc0c8bda0757acb5d6521bf50559e11f508b/third_party/WebKit/Source/core/editing/FrameSelection.h
[modify] https://crrev.com/c178bc0c8bda0757acb5d6521bf50559e11f508b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/c178bc0c8bda0757acb5d6521bf50559e11f508b/third_party/WebKit/Source/core/editing/LayoutSelection.h
[modify] https://crrev.com/c178bc0c8bda0757acb5d6521bf50559e11f508b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
[modify] https://crrev.com/c178bc0c8bda0757acb5d6521bf50559e11f508b/third_party/WebKit/Source/core/layout/LayoutObject.h
[modify] https://crrev.com/c178bc0c8bda0757acb5d6521bf50559e11f508b/third_party/WebKit/Source/core/layout/api/LineLayoutText.h

Project Member

Comment 41 by bugdroid1@chromium.org, Aug 30 2017

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

commit bdc9d1e7b3ee463c73a903a56273102d9b02a41a
Author: Yoichi Osato <yoichio@chromium.org>
Date: Wed Aug 30 10:09:22 2017

Reset LayoutTextFragment SelectionState for ::first-letter.

We missed setting SelectionState::kNone for LayoutTextFragment.
The root cause is that SelectionPaintRange::Iterator
 skips not |CanBeSelectionLeaf()| LayoutObject.
|CanBeSelectionLeaf()| is function and it returns |true| if it should be
 selected currently.
However, of course, we should reset SelectionState of LayoutObject which
 is not selection leaf when we clear selection.

Bug:  739062 

Change-Id: I412910ecf0c1cdafadf3032828f72e384557220a
Reviewed-on: https://chromium-review.googlesource.com/642095
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498411}
[modify] https://crrev.com/bdc9d1e7b3ee463c73a903a56273102d9b02a41a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/bdc9d1e7b3ee463c73a903a56273102d9b02a41a/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp

Project Member

Comment 42 by bugdroid1@chromium.org, Sep 25 2017

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

commit 99c0d7367af7478ad77df61a7dbc8017d3292ddd
Author: Yoichi Osato <yoichio@chromium.org>
Date: Mon Sep 25 08:17:32 2017

Add LayoutSelection test for image

This patch also refactors a utility function using closure.

Bug:  739062 
Change-Id: I5ee64113108847b26ff5233845388a2b7d8f67a3
Reviewed-on: https://chromium-review.googlesource.com/680177
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504004}
[modify] https://crrev.com/99c0d7367af7478ad77df61a7dbc8017d3292ddd/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp

Project Member

Comment 43 by bugdroid1@chromium.org, Sep 25 2017

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

commit 9b557551bd084052c974e6479c0e6df3a5014914
Author: Yoichi Osato <yoichio@chromium.org>
Date: Mon Sep 25 08:53:00 2017

Unify SelectionPaintRange and SelectionMarkingRange members.

SelectionMarkingRange was planed to have different structure from
 SelectionPaintRange but as a result, we get exact SelectionPaintRange
 at CalcSelectionRangeAndSetSelectionState().

Bug:  739062 
Change-Id: I8de17b7916bcb186be2e51ee0727043c41a51683
Reviewed-on: https://chromium-review.googlesource.com/637061
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504011}
[modify] https://crrev.com/9b557551bd084052c974e6479c0e6df3a5014914/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/9b557551bd084052c974e6479c0e6df3a5014914/third_party/WebKit/Source/core/editing/LayoutSelection.h

Project Member

Comment 44 by bugdroid1@chromium.org, Sep 25 2017

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

commit ee016dd09a090651c3f012525cfb6c1d0c553327
Author: Yoichi Osato <yoichio@chromium.org>
Date: Mon Sep 25 09:57:16 2017

Add debug utility function in LayoutSelection.cpp

It prints out PaintInvalidationSet.

Bug:  739062 
Change-Id: Ia51d75aca634701cf728778c66a22b41216fac1d
Reviewed-on: https://chromium-review.googlesource.com/680179
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504017}
[modify] https://crrev.com/ee016dd09a090651c3f012525cfb6c1d0c553327/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 45 by bugdroid1@chromium.org, Oct 2 2017

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

commit 3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754
Author: Yoichi Osato <yoichio@chromium.org>
Date: Mon Oct 02 06:03:00 2017

Add PixelTest results for existing selection layout tests.

There are layout tests for selection:
third_party/WebKit/LayoutTests/compositing/squashing/selection-repaint-with-gaps.html
third_party/WebKit/LayoutTests/paint/invalidation/selection/selection-in-composited-scrolling-container.html
third_party/WebKit/LayoutTests/paint/invalidation/selection/selection-in-non-composited-scrolling-container.html

They confirm result as dumped layout and invalidation tree.
Since I will improve invalidation not changing paint result, 
 we need to have pixel results.

Bug:  739062 
Change-Id: I5bda4331ced0fbbbdf1141e4f2782310a58efc01
Reviewed-on: https://chromium-review.googlesource.com/689897
Reviewed-by: Walter Korman <wkorman@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505542}
[modify] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/compositing/squashing/selection-repaint-with-gaps.html
[modify] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/paint/invalidation/selection/selection-in-composited-scrolling-container.html
[modify] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/paint/invalidation/selection/selection-in-non-composited-scrolling-container.html
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/android/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/linux/compositing/squashing/selection-repaint-with-gaps-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/mac-mac10.10/compositing/squashing/selection-repaint-with-gaps-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/mac-mac10.10/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/mac-mac10.10/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/mac-mac10.11/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/mac-mac10.11/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/mac-retina/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/mac-retina/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/mac/compositing/squashing/selection-repaint-with-gaps-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/win/compositing/squashing/selection-repaint-with-gaps-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.png
[add] https://crrev.com/3c14bd3e09fcaf2e3b9a60e7a0a564c3099e9754/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.png

Project Member

Comment 46 by bugdroid1@chromium.org, Oct 5 2017

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

commit 7f5c4e125569b2763c9cc96b39e6ec9be9b4d3a3
Author: Yoichi Osato <yoichio@chromium.org>
Date: Thu Oct 05 04:53:09 2017

Refactor MarkStartAndEndInOneNode()

1. Extract not LayoutText branch to function head.
2. Define const unsigned offsets.

This patch improves readability and is ready for introducing
 Option<int> offset type.

Bug:  739062 
Change-Id: Ia1abddcda7aeaff88b8d3d834f5a1c59ec72b59d
Reviewed-on: https://chromium-review.googlesource.com/700155
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506653}
[modify] https://crrev.com/7f5c4e125569b2763c9cc96b39e6ec9be9b4d3a3/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 47 by bugdroid1@chromium.org, Oct 6 2017

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

commit bd8f601cc21c47175888df3881b3f4d3da472ece
Author: Yoichi Osato <yoichio@chromium.org>
Date: Fri Oct 06 04:51:25 2017

Refine selection paint test

This patch refines selection-repaint-with-gaps.html
It tests selection painting and invalidation.
It used to output layout tree into DOM and confirm its text
dump.
However it also output pixel result so output png was
 strange: it contained painted layer tree text dump.
This patch refines the test to dump:
- *.txt for layer tree
- *.png for paint result only contains selected text.


Bug:  739062 
Change-Id: I60e9b16f2061a77d50e5a65fd287981f63518dc8
Reviewed-on: https://chromium-review.googlesource.com/701938
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506971}
[modify] https://crrev.com/bd8f601cc21c47175888df3881b3f4d3da472ece/third_party/WebKit/LayoutTests/compositing/squashing/selection-repaint-with-gaps.html
[modify] https://crrev.com/bd8f601cc21c47175888df3881b3f4d3da472ece/third_party/WebKit/LayoutTests/platform/linux/compositing/squashing/selection-repaint-with-gaps-expected.png
[modify] https://crrev.com/bd8f601cc21c47175888df3881b3f4d3da472ece/third_party/WebKit/LayoutTests/platform/linux/compositing/squashing/selection-repaint-with-gaps-expected.txt
[delete] https://crrev.com/afad3080010a425b4d362ad2e59b1e379afbbedc/third_party/WebKit/LayoutTests/platform/mac-mac10.10/compositing/squashing/selection-repaint-with-gaps-expected.png
[modify] https://crrev.com/bd8f601cc21c47175888df3881b3f4d3da472ece/third_party/WebKit/LayoutTests/platform/mac/compositing/squashing/selection-repaint-with-gaps-expected.png
[modify] https://crrev.com/bd8f601cc21c47175888df3881b3f4d3da472ece/third_party/WebKit/LayoutTests/platform/mac/compositing/squashing/selection-repaint-with-gaps-expected.txt
[modify] https://crrev.com/bd8f601cc21c47175888df3881b3f4d3da472ece/third_party/WebKit/LayoutTests/platform/win/compositing/squashing/selection-repaint-with-gaps-expected.png
[modify] https://crrev.com/bd8f601cc21c47175888df3881b3f4d3da472ece/third_party/WebKit/LayoutTests/platform/win/compositing/squashing/selection-repaint-with-gaps-expected.txt

Project Member

Comment 48 by bugdroid1@chromium.org, Oct 6 2017

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

commit 3ac58750d4e6f3f15d86f50446c7002487dfa287
Author: Yoichi Osato <yoichio@chromium.org>
Date: Fri Oct 06 05:11:03 2017

Add test cases to LayoutSelectionTest.

Add test cases for
- moving cursor on same text node.
- content editable button.
- clear selection.
- svg text.

This patch is a preparation for solid SelectionState marking:
https://chromium-review.googlesource.com/c/chromium/src/+/689274

Bug:  739062 
Change-Id: Iaba1e30d7de3868fb61abb1f8042a5e65316c066
Reviewed-on: https://chromium-review.googlesource.com/701906
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506975}
[modify] https://crrev.com/3ac58750d4e6f3f15d86f50446c7002487dfa287/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp

Project Member

Comment 49 by bugdroid1@chromium.org, Oct 6 2017

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

commit fdbf0cbe5c1a0325d66e1fe4694f950c2dda298f
Author: Yoichi Osato <yoichio@chromium.org>
Date: Fri Oct 06 06:35:48 2017

Rename struct names in LayoutSelection.cpp

This patch renames PaintInvalidationSet to SelectedLayoutObjects
because we don't invalidate all of them. We won't invalidate them
 either for future marking implementation.

This patch also renames SelectionMarkingRange
to NewPaintRangeAndSelectedLayoutObjects
because |selected_objects_| the structure contains are already
marked and I want to emphasize |paint_range_| is new to be assigned.

This patch is a preparation for clear SelectionState marking:
https://chromium-review.googlesource.com/c/chromium/src/+/689274

Bug:  739062 
Change-Id: Ieb114b9550bf2aefca16ef3784ffb05be64a4cd8
Reviewed-on: https://chromium-review.googlesource.com/702076
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506997}
[modify] https://crrev.com/fdbf0cbe5c1a0325d66e1fe4694f950c2dda298f/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 50 by bugdroid1@chromium.org, Oct 11 2017

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

commit b4a772544ef49487fdb1da34cedb575e9d9dc771
Author: Yoichi Osato <yoichio@chromium.org>
Date: Wed Oct 11 02:38:24 2017

Refactor MarkStartAndEndInTwoNodes() in LayoutSelection.

|MarkStartAndEndInTwoNodes()| sets |SelectionState| into LayoutObjects and
inserts them into |PaintInvalidationSet| and constructs
|SelectionPaintRange|.
Note: SelectionState has kInside, kStart and kEnd.

It expands LayoutObject to LayoutTextfragments if LayoutObject is
LayoutText and compute offsets in a code block, which has many
if-else statements.

This patch simplifies it by extracting LayoutTextFragment and offset
computing part into MarkStart/End().

Bug:  739062 
Change-Id: I7fc8cd35dd20fc7c76be6f973bcded05769d78b1
Reviewed-on: https://chromium-review.googlesource.com/644649
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507868}
[modify] https://crrev.com/b4a772544ef49487fdb1da34cedb575e9d9dc771/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 51 by bugdroid1@chromium.org, Oct 12 2017

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

commit 2726bde44486286390e242b1145ac80e445ca529
Author: Yoichi Osato <yoichio@chromium.org>
Date: Thu Oct 12 01:57:46 2017

Don't invalidate containing blocks for Selection paint.

We used to invalidate containing layout blocks of each
LayoutObject in selection to paint filling gaps between them.
However we don't paint such gap.
Thus we can remove such code path.

All updated layout test results show only
removing such redundant layout block invalidation.
All of them have expected.pngs and this patch don't change
any paint result at all.

Code detail:
|struct SelectedLayoutObjects| consists of |layout_objects| and
|layout_blocks|. |layout_blocks| contains the containing layout blocks.
Since we don't need it, this patch shrinks |SelectedLayoutObjects|
to just the type of |layout_objects|.
We still need to invalidate parent LayoutObject if it is
LayoutSVGText to repaint selection for SVGText.

This patch is a preparation for solid SelectionState marking:
https://chromium-review.googlesource.com/c/chromium/src/+/689274

Bug:  739062 
Change-Id: Icdcc936e47cca634ca4666b3814f04c7267ee7d4
Reviewed-on: https://chromium-review.googlesource.com/704295
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Walter Korman <wkorman@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508219}
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/paint/invalidation/selection-change-in-iframe-with-relative-parent-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-lr-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/linux/compositing/squashing/selection-repaint-with-gaps-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/japanese-rl-selection-repaint-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/repaint-across-writing-mode-boundary-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection-after-remove-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection-clear-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection-partial-invalidation-between-blocks-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection-rl-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-includes-newline-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-lr-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/repaint-rect-for-vertical-writing-mode-with-positioned-root-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/japanese-rl-selection-repaint-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac/compositing/squashing/selection-repaint-with-gaps-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/japanese-rl-selection-repaint-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/repaint-across-writing-mode-boundary-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection-after-remove-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection-clear-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection-partial-invalidation-between-blocks-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection-rl-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-includes-newline-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/repaint-rect-for-vertical-writing-mode-with-positioned-root-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/selection-within-composited-scroller-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win/compositing/squashing/selection-repaint-with-gaps-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/japanese-rl-selection-repaint-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/repaint-across-writing-mode-boundary-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection-after-remove-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection-clear-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection-partial-invalidation-between-blocks-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection-rl-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-includes-newline-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/repaint-rect-for-vertical-writing-mode-with-positioned-root-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/selection-within-composited-scroller-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/LayoutTests/platform/win7/paint/invalidation/japanese-rl-selection-repaint-expected.txt
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/2726bde44486286390e242b1145ac80e445ca529/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp

Project Member

Comment 52 by bugdroid1@chromium.org, Oct 12 2017

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

commit 24c53fcf2a534dbb2f78632f9b610e398179a51c
Author: Yoichi Osato <yoichio@chromium.org>
Date: Thu Oct 12 04:09:28 2017

Revert "Don't invalidate containing blocks for Selection paint."

This reverts commit 2726bde44486286390e242b1145ac80e445ca529.

Reason for revert: It causes test failure:
https://uberchromegw.corp.google.com/i/chromium.memory/builders/Linux%20TSan%20Tests/builds/12685

Original change's description:
> Don't invalidate containing blocks for Selection paint.
> 
> We used to invalidate containing layout blocks of each
> LayoutObject in selection to paint filling gaps between them.
> However we don't paint such gap.
> Thus we can remove such code path.
> 
> All updated layout test results show only
> removing such redundant layout block invalidation.
> All of them have expected.pngs and this patch don't change
> any paint result at all.
> 
> Code detail:
> |struct SelectedLayoutObjects| consists of |layout_objects| and
> |layout_blocks|. |layout_blocks| contains the containing layout blocks.
> Since we don't need it, this patch shrinks |SelectedLayoutObjects|
> to just the type of |layout_objects|.
> We still need to invalidate parent LayoutObject if it is
> LayoutSVGText to repaint selection for SVGText.
> 
> This patch is a preparation for solid SelectionState marking:
> https://chromium-review.googlesource.com/c/chromium/src/+/689274
> 
> Bug:  739062 
> Change-Id: Icdcc936e47cca634ca4666b3814f04c7267ee7d4
> Reviewed-on: https://chromium-review.googlesource.com/704295
> Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
> Reviewed-by: Walter Korman <wkorman@chromium.org>
> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
> Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
> Commit-Queue: Yoichi Osato <yoichio@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#508219}

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

Change-Id: I99b4240f60e19ac97229ec1f80e64844dde73d4d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  739062 
Reviewed-on: https://chromium-review.googlesource.com/714936
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508252}
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/paint/invalidation/selection-change-in-iframe-with-relative-parent-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-lr-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/linux/compositing/squashing/selection-repaint-with-gaps-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/japanese-rl-selection-repaint-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/repaint-across-writing-mode-boundary-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection-after-remove-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection-clear-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection-partial-invalidation-between-blocks-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection-rl-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-includes-newline-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-lr-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/repaint-rect-for-vertical-writing-mode-with-positioned-root-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/japanese-rl-selection-repaint-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac/compositing/squashing/selection-repaint-with-gaps-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/japanese-rl-selection-repaint-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/repaint-across-writing-mode-boundary-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection-after-remove-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection-clear-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection-partial-invalidation-between-blocks-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection-rl-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-includes-newline-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/repaint-rect-for-vertical-writing-mode-with-positioned-root-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/selection-within-composited-scroller-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win/compositing/squashing/selection-repaint-with-gaps-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/japanese-rl-selection-repaint-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/repaint-across-writing-mode-boundary-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection-after-remove-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection-clear-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection-partial-invalidation-between-blocks-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection-rl-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-includes-newline-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/repaint-rect-for-vertical-writing-mode-with-positioned-root-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/selection-within-composited-scroller-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/LayoutTests/platform/win7/paint/invalidation/japanese-rl-selection-repaint-expected.txt
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/24c53fcf2a534dbb2f78632f9b610e398179a51c/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp

Project Member

Comment 53 by bugdroid1@chromium.org, Oct 13 2017

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

commit a56445999783667165dabe5ed082b2cec00247a7
Author: Yoichi Osato <yoichio@chromium.org>
Date: Fri Oct 13 07:29:19 2017

Reland "Don't invalidate containing blocks for Selection paint."

This is reverted for failing LayoutSelectionTest on the linux tsan bot:
https://chromium-review.googlesource.com/c/chromium/src/+/714936
However I could not reproduce the failure. Let me just reland this.

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

Bug:  739062 
Change-Id: Ifbf75b270c101c25588afb12f326b31c9e2d74e4
Reviewed-on: https://chromium-review.googlesource.com/714939
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508636}
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/paint/invalidation/selection-change-in-iframe-with-relative-parent-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-lr-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/linux/compositing/squashing/selection-repaint-with-gaps-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/japanese-rl-selection-repaint-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/repaint-across-writing-mode-boundary-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection-after-remove-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection-clear-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection-partial-invalidation-between-blocks-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection-rl-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-includes-newline-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-lr-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/repaint-rect-for-vertical-writing-mode-with-positioned-root-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.txt
[add] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/japanese-rl-selection-repaint-expected.txt
[add] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.txt
[add] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac/compositing/squashing/selection-repaint-with-gaps-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/japanese-rl-selection-repaint-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/repaint-across-writing-mode-boundary-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection-after-remove-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection-clear-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection-partial-invalidation-between-blocks-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection-rl-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-includes-newline-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/repaint-rect-for-vertical-writing-mode-with-positioned-root-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/selection/selection-within-composited-scroller-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win/compositing/squashing/selection-repaint-with-gaps-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/japanese-rl-selection-repaint-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/repaint-across-writing-mode-boundary-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection-after-remove-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection-clear-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection-partial-invalidation-between-blocks-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection-rl-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-includes-newline-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/invalidation-rect-with-br-includes-newline-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/repaint-rect-for-vertical-writing-mode-with-positioned-root-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/selection-in-composited-scrolling-container-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/selection-in-non-composited-scrolling-container-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/selection/selection-within-composited-scroller-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/LayoutTests/platform/win7/paint/invalidation/japanese-rl-selection-repaint-expected.txt
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/a56445999783667165dabe5ed082b2cec00247a7/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp

Project Member

Comment 54 by bugdroid1@chromium.org, Oct 16 2017

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

commit aadc264de1e60a3490b61f2df6193b64dd164ac9
Author: Yoichi Osato <yoichio@chromium.org>
Date: Mon Oct 16 08:36:38 2017

Call SetSelectionState() only for leaf LayoutObjects.

This patch stops calling SetSelectionState() for node LayoutObjects which
have children because SetSelectionState() calls parent SetSelectionState(),
that causes inconsistent.

This patch changes |CanBeSelectionLeaf()| to prohibit such LayoutObject.
We also changes |CanBeSelectionLeaf()| return true for only LayoutObject
which can be selection leaf: LayoutText, LayoutImage and
LayoutEmbeddedContent.

Note: CanBeSelectionLeafInternal() is used as whitelist. Classes overrides
this member can be selection leaf:
LayoutButton - text content of BUTTON are selection leaf but BUTTON itself
isn't selection leaf
LayoutReplaced - default to false
LayoutEmbeddedContent(:LayoutReplaced) - should be selection leaf
LayoutImage(:LayoutReplaced) - should be selection leaf
LayoutSVGRoot(:LayoutReplaced) - default to false
LayoutText - should be selection leaf
LayoutBR(:LayoutText) - should be true though we don't
paint at all(See LayoutSelectionTest.TraverseLayoutObjectBRs).
That's because we paint selected line wrapping whitespaces using LayoutText
which is inside selection. How do we deside if LayoutText is inside?
We use SelectionState::kStart or kInside to refcognize that
(See InlineTextBox::HasWrappedSelectionNewline()).
If we don't mark SelectionState for <br> following the LayoutText,
the LayoutText is marked kEnd or kStartAndEnd and we don't paint wrapping
whitespaces.

This patch is a preparation for solid SelectionState marking:
https://chromium-review.googlesource.com/c/chromium/src/+/689274

Bug:  739062 
Change-Id: Iac1cf5be26fc149a6814047085084bfb6f5ab745
Reviewed-on: https://chromium-review.googlesource.com/708574
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508996}
[modify] https://crrev.com/aadc264de1e60a3490b61f2df6193b64dd164ac9/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/aadc264de1e60a3490b61f2df6193b64dd164ac9/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp
[modify] https://crrev.com/aadc264de1e60a3490b61f2df6193b64dd164ac9/third_party/WebKit/Source/core/layout/LayoutButton.h
[modify] https://crrev.com/aadc264de1e60a3490b61f2df6193b64dd164ac9/third_party/WebKit/Source/core/layout/LayoutCounter.h
[modify] https://crrev.com/aadc264de1e60a3490b61f2df6193b64dd164ac9/third_party/WebKit/Source/core/layout/LayoutEmbeddedContent.h
[modify] https://crrev.com/aadc264de1e60a3490b61f2df6193b64dd164ac9/third_party/WebKit/Source/core/layout/LayoutImage.h
[modify] https://crrev.com/aadc264de1e60a3490b61f2df6193b64dd164ac9/third_party/WebKit/Source/core/layout/LayoutListMarker.h
[modify] https://crrev.com/aadc264de1e60a3490b61f2df6193b64dd164ac9/third_party/WebKit/Source/core/layout/LayoutObject.cpp
[modify] https://crrev.com/aadc264de1e60a3490b61f2df6193b64dd164ac9/third_party/WebKit/Source/core/layout/LayoutObject.h
[modify] https://crrev.com/aadc264de1e60a3490b61f2df6193b64dd164ac9/third_party/WebKit/Source/core/layout/LayoutReplaced.h
[modify] https://crrev.com/aadc264de1e60a3490b61f2df6193b64dd164ac9/third_party/WebKit/Source/core/layout/LayoutText.h
[modify] https://crrev.com/aadc264de1e60a3490b61f2df6193b64dd164ac9/third_party/WebKit/Source/core/layout/LayoutTextFragment.h
[modify] https://crrev.com/aadc264de1e60a3490b61f2df6193b64dd164ac9/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.h

Project Member

Comment 55 by bugdroid1@chromium.org, Oct 16 2017

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

commit e7167403c2e9c4684a67a533b77a58655e3d6f5b
Author: Yoichi Osato <yoichio@chromium.org>
Date: Mon Oct 16 09:29:37 2017

Use nullopt for non Text start/end Node in SelectionPaintRange.

We used to return 0 for such Node but the value should
not be used because offset is valid only for Text node.
This patch changes offset type from int to Optional<int> and
returns nullopt for non Text node.

Bug:  739062 
Change-Id: Ia1035ee5f494cb52b1f6ae2fbed73c219a6e8ce7
Reviewed-on: https://chromium-review.googlesource.com/711556
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509002}
[modify] https://crrev.com/e7167403c2e9c4684a67a533b77a58655e3d6f5b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/e7167403c2e9c4684a67a533b77a58655e3d6f5b/third_party/WebKit/Source/core/editing/LayoutSelection.h
[modify] https://crrev.com/e7167403c2e9c4684a67a533b77a58655e3d6f5b/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp

Project Member

Comment 56 by bugdroid1@chromium.org, Oct 27 2017

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

commit d12359d46a29b8a357d84dc0a1e8c6dbba56a671
Author: Yoichi Osato <yoichio@chromium.org>
Date: Fri Oct 27 07:06:39 2017

Refine paint test using Reference Tests

Since this test confirms partially selected text is styled with
::selection, rewrite as ref test for readability and stability.

Bug:  739062 
Change-Id: Idfe83255aaee2e2da77cac27929a73fc23a64ae6
Reviewed-on: https://chromium-review.googlesource.com/735299
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512110}
[add] https://crrev.com/d12359d46a29b8a357d84dc0a1e8c6dbba56a671/third_party/WebKit/LayoutTests/fast/text/selection/selection-painted-separately-expected.html
[delete] https://crrev.com/adad617c371d7b6b1b6b20c03781ff8b2eb50e15/third_party/WebKit/LayoutTests/fast/text/selection/selection-painted-separately-expected.txt
[modify] https://crrev.com/d12359d46a29b8a357d84dc0a1e8c6dbba56a671/third_party/WebKit/LayoutTests/fast/text/selection/selection-painted-separately.html
[delete] https://crrev.com/adad617c371d7b6b1b6b20c03781ff8b2eb50e15/third_party/WebKit/LayoutTests/platform/linux/fast/text/selection/selection-painted-separately-expected.png
[delete] https://crrev.com/adad617c371d7b6b1b6b20c03781ff8b2eb50e15/third_party/WebKit/LayoutTests/platform/mac/fast/text/selection/selection-painted-separately-expected.png
[delete] https://crrev.com/adad617c371d7b6b1b6b20c03781ff8b2eb50e15/third_party/WebKit/LayoutTests/platform/win/fast/text/selection/selection-painted-separately-expected.png
[delete] https://crrev.com/adad617c371d7b6b1b6b20c03781ff8b2eb50e15/third_party/WebKit/LayoutTests/platform/win7/fast/text/selection/selection-painted-separately-expected.png

Project Member

Comment 57 by bugdroid1@chromium.org, Nov 1 2017

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

commit 090ef9237a1e1c0c986532ca76d4b85825d7b496
Author: Yoichi Osato <yoichio@chromium.org>
Date: Wed Nov 01 07:38:51 2017

Reset SelectionState w/o propagation when clear old SeletionState.

We clear old selected but not selected LayoutObject's SelectionState
to kNone using LayoutObject::SetSelectionStateIfNeeded().
However the function calls virtual LayoutObject::SetSelectionState(),
which change containing blocks' SelectionState.
This causes inconsistency that marked not kNone LayoutObject can
accidentally marked kNone.

This patch changes it to call non virtual
LayoutObject::SetSelectionState() and assign kNone SelectionState
to only target old selected LayoutObjects.

Bug:  739062 

Change-Id: I9ca736de43a2a982b1e29a1607325a1b77e3c35f
Reviewed-on: https://chromium-review.googlesource.com/748841
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513096}
[modify] https://crrev.com/090ef9237a1e1c0c986532ca76d4b85825d7b496/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/090ef9237a1e1c0c986532ca76d4b85825d7b496/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp

Project Member

Comment 58 by bugdroid1@chromium.org, Nov 2 2017

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

commit 194b85a283d510c31b4086345038f6643ed8400c
Author: Yoichi Osato <yoichio@chromium.org>
Date: Thu Nov 02 02:19:30 2017

Reset SelectionState w/o propagation when ClearSeletion().

We clear old selected LayoutObject's SelectionState
to kNone using LayoutObject::SetSelectionStateIfNeeded().
However the function calls virtual LayoutObject::SetSelectionState(),
which can change containing blocks' SelectionState.

This patch changes it to call an impl of SetSelectionState() in
LayoutObject and assign kNone SelectionState to only target
old selected LayoutObjects and its containing blocks directly.

This patch is a preparation for minimizing LayoutObject invalidation:
crrev.com/c/720817

Bug:  739062 

Change-Id: I5598e07d3cdb413c99c8e7c24babb923ebe788ae
Reviewed-on: https://chromium-review.googlesource.com/749121
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513379}
[modify] https://crrev.com/194b85a283d510c31b4086345038f6643ed8400c/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 59 by bugdroid1@chromium.org, Nov 3 2017

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

commit 68a0980afbb3a5abcbd433c07f6774b6d732ddc5
Author: Yoichi Osato <yoichio@chromium.org>
Date: Fri Nov 03 07:11:40 2017

Revert "Reset SelectionState w/o propagation when clear old SeletionState."

This reverts commit 090ef9237a1e1c0c986532ca76d4b85825d7b496.

Reason for revert:  crbug.com/780558 

Original change's description:
> Reset SelectionState w/o propagation when clear old SeletionState.
> 
> We clear old selected but not selected LayoutObject's SelectionState
> to kNone using LayoutObject::SetSelectionStateIfNeeded().
> However the function calls virtual LayoutObject::SetSelectionState(),
> which change containing blocks' SelectionState.
> This causes inconsistency that marked not kNone LayoutObject can
> accidentally marked kNone.
> 
> This patch changes it to call non virtual
> LayoutObject::SetSelectionState() and assign kNone SelectionState
> to only target old selected LayoutObjects.
> 
> Bug:  739062 
> 
> Change-Id: I9ca736de43a2a982b1e29a1607325a1b77e3c35f
> Reviewed-on: https://chromium-review.googlesource.com/748841
> Commit-Queue: Yoichi Osato <yoichio@chromium.org>
> Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#513096}

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

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

Bug:  739062 ,  780558 
Change-Id: Ibe0945e61bb87079a4a925799e369e4f1e38662d
Reviewed-on: https://chromium-review.googlesource.com/752781
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513715}
[modify] https://crrev.com/68a0980afbb3a5abcbd433c07f6774b6d732ddc5/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/68a0980afbb3a5abcbd433c07f6774b6d732ddc5/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp

Project Member

Comment 60 by bugdroid1@chromium.org, Nov 16 2017

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

commit 428903983ed7dfb39bf318bf489d5d0bfda3c788
Author: Yoichi Osato <yoichio@chromium.org>
Date: Thu Nov 16 08:45:13 2017

Set SelectionState w/o propagation at LayoutSelection::Commit().

We reassign SelectionState at the end of LayoutSelection::Commit()
to avoid use-after-free.

This patch changes it to call non virtual
LayoutObject::SetSelectionState() and assign SelectionState
to only target LayoutObjects.

Bug:  739062 
Change-Id: I5613257c99332b887501e1bcd4fe27482f9280d0
Reviewed-on: https://chromium-review.googlesource.com/773788
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517031}
[modify] https://crrev.com/428903983ed7dfb39bf318bf489d5d0bfda3c788/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Summary: Brush up SelectionState marking and LayoutObject invalidation (was: Split LayoutSelection::start and end)
Project Member

Comment 62 by bugdroid1@chromium.org, Nov 17 2017

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

commit 1e9c6777efb621794e8385ab9b4faf3546c29bf2
Author: Yoichi Osato <yoichio@chromium.org>
Date: Fri Nov 17 09:37:39 2017

Rename SelectedLayoutObjects variable name.

Rename from |invalidation_set| to |selected_objects| to
correspond the type name.
Plus, they are not always invalidated.

This patch is a preparation for minimizing LayoutObject invalidation:
http://crrev.com/c/720817

Bug:  739062 
Change-Id: I130bcb562606d2e841b5f17881aa1e054ba22f67
Reviewed-on: https://chromium-review.googlesource.com/776342
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517353}
[modify] https://crrev.com/1e9c6777efb621794e8385ab9b4faf3546c29bf2/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 63 by bugdroid1@chromium.org, Nov 21 2017

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

commit 4a569e58960b13c849b9187c3b900828295f8cc9
Author: Yoichi Osato <yoichio@chromium.org>
Date: Tue Nov 21 06:40:51 2017

Change SelectionState of containing blocks to kContain.

Since SelectionState of containing blocks is only used to determine
if child LayoutObjects are selected to invalidate for ::selection style
change(see LayoutObject::InvalidatePaintForSelection()), we don't need
to use kStart,kEnd,, SelectionState for containing blocks.

This patch introduces new SelectionState::kContain to clarify
LayoutObject is a containing block and has selected children.
This patch also has LayoutSelection using only trivial LayoutObject::
SetSelectionState(state) which just assigns |state| to bitfield.

This patch is a preparation for minimizing LayoutObject invalidation:
http://crrev.com/c/720817

Bug:  739062 
Change-Id: I626d2941cc80c4396afdc3e41b97e6b2caddc50b
Reviewed-on: https://chromium-review.googlesource.com/742774
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518152}
[modify] https://crrev.com/4a569e58960b13c849b9187c3b900828295f8cc9/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/4a569e58960b13c849b9187c3b900828295f8cc9/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp
[modify] https://crrev.com/4a569e58960b13c849b9187c3b900828295f8cc9/third_party/WebKit/Source/core/layout/api/SelectionState.cpp
[modify] https://crrev.com/4a569e58960b13c849b9187c3b900828295f8cc9/third_party/WebKit/Source/core/layout/api/SelectionState.h

Project Member

Comment 64 by bugdroid1@chromium.org, Nov 27 2017

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

commit 0b89d8f1cf433f1e2fa0850eb3c234777bf49160
Author: Yoichi Osato <yoichio@chromium.org>
Date: Mon Nov 27 08:24:34 2017

Change LayoutSelection{Start/End}() return type to unsigned.

We get to have fewer static_cast.

Bug:  739062 
Change-Id: I8510edc65653ff9b9ca6ef27fc2225cb4f58cd9e
Reviewed-on: https://chromium-review.googlesource.com/781540
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519245}
[modify] https://crrev.com/0b89d8f1cf433f1e2fa0850eb3c234777bf49160/third_party/WebKit/Source/core/editing/FrameSelection.cpp
[modify] https://crrev.com/0b89d8f1cf433f1e2fa0850eb3c234777bf49160/third_party/WebKit/Source/core/editing/FrameSelection.h
[modify] https://crrev.com/0b89d8f1cf433f1e2fa0850eb3c234777bf49160/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/0b89d8f1cf433f1e2fa0850eb3c234777bf49160/third_party/WebKit/Source/core/editing/LayoutSelection.h
[modify] https://crrev.com/0b89d8f1cf433f1e2fa0850eb3c234777bf49160/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp
[modify] https://crrev.com/0b89d8f1cf433f1e2fa0850eb3c234777bf49160/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/0b89d8f1cf433f1e2fa0850eb3c234777bf49160/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp

Project Member

Comment 65 by bugdroid1@chromium.org, Nov 28 2017

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

commit aff544de660d1a50af52a16f8de0fcff25b8a29b
Author: Yoichi Osato <yoichio@chromium.org>
Date: Tue Nov 28 03:45:48 2017

Rename SetShouldInvalidateIfNeeds().

Rename to SetShouldInvalidateIfNeeded() using more
popular term "IfNeeded" than "IfNeeds":
https://cs.chromium.org/search/?q=ifneeded+file:%5Esrc/third_party/WebKit/+package:%5Echromium$&type=cs

Bug:  739062 
Change-Id: I124a13d27659ff29a5e3c75c45348f64f8815063
Reviewed-on: https://chromium-review.googlesource.com/784744
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519551}
[modify] https://crrev.com/aff544de660d1a50af52a16f8de0fcff25b8a29b/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 66 by bugdroid1@chromium.org, Nov 28 2017

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

commit c33ae2c7a4963b687743bec920d79f9471402474
Author: Yoichi Osato <yoichio@chromium.org>
Date: Tue Nov 28 08:44:43 2017

Invalidate only not kContain/kNone LayoutObject.

We're invalidating kContain LayoutObject at clearing selection,
but we don't need because they are not painted selection.

This patch introduces
|OldSelectedLayoutObjects ResetOldSelectedLayoutObjects()|.
OldSelectedLayoutObjects contains exact LayoutObjects which should be
invalidated which SelectionState is kStart, kEnd, kStartAndEnd or
kInside.

This patch is a preparation for minimizing LayoutObject invalidation:
http://crrev.com/c/720817

Bug:  739062 
Change-Id: I271c429daa6b116e73b2d45603687cd62399c4a6
Reviewed-on: https://chromium-review.googlesource.com/784911
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519613}
[modify] https://crrev.com/c33ae2c7a4963b687743bec920d79f9471402474/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/c33ae2c7a4963b687743bec920d79f9471402474/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp

Project Member

Comment 67 by bugdroid1@chromium.org, Nov 29 2017

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

commit adf1bf61eef82344ba7a22326f7a5f520e5ad182
Author: Yoichi Osato <yoichio@chromium.org>
Date: Wed Nov 29 08:21:49 2017

Add debug functions in LayoutSelection.cpp

Add two functions which print out LayoutObject SelectionState
in SelectionPaintRange and LayoutView.

Bug:  739062 
Change-Id: I729db1d1d0575205fdeb36b59297e5bcc1737f26
Reviewed-on: https://chromium-review.googlesource.com/795274
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520044}
[modify] https://crrev.com/adf1bf61eef82344ba7a22326f7a5f520e5ad182/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 68 by bugdroid1@chromium.org, Nov 29 2017

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

commit e4978a95aa5d30e4d7220257ed0bb5eec755fb66
Author: Yoichi Osato <yoichio@chromium.org>
Date: Wed Nov 29 09:42:19 2017

Compute selection bounds straightforward.

We can compute selection bounds by just traversing SelectionPaintRange
and unify painted LayoutObjects' rectangle w/o CollectInvalidatinSet.

This patch is a preparation for minimizing LayoutObject invalidation:
http://crrev.com/c/720817

Bug:  739062 
Change-Id: Ib661f6233a93728a67cf5f7c8172070e3aa05e6f
Reviewed-on: https://chromium-review.googlesource.com/795493
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520054}
[modify] https://crrev.com/e4978a95aa5d30e4d7220257ed0bb5eec755fb66/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 69 by bugdroid1@chromium.org, Nov 30 2017

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

commit 98d5a361a2475c78c7c746e9cc3284fb548bab5a
Author: Yoichi Osato <yoichio@chromium.org>
Date: Thu Nov 30 07:46:50 2017

Xor LayoutObject invalidation for selection paint.

We used to invalidate all new selected LayoutObjects.
This patch minimizes the invalidation that we only invalidates
newly selected LayoutObjects and not selected LayoutObjects.

LayoutSelection::Commit():
 Before marking newly selected LayoutObjects' SelectionState, we
collect current selected LayoutObjects with its SelectionState
(const OldSelectedLayoutObjects& old_selected_objects).

SetSelectionStateIfNeeded():
 We now use this function only assign new SelectionState and
don't clear SelectionState to kNone with this.

SetShouldInvalidateSelection():
 This is the main change part. We invalidate LayoutObject with
xor algorithm.

Bug:  739062 
Change-Id: I3f800ba42ba3cf64888c8a76d1fc2148ea2bcdb2
Reviewed-on: https://chromium-review.googlesource.com/720817
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520471}
[modify] https://crrev.com/98d5a361a2475c78c7c746e9cc3284fb548bab5a/third_party/WebKit/Source/core/editing/LayoutSelection.cpp
[modify] https://crrev.com/98d5a361a2475c78c7c746e9cc3284fb548bab5a/third_party/WebKit/Source/core/editing/LayoutSelectionTest.cpp

Project Member

Comment 70 by bugdroid1@chromium.org, Dec 1 2017

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

commit 895571d680c5aa0ea923a90dabc072f0e76c7aca
Author: Yoichi Osato <yoichio@chromium.org>
Date: Fri Dec 01 06:09:01 2017

Remove redundant SelectionState reassignment.

Xor invalidation was shipped:
https://chromium-review.googlesource.com/c/chromium/src/+/720817

Then there is no inconsistency SelectionState in layout tree thus
we can just DCHECK its start/end state.

Bug:  739062 
Change-Id: I6bb791568a76d47f7088c692d2960eddc34f570a
Reviewed-on: https://chromium-review.googlesource.com/798995
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520869}
[modify] https://crrev.com/895571d680c5aa0ea923a90dabc072f0e76c7aca/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 71 by bugdroid1@chromium.org, Dec 1 2017

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

commit 93dfcfbfda9c9631dd9373745c0b1e9f46bfba5b
Author: Yoichi Osato <yoichio@chromium.org>
Date: Fri Dec 01 08:03:31 2017

Remove unused SetSelectionStateIfNeeded function.

Xor invalidation was shipped:
https://chromium-review.googlesource.com/c/chromium/src/+/720817

After that, no one use the function.

Bug:  739062 
Change-Id: Ibb585dfac70453f20e3226357d389b440dc0f3be
Reviewed-on: https://chromium-review.googlesource.com/802665
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520886}
[modify] https://crrev.com/93dfcfbfda9c9631dd9373745c0b1e9f46bfba5b/third_party/WebKit/Source/core/layout/LayoutObject.h

Blockedon: 791867
Project Member

Comment 73 by bugdroid1@chromium.org, Dec 5 2017

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

commit 022cebe871e53ec3bc6950f747b27a349a0aaf56
Author: Yoichi Osato <yoichio@chromium.org>
Date: Tue Dec 05 06:34:46 2017

Revert "Remove redundant SelectionState reassignment."

This reverts commit 895571d680c5aa0ea923a90dabc072f0e76c7aca.

Reason for revert: This causes HUA.

Original change's description:
> Remove redundant SelectionState reassignment.
> 
> Xor invalidation was shipped:
> https://chromium-review.googlesource.com/c/chromium/src/+/720817
> 
> Then there is no inconsistency SelectionState in layout tree thus
> we can just DCHECK its start/end state.
> 
> Bug:  739062 
> Change-Id: I6bb791568a76d47f7088c692d2960eddc34f570a
> Reviewed-on: https://chromium-review.googlesource.com/798995
> Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
> Commit-Queue: Yoichi Osato <yoichio@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#520869}

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

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

Bug:  791484 ,  791293 
Change-Id: Ie9679e069bbecc633a5c3818b8c8256598acb433
Reviewed-on: https://chromium-review.googlesource.com/807489
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521625}
[modify] https://crrev.com/022cebe871e53ec3bc6950f747b27a349a0aaf56/third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Project Member

Comment 74 by bugdroid1@chromium.org, Dec 6 2017

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

commit b703e1b06940b11a39e0d6b5b69198f3f51ee923
Author: Yoichi Osato <yoichio@chromium.org>
Date: Wed Dec 06 09:05:08 2017

Get rid of unused function LayoutBoxModelObject::SetSelectionState()

After we remove LayoutBoxModelObject::SetSelectionState() implementation,
LayoutObject::SetSelectionState() is no longer needed to be virtual
since there are no other calls.
Thus, we can remove |virtual| from LayoutObject::SetSelectionState().

Bug:  739062 
Change-Id: I49b1426f9fc89586d1e818b10385c18c5223399e
Reviewed-on: https://chromium-review.googlesource.com/802603
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: yosin (OOO Dec 11 to Jan 8) <yosin@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522048}
[modify] https://crrev.com/b703e1b06940b11a39e0d6b5b69198f3f51ee923/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
[modify] https://crrev.com/b703e1b06940b11a39e0d6b5b69198f3f51ee923/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h
[modify] https://crrev.com/b703e1b06940b11a39e0d6b5b69198f3f51ee923/third_party/WebKit/Source/core/layout/LayoutObject.h
[modify] https://crrev.com/b703e1b06940b11a39e0d6b5b69198f3f51ee923/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/b703e1b06940b11a39e0d6b5b69198f3f51ee923/third_party/WebKit/Source/core/layout/LayoutText.h

Status: Fixed (was: Started)
Blockedon: -791867

Sign in to add a comment