New issue
Advanced search Search tips

Issue 682137 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Move EditCommand::starting/endingSelection to CompositeEditCommand

Project Member Reported by xiaoche...@chromium.org, Jan 18 2017

Issue description

starting and ending selection are defined for all edit commands, but simple edit commands do not need them.

We should move them down to CompositeEditCommand to reduce the complexity in the construction of SimpleEditCommand.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 18 2017

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

commit d9e076c4780e0bcb4af6a257407f006c44a3a976
Author: xiaochengh <xiaochengh@chromium.org>
Date: Wed Jan 18 12:13:14 2017

Move EditCommand::starting/endingSelection() to CompositeEditCommand (1/2)

Currently, starting and ending selections are defined for all EditCommand,
but are used by only CompositeEditCommand; SimpleEditCommand does not use
them.

Hence, this patch moves the two selections from EditCommand to
CompositeEditCommand, so that the construction of SimpleCommand becomes
simpler.

As EditCommand::setParent modifies starting and ending selection, this
patch turns it into a virtual function, and overrides it with
CompositeEditCommand::setParent to modify the selections.

This patch also removes a redundant static function undoStepIfPossible()
from EditCommand.cpp.

BUG= 682137 
TEST=n/a; no behavior change

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

[modify] https://crrev.com/d9e076c4780e0bcb4af6a257407f006c44a3a976/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
[modify] https://crrev.com/d9e076c4780e0bcb4af6a257407f006c44a3a976/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
[modify] https://crrev.com/d9e076c4780e0bcb4af6a257407f006c44a3a976/third_party/WebKit/Source/core/editing/commands/EditCommand.cpp
[modify] https://crrev.com/d9e076c4780e0bcb4af6a257407f006c44a3a976/third_party/WebKit/Source/core/editing/commands/EditCommand.h

Status: Fixed (was: Assigned)

Sign in to add a comment