New issue
Advanced search Search tips

Issue 660320 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Task



Sign in to add a comment

Make VisibleSelection as immutable

Project Member Reported by yosin@chromium.org, Oct 28 2016

Issue description

Like VisiblePosition and Position.

We should get rid of following member functions in VisbileSelection
 - setBase
 - setExtent
 - appendTrailingWhitespace
 - expandUsingGranularity
 
Project Member

Comment 1 by bugdroid1@chromium.org, Oct 31 2016

Project Member

Comment 2 by bugdroid1@chromium.org, Nov 1 2016

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

commit 4af4fd436f8224291702adcd453c840bb2af163a
Author: yosin <yosin@chromium.org>
Date: Tue Nov 01 07:11:53 2016

Get rid of VisibleSelection::expandUsingGranularity()

This patch gets rid of |VisibleSelection::expandUsingGranularity()| by using
|createVisibleSelection()| as a preparation of making |VisibleSelection|
immutable for improving code health.

This patch also change |VisibleSelection| constructor to call |validate()| with
passed granularity rather than passing character granularity.

BUG= 660320 
TEST=n/a; no behavior changes

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

[modify] https://crrev.com/4af4fd436f8224291702adcd453c840bb2af163a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
[modify] https://crrev.com/4af4fd436f8224291702adcd453c840bb2af163a/third_party/WebKit/Source/core/editing/SelectionController.cpp
[modify] https://crrev.com/4af4fd436f8224291702adcd453c840bb2af163a/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
[modify] https://crrev.com/4af4fd436f8224291702adcd453c840bb2af163a/third_party/WebKit/Source/core/editing/VisibleSelection.h
[modify] https://crrev.com/4af4fd436f8224291702adcd453c840bb2af163a/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp
[modify] https://crrev.com/4af4fd436f8224291702adcd453c840bb2af163a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
[modify] https://crrev.com/4af4fd436f8224291702adcd453c840bb2af163a/third_party/WebKit/Source/web/mac/WebSubstringUtil.mm

Project Member

Comment 3 by bugdroid1@chromium.org, Feb 21 2017

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

commit c96ea05e8b2961eb5d57829018fea8821b57acfd
Author: yosin <yosin@chromium.org>
Date: Tue Feb 21 13:08:15 2017

Make PendingSelection::calcVisibleSelection() to return SelectionInFlatTree

This patch makes |PendingSelection::calcVisibleSelection()| to return
|SelectionInFlatTree| to avoid using |setWithoutValidation()| as a preparation
of making |VisibleSelection| as immutable object for improving code health.

BUG= 660320 
TEST=n/a; no behavior changes

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

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

Project Member

Comment 4 by bugdroid1@chromium.org, Feb 22 2017

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

commit 453d5882079b36fa2ab5b2240b9bcad81428eaa8
Author: yosin <yosin@chromium.org>
Date: Wed Feb 22 08:11:15 2017

Make SelecitonModifier class not to use VisibleSelection::setBase() and setExtent()

This patch makes |SelecitonModifier| class not to use |Position| version of
|setBase()| and |setExtent()| of |VisibleSelection| as a preparation of
making |VisibleSelection| immutable for improving code health.

The concept of this patch is creating new |VisibleSelection| from
|m_selection| and copying back to |m_selection| instead of modifying
|m_selection| by using |setBase()| and |setExtent()|.

This is done by decomposing |willModify()| into |isBaseFirst()|,
returns true if |SelecitonModifier| uses selection start as base of new
selection, and |prepareForExtend()| to return new |VisibleSelection| from
start and end positions of passed |VisibleSelection|.

Since |setBase()| and |setExtent()| call |VisibleSelection:::validate()|,
the original code calls |validate()| twice, but this patch calls once.

BUG= 660320 
TEST=n/a; no behavior changes

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

[modify] https://crrev.com/453d5882079b36fa2ab5b2240b9bcad81428eaa8/third_party/WebKit/Source/core/editing/SelectionModifier.cpp
[modify] https://crrev.com/453d5882079b36fa2ab5b2240b9bcad81428eaa8/third_party/WebKit/Source/core/editing/SelectionModifier.h

Project Member

Comment 5 by bugdroid1@chromium.org, Feb 22 2017

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

commit 08b74323568c102885a43073f95765b53f700ab8
Author: yosin <yosin@chromium.org>
Date: Wed Feb 22 22:55:49 2017

Get rid of unused functions VisibleSelection::setBase and setExtent taking Position

This patch gets rid of unused functions, |setBase()| and |setExtent()| taking
|Position| in |VisibleSelection| to reduce source code size for improving code
health.

This is follow up of patch[2] which gets rid of usage of |setBase()| and
|setExtent()|.

[1] http://crrev.com/2708823003 Make SelecitonModifier class not to use
VisibleSelection::setBase() and setExtent()

BUG= 660320 
TEST=n/a; no behavior changes

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

[modify] https://crrev.com/08b74323568c102885a43073f95765b53f700ab8/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
[modify] https://crrev.com/08b74323568c102885a43073f95765b53f700ab8/third_party/WebKit/Source/core/editing/VisibleSelection.h

Comment 6 by yosin@chromium.org, Mar 25 2017

Labels: Type-Task

Comment 7 by yosin@chromium.org, May 26 2017

Owner: ----
Status: Available (was: Started)
Project Member

Comment 8 by bugdroid1@chromium.org, Jun 23 2017

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

commit f7e272242d8becf099d77d7b222afad07286401d
Author: yosin <yosin@chromium.org>
Date: Fri Jun 23 03:11:58 2017

Introduce VisibleSelection::CreateWithoutValidationDeprecated()

This patch introduces |VisibleSelection::CreateWithoutValidationDeprecated()|
as replacement of |SetWithoutValidation()| to make |VisibleSelection| as
virtually immutable for improving code health.

BUG= 660320 
TEST=n/a; no behavior changes

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

[modify] https://crrev.com/f7e272242d8becf099d77d7b222afad07286401d/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
[modify] https://crrev.com/f7e272242d8becf099d77d7b222afad07286401d/third_party/WebKit/Source/core/editing/VisibleSelection.h
[modify] https://crrev.com/f7e272242d8becf099d77d7b222afad07286401d/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp

Project Member

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

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

commit fb62cb3fb002c372baa6093f5432e97d5ee3ba30
Author: yosin <yosin@chromium.org>
Date: Tue Jul 04 08:29:23 2017

Make VisibleSelection::AppendTrailingWhitespace() as const function

This patch makes |VisibleSelection::AppendTrailingWhitespace()| as const
function to make |VisibleSelection| as *virtual* immutable for improving
code health.

BUG= 660320 
TEST=n/a; no behavior changes

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

[modify] https://crrev.com/fb62cb3fb002c372baa6093f5432e97d5ee3ba30/third_party/WebKit/Source/core/editing/SelectionController.cpp
[modify] https://crrev.com/fb62cb3fb002c372baa6093f5432e97d5ee3ba30/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
[modify] https://crrev.com/fb62cb3fb002c372baa6093f5432e97d5ee3ba30/third_party/WebKit/Source/core/editing/VisibleSelection.h
[modify] https://crrev.com/fb62cb3fb002c372baa6093f5432e97d5ee3ba30/third_party/WebKit/Source/core/editing/VisibleSelectionTest.cpp

Comment 10 by yosin@chromium.org, Jul 10 2017

Status: Fixed (was: Available)

Sign in to add a comment