New issue
Advanced search Search tips

Issue 802922 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

Reorganize EditingUtilities

Project Member Reported by xiaoche...@chromium.org, Jan 17 2018

Issue description

Many functions in EditingUtilities are used by editing commands only.

We should move them to editing/commands/EditingCommandsUtilities.{cpp,h} for better code structure, and also help our currently on-going refactorings.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 22 2018

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

commit e17e8e9fd9d303d3b8d12628ba15e755a3212d40
Author: Zhuoyu Qian <zhuoyu.qian@samsung.com>
Date: Mon Jan 22 06:08:23 2018

Reorganize EditingUtilities

Many functions in EditingUtilities are used by editing commands only.
Move them to editing/commands/EditingCommandsUtilities.{cpp,h} for
better code structure.

BUG=802922

Signed-off-by: Zhuoyu Qian <zhuoyu.qian@samsung.com>
Change-Id: I48d0e7a99cfc8a92d2dcf50d545a1749b1086e8b
Reviewed-on: https://chromium-review.googlesource.com/872513
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530815}
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/BUILD.gn
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/EditingUtilities.h
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/EditingUtilitiesTest.cpp
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
[add] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/commands/EditingCommandsUtilities.cpp
[add] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/commands/EditingCommandsUtilities.h
[add] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/commands/EditingCommandsUtilitiesTest.cpp
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.cpp
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/commands/InsertTextCommand.cpp
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
[modify] https://crrev.com/e17e8e9fd9d303d3b8d12628ba15e755a3212d40/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp

Project Member

Comment 2 by bugdroid1@chromium.org, Feb 28 2018

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

commit 985cac461654afe7694213499c33d231c1160a66
Author: Zhuoyu Qian <zhuoyu.qian@samsung.com>
Date: Wed Feb 28 02:46:58 2018

Move Some Functions of EditingUtilities to EditingCommandsUtilities.

Functions IsInline() and DeletionInputTypeFromTextGranularity() are
used by editing commands only. Move them to
EditingCommandsUtilities.{cpp,h} for better code structure.

Bug: 802922

Signed-off-by: Zhuoyu Qian <zhuoyu.qian@samsung.com>
Change-Id: Ic9901e53d21d45ad74f2652b365efa68f5de9d92
Reviewed-on: https://chromium-review.googlesource.com/939209
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539673}
[modify] https://crrev.com/985cac461654afe7694213499c33d231c1160a66/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
[modify] https://crrev.com/985cac461654afe7694213499c33d231c1160a66/third_party/WebKit/Source/core/editing/EditingUtilities.h
[modify] https://crrev.com/985cac461654afe7694213499c33d231c1160a66/third_party/WebKit/Source/core/editing/commands/EditingCommandsUtilities.cpp
[modify] https://crrev.com/985cac461654afe7694213499c33d231c1160a66/third_party/WebKit/Source/core/editing/commands/EditingCommandsUtilities.h
[modify] https://crrev.com/985cac461654afe7694213499c33d231c1160a66/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp

@xiaochengh 
There is some functions in EditingUtilities only used in one place:
For example:
bool IsEmptyTableCell(const Node*);
Only used in SelectionAdjuster.cpp.
Is it OK to move IsEmptyTableCell to SelectionAdjuster.cpp as a local function?
Project Member

Comment 4 by bugdroid1@chromium.org, Mar 2 2018

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

commit dcbbb37d0753c7c23f35cebb28625e8f0d58bc1d
Author: Zhuoyu Qian <zhuoyu.qian@samsung.com>
Date: Fri Mar 02 08:30:16 2018

Make IsEmptyTableCell() be a local function in SelectionAdjuster.cpp.

Move IsEmptyTableCell() out of EditingUtilities for better code
structure.

Bug: 802922

Signed-off-by: Zhuoyu Qian <zhuoyu.qian@samsung.com>
Change-Id: Ibbaeef1e6ebdfbf31c73c50a0ba81c1a16efe747
Reviewed-on: https://chromium-review.googlesource.com/942598
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540474}
[modify] https://crrev.com/dcbbb37d0753c7c23f35cebb28625e8f0d58bc1d/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
[modify] https://crrev.com/dcbbb37d0753c7c23f35cebb28625e8f0d58bc1d/third_party/WebKit/Source/core/editing/EditingUtilities.h
[modify] https://crrev.com/dcbbb37d0753c7c23f35cebb28625e8f0d58bc1d/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp

Project Member

Comment 5 by bugdroid1@chromium.org, Mar 5 2018

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

commit a763f0c2f7f78aead41a8a7da78260bf7dbfc405
Author: Zhuoyu Qian <zhuoyu.qian@samsung.com>
Date: Mon Mar 05 06:07:58 2018

Move IsAmbiguousBoundaryCharacter() out of EditingUtilities.

IsAmbiguousBoundaryCharacter() only used in SpellChecker.cpp, move it
from EditingUtilities to SpellChecker.cpp for better code structure.

Bug: 802922

Signed-off-by: Zhuoyu Qian <zhuoyu.qian@samsung.com>
Change-Id: Ie86aed1551481312544c2471dac2068199e5cd65
Reviewed-on: https://chromium-review.googlesource.com/945350
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540786}
[modify] https://crrev.com/a763f0c2f7f78aead41a8a7da78260bf7dbfc405/third_party/WebKit/Source/core/editing/EditingUtilities.h
[modify] https://crrev.com/a763f0c2f7f78aead41a8a7da78260bf7dbfc405/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp

Sign in to add a comment