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

Issue 2627103003: [EditCommandSource] Pass source through |CompositeEditCommand| ctor instead of |apply(source)| (Closed)

Created:
3 years, 11 months ago by chongz
Modified:
3 years, 10 months ago
Reviewers:
yosin_UTC9
CC:
blink-reviews, blink-reviews-style_chromium.org, chromium-reviews, dtapuska, chaopeng
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[EditCommandSource] Pass source through |CompositeEditCommand| ctor instead of |apply(source)| We want to store |EditCommandSource| in |CompositeEditCommand| as an attribute instead of only getting it from |apply(source)|. This CL: 1. Change |apply(EditCommandSource)| => |apply()| 2. Add |EditCommandSource::kInternal| 3. Add default parameter |EditCommandSource::kInternal| to |CompositeEditCommand|'s ctor 4. Add required parameter |EditCommandSource| to other commands' ctor that might be executed from JS See yosin@'s comments: https://codereview.chromium.org/2610063008/#msg13 BUG=673789

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+206 lines, -141 lines) Patch
M third_party/WebKit/Source/core/editing/Editor.cpp View 7 chunks +19 lines, -16 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.h View 1 chunk +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp View 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommandTest.cpp View 2 chunks +7 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.h View 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/ApplyStyleCommandTest.cpp View 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h View 4 chunks +10 lines, -3 lines 4 comments Download
M third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp View 5 chunks +16 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/CreateLinkCommand.h View 1 chunk +5 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/CreateLinkCommand.cpp View 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.h View 2 chunks +6 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommandTest.cpp View 1 chunk +3 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp View 15 chunks +35 lines, -28 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.h View 2 chunks +5 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/FormatBlockCommand.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.h View 1 chunk +5 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp View 2 chunks +6 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/InsertListCommand.h View 2 chunks +5 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp View 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/InsertListCommandTest.cpp View 1 chunk +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/RemoveFormatCommand.h View 1 chunk +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/RemoveFormatCommand.cpp View 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.h View 2 chunks +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommandTest.cpp View 3 chunks +9 lines, -12 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/TypingCommand.h View 1 chunk +6 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp View 8 chunks +19 lines, -14 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/UnlinkCommand.h View 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/UnlinkCommand.cpp View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 13 (10 generated)
chongz
yosin@ PTAL, thanks!
3 years, 11 months ago (2017-01-11 23:39:18 UTC) #11
yosin_UTC9
We should start over == reverting following patch first: - 1dfe560 [InputEvent] Remove unused |inputType()| ...
3 years, 11 months ago (2017-01-12 04:01:13 UTC) #12
chongz
3 years, 11 months ago (2017-01-13 16:28:27 UTC) #13
On 2017/01/12 04:01:13, Yosi_UTC9 wrote:
> We should start over == reverting following patch first:
> 
> - 1dfe560 [InputEvent] Remove unused |inputType()| from |UndoStep| and
> |EditCommandComposition| by chongz · 3 weeks ago
> - c659648 [Editing] Introduce |EditCommandComposition::willUn/Reapply()| in
> prepare for 'beforeinput' (2/3) by chongz · 3 weeks ago
> - 4d0f52c [Editing] Introduce |CompositeEditCommand::willApplyEditing()| in
> prepare for 'beforeinput' (1/3) by chongz · 3 weeks ago
> - acce62c [EditCommandSource] Pass source to |CompositEditCommand| and
> |TypingCommand| (3/3) by chongz · 4 weeks ago
> - 17c7368 [EditCommandSource] Rename and move |EditorCommandSource| to
> "CompositeEditCommand.h" (1/3) by chongz · 4 weeks ago
> 
> Then
> 1. Introduce |enum class EditCommandSouce| and CompoisiteCommand ctor takes it
> as default parameter = kInternal.
> 2. Make ApplyBlockElementCommand aware of EditCommandSource
> 3. Make ApplyStyleCommand aware of EditCommandSource
> 4. ...
> N. Make UlinkCommand aware of EditCommandSouce
> N+1. Implement dispatch "beforeinput" to with EditCommandSource support.
> 
> In this way, each patch is *small* and easy to review.
> 
> You don't need to wait for review for reverting, just use
mailto:TBR=yosin@chromium.org
> is fine.
> 
>
https://codereview.chromium.org/2627103003/diff/1/third_party/WebKit/Source/c...
> File third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
> (right):
> 
>
https://codereview.chromium.org/2627103003/diff/1/third_party/WebKit/Source/c...
> third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h:46:
> kMenuOrKeyBinding,  // from menu, or keyboard shortcut
> I prefer to use |kUserAction| instead of |kMenuOrKeyBinding|. Because
> |kMenuOrKeyBinding| is too specific of user action, in the future, we may
> support user gesture, voice, eye tracking, brain reading etc.
> 
>
https://codereview.chromium.org/2627103003/diff/1/third_party/WebKit/Source/c...
> third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h:47:
kDOM,
>               // document.execCommand()
> I prefer to use |kExecCommand|, |kScriptAPI|, or another indicating the
command
> created as result of |document.execCommand()|.

Thanks for the detailed plan! I've re-opened https://crbug.com/673789 and
updated bug description. I'm going to revert the mentioned CLs.

+dtapuska@, +chaopeng@ as an update.

https://codereview.chromium.org/2627103003/diff/1/third_party/WebKit/Source/c...
File third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h
(right):

https://codereview.chromium.org/2627103003/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h:46:
kMenuOrKeyBinding,  // from menu, or keyboard shortcut
On 2017/01/12 04:01:13, Yosi_UTC9 wrote:
> I prefer to use |kUserAction| instead of |kMenuOrKeyBinding|. Because
> |kMenuOrKeyBinding| is too specific of user action, in the future, we may
> support user gesture, voice, eye tracking, brain reading etc.

Will do.

https://codereview.chromium.org/2627103003/diff/1/third_party/WebKit/Source/c...
third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h:47: kDOM,
              // document.execCommand()
On 2017/01/12 04:01:13, Yosi_UTC9 wrote:
> I prefer to use |kExecCommand|, |kScriptAPI|, or another indicating the
command
> created as result of |document.execCommand()|.

Will do.

Powered by Google App Engine
This is Rietveld 408576698