|
|
DescriptionRefactor ContextMenuClient::SelectMisspellingAsync()
Currently, ContextMenuClient::SelectMisspellingAsync() duplicates logic that we
also implement in SpellChecker::GetSpellCheckMarkerUnderSelection(). This CL
implements SelectMisspellingAsync() on top of
GetSpellCheckMarkerUnderSelection() to reduce code duplication.
BUG=736181
Review-Url: https://codereview.chromium.org/2959553002
Cr-Commit-Position: refs/heads/master@{#489417}
Committed: https://chromium.googlesource.com/chromium/src/+/76cf4f1fd0db79aeb3c6c08d92afcae00b0cd08e
Patch Set 1 #
Total comments: 1
Patch Set 2 : Rebase #Patch Set 3 : Rebase #Patch Set 4 : Rebase #Patch Set 5 : Rebase #Patch Set 6 : Rebase #
Total comments: 3
Patch Set 7 : Respond to comments #
Total comments: 1
Patch Set 8 : Rebase #Messages
Total messages: 35 (25 generated)
rlanday@chromium.org changed reviewers: + xiaochengh@chromium.org, yosin@chromium.org
See https://docs.google.com/document/d/1znHQwY6KUongMRwytBh9RvLJENjz_HnUfunx_uFt5QI for an overview of the MarkersIntersectingRange series of patches https://codereview.chromium.org/2959553002/diff/1/third_party/WebKit/Source/c... File third_party/WebKit/Source/core/page/ContextMenuClient.cpp (right): https://codereview.chromium.org/2959553002/diff/1/third_party/WebKit/Source/c... third_party/WebKit/Source/core/page/ContextMenuClient.cpp:132: if (marker_range->GetText().StripWhiteSpace(&IsWhiteSpaceOrPunctuation) != I'm not sure what's going on here (referring to comparing the text in the selection to the text in the marker, not to the code review tool duplicating the two lines and making it look like something's being compared to itself), it would be nice if we could avoid getting the selection outside of GetSpellCheckMarkerUnderSelection().
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Code change seems good. I'll wait for yosin's review of the earlier patches in this series before moving on.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Could you move SelectMisspellingAsync() to SpellChecker? We would like to put all spell checker functionality in SpellChecker class to hide implementation details. Let's move spellchecker changes for context menu into another series of patch and isolate from Text Suggestions integration.
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/06/27 at 01:23:53, yosin wrote: > Could you move SelectMisspellingAsync() to SpellChecker? > We would like to put all spell checker functionality in SpellChecker class to hide implementation > details. > > Let's move spellchecker changes for context menu into another series of patch and isolate from > Text Suggestions integration. Ok, I've done this here: https://codereview.chromium.org/2966223003
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...)
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...)
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Is this patch obsolete? It seems the patch[1] supersedes this patch. [1] http://crrev.com//2966223003 [SelectMisspellingAsync #1] Move SelectMisspellingAsync() from ContextMenuClient.cpp to SpellChecker https://codereview.chromium.org/2959553002/diff/100001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/page/ContextMenuClient.cpp (right): https://codereview.chromium.org/2959553002/diff/100001/third_party/WebKit/Sou... third_party/WebKit/Source/core/page/ContextMenuClient.cpp:114: if (!node_and_marker) How about using |pair.first| which is Node*, as no spelling marker? If so, we could write: if (!node_and_mark.first) return; https://codereview.chromium.org/2959553002/diff/100001/third_party/WebKit/Sou... third_party/WebKit/Source/core/page/ContextMenuClient.cpp:122: Range::Create(*selected_frame->GetDocument(), marker_node, Could you avoid to use temporary Range make this code Oilpan friendly? We can use EpehemralRange and PlainText() to work as Range::GetTExt() String Range::GetText() const { DCHECK(!owner_document_->NeedsLayoutTreeUpdate()); return PlainText(EphemeralRange(this), TextIteratorBehavior::Builder() .SetEmitsObjectReplacementCharacter(true) .Build()); }
The CQ bit was checked by rlanday@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/07/20 at 01:19:07, yosin wrote: > Is this patch obsolete? > It seems the patch[1] supersedes this patch. > > [1] http://crrev.com//2966223003 [SelectMisspellingAsync #1] Move SelectMisspellingAsync() from ContextMenuClient.cpp to SpellChecker This patch refactors the method, that one moves it to another class. I've updated this CL, taking into account the feedback from that other CL.
https://codereview.chromium.org/2959553002/diff/100001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/page/ContextMenuClient.cpp (right): https://codereview.chromium.org/2959553002/diff/100001/third_party/WebKit/Sou... third_party/WebKit/Source/core/page/ContextMenuClient.cpp:114: if (!node_and_marker) On 2017/07/20 at 01:19:07, yosin_UTC9 wrote: > How about using |pair.first| which is Node*, as no spelling marker? > If so, we could write: > > if (!node_and_mark.first) > return; I put up a separate CL for this: https://chromium-review.googlesource.com/c/580688/
lgtm w/ nit https://codereview.chromium.org/2959553002/diff/120001/third_party/WebKit/Sou... File third_party/WebKit/Source/core/page/ContextMenuClient.cpp (right): https://codereview.chromium.org/2959553002/diff/120001/third_party/WebKit/Sou... third_party/WebKit/Source/core/page/ContextMenuClient.cpp:121: VisibleSelection selection = nit: s/VisibleSelection/const VisibleSelection/
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_tsan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by rlanday@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from yosin@chromium.org Link to the patchset: https://codereview.chromium.org/2959553002/#ps140001 (title: "Rebase")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 140001, "attempt_start_ts": 1501005488927800, "parent_rev": "c94bfd85af86cc4483b9d9d659a488f5e911e4c0", "commit_rev": "76cf4f1fd0db79aeb3c6c08d92afcae00b0cd08e"}
Message was sent while issue was closed.
Description was changed from ========== Refactor ContextMenuClient::SelectMisspellingAsync() Currently, ContextMenuClient::SelectMisspellingAsync() duplicates logic that we also implement in SpellChecker::GetSpellCheckMarkerUnderSelection(). This CL implements SelectMisspellingAsync() on top of GetSpellCheckMarkerUnderSelection() to reduce code duplication. BUG=736181 ========== to ========== Refactor ContextMenuClient::SelectMisspellingAsync() Currently, ContextMenuClient::SelectMisspellingAsync() duplicates logic that we also implement in SpellChecker::GetSpellCheckMarkerUnderSelection(). This CL implements SelectMisspellingAsync() on top of GetSpellCheckMarkerUnderSelection() to reduce code duplication. BUG=736181 Review-Url: https://codereview.chromium.org/2959553002 Cr-Commit-Position: refs/heads/master@{#489417} Committed: https://chromium.googlesource.com/chromium/src/+/76cf4f1fd0db79aeb3c6c08d92af... ==========
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as https://chromium.googlesource.com/chromium/src/+/76cf4f1fd0db79aeb3c6c08d92af... |