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

Issue 2457523003: Support 'insertReplacementText' for spellcheck (Closed)

Created:
4 years, 1 month ago by chaopeng
Modified:
4 years, 1 month ago
CC:
blink-reviews, chromium-reviews, dcheng, groby+blinkspell_chromium.org, kinuko+watch, timvolodine
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Support 'insertReplacementText' for spellcheck In this patch, we implement the insertReplacementText input event for spellcheck. We will not cancel the selection when the before event canceled. This is all still behind the InputEvent experimental RuntimeEnabledFeature. BUG=652403 Committed: https://crrev.com/64f23d2d80977f018ecdcad5d34b78e24f98e980 Cr-Commit-Position: refs/heads/master@{#433794}

Patch Set 1 #

Total comments: 15

Patch Set 2 : fix for chongz's nit #

Total comments: 12

Patch Set 3 : fix for nit from Yosi_UTC9, Xiaocheng #

Total comments: 2

Patch Set 4 : fix for yosin's comments #

Total comments: 5

Patch Set 5 : dtapuska's comment addressed #

Total comments: 8

Patch Set 6 : change test #

Total comments: 1

Patch Set 7 : fix range #

Total comments: 7

Patch Set 8 : yosin@ comment addressed #

Total comments: 15

Patch Set 9 : yosin@ comment addressed #

Total comments: 2

Patch Set 10 : yosin comment addressed #

Patch Set 11 : add DeleteByCut to dispatchBeforeInputDataTransfer DCHECK #

Patch Set 12 : add null check #

Total comments: 2

