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

Issue 2800813006: Move layouet/LayoutView::setSelection() to editing/LayoutSelection (Closed)

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

Description

Move layout/LayoutView::setSelection() to editing/LayoutSelection This moves layout marking functionality from LayoutView to LayoutSelection to prepare for LayoutNG. This is refatoring but difference of each lifetime makes different LayoutObject member clearing timing(see FrameSelection::ContextDestroyed). Detail: LayoutView:: -SetSelection() -SelectionBounds() -InvalidatePaintForSelection() -selection_start_, selection_end_ -selection_start_pos_, selection_end_pos_ -> move to LayoutSelection. Leave function definition in LayoutView and will move it to LayoutSelection later. ClearSelection(), SelectionStartEnd() They are used from few LayoutObject classes so move function body to LayoutSelection and make LayoutView and FrameSelection proxies. LayoutSelection:: +SetSelection() +SelectionBounds() +InvalidatePaintForSelection() +selection_start_, selection_end_ +selection_start_pos_, selection_end_pos_ +OnDocumentShutdown(); This just clear above 4 members because LayoutSelection lives longer than LayoutView. LayoutViewItem:: -SelectionBounds() -InvalidatePaintForSelection() They are only used from FrameSelection. Since FrameSelection has LayoutSelection, just use it directly. BUG=708453 Review-Url: https://codereview.chromium.org/2800813006 Cr-Commit-Position: refs/heads/master@{#463978} Committed: https://chromium.googlesource.com/chromium/src/+/b33836726c84241997ec990495acd9f9616008d0

Patch Set 1 : update #

Total comments: 5

Patch Set 2 : nit #

Total comments: 2

Patch Set 3 : nit #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -58 lines) Patch
M third_party/WebKit/Source/core/editing/FrameSelection.h View 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/FrameSelection.cpp View 4 chunks +11 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/editing/LayoutSelection.h View 2 chunks +35 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/core/editing/LayoutSelection.cpp View 1 3 chunks +17 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutView.h View 1 2 2 chunks +0 lines, -31 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutView.cpp View 1 2 9 chunks +23 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/layout/api/LayoutViewItem.h View 1 chunk +0 lines, -6 lines 0 comments Download

Messages

Total messages: 39 (25 generated)
yoichio
3 years, 8 months ago (2017-04-10 08:36:39 UTC) #12
yosin_UTC9
lgtm Thanks!
3 years, 8 months ago (2017-04-10 08:56:48 UTC) #13
kojii
Wish to help, but I'm afraid I don't know much about LayoutView, when its frame_view_ ...
3 years, 8 months ago (2017-04-10 15:16:22 UTC) #16
yoichio
Add Emil for layout/ reviewer. Could you take a look?
3 years, 8 months ago (2017-04-11 01:39:06 UTC) #18
kojii
dcheng@, are you familiar with LayoutView and its life cycles?
3 years, 8 months ago (2017-04-11 05:43:15 UTC) #20
dcheng
https://codereview.chromium.org/2800813006/diff/60001/third_party/WebKit/Source/core/editing/LayoutSelection.cpp File third_party/WebKit/Source/core/editing/LayoutSelection.cpp (right): https://codereview.chromium.org/2800813006/diff/60001/third_party/WebKit/Source/core/editing/LayoutSelection.cpp#newcode34 third_party/WebKit/Source/core/editing/LayoutSelection.cpp:34: LayoutSelection::LayoutSelection(FrameSelection& frameSelection) Nit: mind fixing the name to be ...
3 years, 8 months ago (2017-04-11 06:29:15 UTC) #21
yoichio
https://codereview.chromium.org/2800813006/diff/60001/third_party/WebKit/Source/core/editing/LayoutSelection.cpp File third_party/WebKit/Source/core/editing/LayoutSelection.cpp (right): https://codereview.chromium.org/2800813006/diff/60001/third_party/WebKit/Source/core/editing/LayoutSelection.cpp#newcode34 third_party/WebKit/Source/core/editing/LayoutSelection.cpp:34: LayoutSelection::LayoutSelection(FrameSelection& frameSelection) On 2017/04/11 06:29:14, dcheng wrote: > Nit: ...
3 years, 8 months ago (2017-04-11 07:23:58 UTC) #25
yoichio
PTAL.
3 years, 8 months ago (2017-04-12 01:49:09 UTC) #28
dcheng
LGTM https://codereview.chromium.org/2800813006/diff/100001/third_party/WebKit/Source/core/layout/LayoutView.cpp File third_party/WebKit/Source/core/layout/LayoutView.cpp (right): https://codereview.chromium.org/2800813006/diff/100001/third_party/WebKit/Source/core/layout/LayoutView.cpp#newcode840 third_party/WebKit/Source/core/layout/LayoutView.cpp:840: if (!frame_selection_->GetDocument().GetLayoutView()->GetFrameView()) Nit: add a TODO to try ...
3 years, 8 months ago (2017-04-12 07:20:50 UTC) #29
eae
LGTM Lifecycle looks fine, thanks for checking!
3 years, 8 months ago (2017-04-12 07:35:31 UTC) #30
yoichio
Thanks all for reviewing! https://codereview.chromium.org/2800813006/diff/100001/third_party/WebKit/Source/core/layout/LayoutView.cpp File third_party/WebKit/Source/core/layout/LayoutView.cpp (right): https://codereview.chromium.org/2800813006/diff/100001/third_party/WebKit/Source/core/layout/LayoutView.cpp#newcode840 third_party/WebKit/Source/core/layout/LayoutView.cpp:840: if (!frame_selection_->GetDocument().GetLayoutView()->GetFrameView()) On 2017/04/12 07:20:50, ...
3 years, 8 months ago (2017-04-12 08:12:19 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2800813006/120001
3 years, 8 months ago (2017-04-12 08:12:38 UTC) #34
commit-bot: I haz the power
Committed patchset #3 (id:120001) as https://chromium.googlesource.com/chromium/src/+/b33836726c84241997ec990495acd9f9616008d0
3 years, 8 months ago (2017-04-12 10:01:23 UTC) #37
hugoh_UTC2
3 years, 8 months ago (2017-04-13 06:53:04 UTC) #39
Message was sent while issue was closed.
https://codereview.chromium.org/2800813006/diff/120001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/editing/LayoutSelection.h (right):

https://codereview.chromium.org/2800813006/diff/120001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/editing/LayoutSelection.h:78: //
|m_selectionStartPos| and |m_selectionEndPos| are only valid for
Post-merge nit: we should update the comment, now that m_selectionStartPos is
renamed to selection_start_pos_ etc.

Powered by Google App Engine
This is Rietveld 408576698