Patch Set 13 : yosin@ comment#57 #58 addressed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+150 lines, -23 lines) Patch
A third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html View 1 2 3 4 5 6 7 8 9 1 chunk +56 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/clipboard/DataObject.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/clipboard/DataObject.cpp View 1 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/clipboard/DataTransfer.h View 1 2 3 4 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/EditingUtilities.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +26 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/editing/Editor.h View 1 2 3 4 1 chunk +4 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/Editor.cpp View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +19 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +27 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/events/InputEvent.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/events/InputEvent.cpp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/web/WebLocalFrameImpl.cpp View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebFrameTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 67 (24 generated)
chaopeng
Please take a first look. Thank you.
4 years, 1 month ago (2016-10-26 23:45:17 UTC) #3
chongz
Thanks for the patch! Here are some nits. https://codereview.chromium.org/2457523003/diff/1/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html File third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html (right): https://codereview.chromium.org/2457523003/diff/1/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode13 third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html:13: test(function ...
4 years, 1 month ago (2016-10-27 16:41:25 UTC) #8
chaopeng
PTAL. Thank you. https://codereview.chromium.org/2457523003/diff/1/third_party/WebKit/Source/core/clipboard/DataObject.cpp File third_party/WebKit/Source/core/clipboard/DataObject.cpp (right): https://codereview.chromium.org/2457523003/diff/1/third_party/WebKit/Source/core/clipboard/DataObject.cpp#newcode67 third_party/WebKit/Source/core/clipboard/DataObject.cpp:67: dataObject->add(data, "text/plain"); On 2016/10/27 16:41:24, chongz ...
4 years, 1 month ago (2016-10-28 00:33:09 UTC) #9
chongz
Hi yosin@, chaopeng@ also started working on InputEvent, PTAL, thanks! https://codereview.chromium.org/2457523003/diff/1/third_party/WebKit/Source/core/clipboard/DataObject.cpp File third_party/WebKit/Source/core/clipboard/DataObject.cpp (right): https://codereview.chromium.org/2457523003/diff/1/third_party/WebKit/Source/core/clipboard/DataObject.cpp#newcode67 ...
4 years, 1 month ago (2016-10-28 02:12:16 UTC) #11
chaopeng
xiaochengh@ PTAL, we found frame().document()->updateStyleAndLayoutIgnorePendingStylesheets(); must call just before replaceSelectionWithText or selection() will fail. Do ...
4 years, 1 month ago (2016-10-28 02:20:26 UTC) #13
Xiaocheng
Yes, Editor::replaceSelectionFoo() requires clean layout. Same holds for VisibleSelection::toNormalizedEphemeralRange() and basically all functions of SpellChecker. ...
4 years, 1 month ago (2016-10-28 02:55:24 UTC) #14
yosin_UTC9
https://codereview.chromium.org/2457523003/diff/20001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html File third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html (right): https://codereview.chromium.org/2457523003/diff/20001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode42 third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html:42: assert_equals(editable.innerText, "apple"); Could you utilize assert_selection()? https://codereview.chromium.org/2457523003/diff/20001/third_party/WebKit/Source/core/editing/EditingUtilities.cpp File third_party/WebKit/Source/core/editing/EditingUtilities.cpp ...
4 years, 1 month ago (2016-10-28 04:06:14 UTC) #15
chaopeng
https://codereview.chromium.org/2457523003/diff/20001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html File third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html (right): https://codereview.chromium.org/2457523003/diff/20001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode42 third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html:42: assert_equals(editable.innerText, "apple"); On 2016/10/28 04:06:14, Yosi_UTC9 wrote: > Could ...
4 years, 1 month ago (2016-10-28 14:28:31 UTC) #16
chaopeng
On 2016/10/28 14:28:31, chaopeng wrote: > https://codereview.chromium.org/2457523003/diff/20001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html > File > third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html > (right): > > ...
4 years, 1 month ago (2016-10-28 15:07:18 UTC) #17
chaopeng
aelias@chromium.org: Please review changes in Web rbyers@chromium.org: Please review changes in Core
4 years, 1 month ago (2016-10-28 15:11:24 UTC) #19
aelias_OOO_until_Jul13
This seems pointless and counterproductive because it doesn't cover Android IME-caused spellcheck which is probably ...
4 years, 1 month ago (2016-10-28 18:37:01 UTC) #21
aelias_OOO_until_Jul13
OK, after a bit more time to explore the problem space, I've withdrawn my spec-level ...
4 years, 1 month ago (2016-11-02 08:25:16 UTC) #22
yosin_UTC9
https://codereview.chromium.org/2457523003/diff/40001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html File third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html (right): https://codereview.chromium.org/2457523003/diff/40001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode10 third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html:10: function assert_selection(expected) { Please use editing/assert_selection.js https://codereview.chromium.org/2457523003/diff/40001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode15 third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html:15: internals.setSpellCheckingEnabled(true); ...
4 years, 1 month ago (2016-11-02 09:14:34 UTC) #23
chaopeng
https://codereview.chromium.org/2457523003/diff/60001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html File third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html (right): https://codereview.chromium.org/2457523003/diff/60001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode47 third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html:47: console.log(selection.toString()); // selection is empty Hi Yosin, I changed ...
4 years, 1 month ago (2016-11-02 20:45:25 UTC) #24
Rick Byers
On 2016/10/28 15:11:24, chaopeng wrote: > mailto:aelias@chromium.org: Please review changes in Web > > mailto:rbyers@chromium.org: ...
4 years, 1 month ago (2016-11-02 20:59:30 UTC) #25
chongz
https://codereview.chromium.org/2457523003/diff/60001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html File third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html (right): https://codereview.chromium.org/2457523003/diff/60001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode47 third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html:47: console.log(selection.toString()); // selection is empty On 2016/11/02 20:45:25, chaopeng ...
4 years, 1 month ago (2016-11-03 15:48:34 UTC) #26
yosin_UTC9
https://codereview.chromium.org/2457523003/diff/60001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html File third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html (right): https://codereview.chromium.org/2457523003/diff/60001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode47 third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html:47: console.log(selection.toString()); // selection is empty On 2016/11/03 at 15:48:34, ...
4 years, 1 month ago (2016-11-08 04:34:27 UTC) #27
yosin_UTC9
https://codereview.chromium.org/2457523003/diff/60001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html File third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html (right): https://codereview.chromium.org/2457523003/diff/60001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode47 third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html:47: console.log(selection.toString()); // selection is empty On 2016/11/08 at 04:34:27, ...
4 years, 1 month ago (2016-11-09 05:25:55 UTC) #28
dtapuska
lgtm % one not https://codereview.chromium.org/2457523003/diff/60001/third_party/WebKit/Source/core/editing/EditingUtilities.cpp File third_party/WebKit/Source/core/editing/EditingUtilities.cpp (right): https://codereview.chromium.org/2457523003/diff/60001/third_party/WebKit/Source/core/editing/EditingUtilities.cpp#newcode2104 third_party/WebKit/Source/core/editing/EditingUtilities.cpp:2104: // TODO(chongz): Pass appreciate |ranges| ...
4 years, 1 month ago (2016-11-09 14:44:56 UTC) #29
chaopeng
On 2016/11/09 05:25:55, Yosi_UTC9 wrote: > https://codereview.chromium.org/2457523003/diff/60001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html > File > third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html > (right): > > ...
4 years, 1 month ago (2016-11-09 15:16:18 UTC) #30
yosin_UTC9
https://codereview.chromium.org/2457523003/diff/80001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html File third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html (right): https://codereview.chromium.org/2457523003/diff/80001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode18 third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html:18: var document = selection.document; nit: It is better to ...
4 years, 1 month ago (2016-11-10 01:49:52 UTC) #31
Xiaocheng
https://codereview.chromium.org/2457523003/diff/80001/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp File third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp (right): https://codereview.chromium.org/2457523003/diff/80001/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp#newcode828 third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp:828: RangeVector* ranges = new RangeVector(1, frame().selection().firstRange()); On 2016/11/10 at ...
4 years, 1 month ago (2016-11-10 02:35:54 UTC) #32
yosin_UTC9
https://codereview.chromium.org/2457523003/diff/80001/third_party/WebKit/Source/core/testing/Internals.cpp File third_party/WebKit/Source/core/testing/Internals.cpp (right): https://codereview.chromium.org/2457523003/diff/80001/third_party/WebKit/Source/core/testing/Internals.cpp#newcode1798 third_party/WebKit/Source/core/testing/Internals.cpp:1798: void Internals::setSpellingMarker(Document* document, On 2016/11/10 at 02:35:53, Xiaocheng wrote: ...
4 years, 1 month ago (2016-11-10 03:25:46 UTC) #33
chaopeng
https://codereview.chromium.org/2457523003/diff/100001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html File third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html (right): https://codereview.chromium.org/2457523003/diff/100001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode48 third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html:48: internals.setMarker(document, selection.getRangeAt(0), 'Spelling'); yosin@ selection.getRangeAt(0) is not working for ...
4 years, 1 month ago (2016-11-15 20:02:59 UTC) #34
Xiaocheng
On 2016/11/15 at 20:02:59, chaopeng wrote: > https://codereview.chromium.org/2457523003/diff/100001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html > File third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html (right): > > https://codereview.chromium.org/2457523003/diff/100001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode48 ...
4 years, 1 month ago (2016-11-16 01:05:27 UTC) #35
chaopeng
On 2016/11/16 01:05:27, Xiaocheng wrote: > On 2016/11/15 at 20:02:59, chaopeng wrote: > > > ...
4 years, 1 month ago (2016-11-16 03:50:59 UTC) #36
yosin_UTC9
https://codereview.chromium.org/2457523003/diff/120001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html File third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html (right): https://codereview.chromium.org/2457523003/diff/120001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode8 third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html:8: assert_not_equals(window.eventSender, Please get rid of this statement since this ...
4 years, 1 month ago (2016-11-16 04:14:46 UTC) #37
chaopeng
On 2016/11/16 04:14:46, Yosi_UTC9 wrote: > https://codereview.chromium.org/2457523003/diff/120001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html > File > third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html > (right): > > ...
4 years, 1 month ago (2016-11-16 05:22:55 UTC) #38
yosin_UTC9
https://codereview.chromium.org/2457523003/diff/140001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html File third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html (right): https://codereview.chromium.org/2457523003/diff/140001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode7 third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html:7: test(function () { nit: s/function ()/() =>/ https://codereview.chromium.org/2457523003/diff/140001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode19 third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html:19: ...
4 years, 1 month ago (2016-11-17 04:06:48 UTC) #39
chaopeng
On 2016/11/17 04:06:48, Yosi_UTC9 wrote: > https://codereview.chromium.org/2457523003/diff/140001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html > File > third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html > (right): > > ...
4 years, 1 month ago (2016-11-17 04:26:51 UTC) #41
yosin_UTC9
lgtm w/ small nits https://codereview.chromium.org/2457523003/diff/180001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html File third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html (right): https://codereview.chromium.org/2457523003/diff/180001/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html#newcode9 third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-spellcheck.html:9: undefined, nit: align arguments to ...
4 years, 1 month ago (2016-11-21 01:48:30 UTC) #43
chaopeng
rbyers@ PTAL
4 years, 1 month ago (2016-11-21 01:56:49 UTC) #44
Rick Byers
On 2016/11/21 01:56:49, chaopeng wrote: > rbyers@ PTAL dtapuska@, aelias@ and yosin@ are experts here. ...
4 years, 1 month ago (2016-11-21 16:28:08 UTC) #46
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/2457523003/220001
4 years, 1 month ago (2016-11-21 16:33:27 UTC) #49
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/336115)
4 years, 1 month ago (2016-11-21 17:54:37 UTC) #51
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/2457523003/240001
4 years, 1 month ago (2016-11-21 19:29:55 UTC) #54
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/341920)
4 years, 1 month ago (2016-11-21 20:33:47 UTC) #56
yosin_UTC9
lgtm w/ small nit. https://codereview.chromium.org/2457523003/diff/260001/third_party/WebKit/Source/core/editing/EditingUtilities.cpp File third_party/WebKit/Source/core/editing/EditingUtilities.cpp (right): https://codereview.chromium.org/2457523003/diff/260001/third_party/WebKit/Source/core/editing/EditingUtilities.cpp#newcode2103 third_party/WebKit/Source/core/editing/EditingUtilities.cpp:2103: String data = dataTransfer->getData(mimeTypeTextPlain); nit: ...
4 years, 1 month ago (2016-11-22 01:20:28 UTC) #57
yosin_UTC9
https://codereview.chromium.org/2457523003/diff/260001/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp File third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp (right): https://codereview.chromium.org/2457523003/diff/260001/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp#newcode840 third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp:840: if (frame().document()->frame() != m_frame) This if-condition always true. frame() ...
4 years, 1 month ago (2016-11-22 01:23:47 UTC) #58
yosin_UTC9
lgtm Go ahead!
4 years, 1 month ago (2016-11-22 02:16:18 UTC) #59
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/2457523003/280001
4 years, 1 month ago (2016-11-22 02:17:56 UTC) #62
commit-bot: I haz the power
Committed patchset #13 (id:280001)
4 years, 1 month ago (2016-11-22 05:11:57 UTC) #65
commit-bot: I haz the power
4 years, 1 month ago (2016-11-22 05:15:42 UTC) #67
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/64f23d2d80977f018ecdcad5d34b78e24f98e980
Cr-Commit-Position: refs/heads/master@{#433794}

Powered by Google App Engine
This is Rietveld 408576698