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

Issue 2770413003: Add SpellCheckMarkerList in preparation for DocumentMarkerController refactor (Closed)

Created:
3 years, 9 months ago by rlanday
Modified:
3 years, 8 months ago
Reviewers:
*yosin_UTC9, Xiaocheng
CC:
blink-reviews, chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add SpellCheckMarkerList in preparation for DocumentMarkerController refactor Split off from https://codereview.chromium.org/2723663002 This CL depends on the CL that adds CompositionMarkerList: https://codereview.chromium.org/2773883003 One important thing that makes SpellCheckMarkerList special is that it merges markers with touching endpoints. I've added some test cases for this behavior in SpellCheckMarkerListTest.cpp. BUG=707867

Patch Set 1 #

Patch Set 2 : Add DCHECK that markers being inserted are of correct type #

Total comments: 11

Patch Set 3 : Make requested changes #

Patch Set 4 : Restore RemoveMarkersForWords test case #

Patch Set 5 : push_back() => add() in test #

Patch Set 6 : Rebase (Vector::remove() => Vector::erase()) #

Patch Set 7 : Optimize case where markers are being added in order #

Total comments: 1

Patch Set 8 : Remove unused stuff from test #

Patch Set 9 : Rebase #

Total comments: 5

Patch Set 10 : Fix nits, use std::copy_if() #

Patch Set 11 : Rebase #

Patch Set 12 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+263 lines, -0 lines) Patch
M third_party/WebKit/Source/core/editing/BUILD.gn View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h View 1 2 1 chunk +39 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +77 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListTest.cpp View 1 2 3 4 5 6 7 1 chunk +144 lines, -0 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 60 (45 generated)
rlanday
3 years, 9 months ago (2017-03-25 07:28:37 UTC) #7
Xiaocheng
https://codereview.chromium.org/2770413003/diff/20001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp File third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp (right): https://codereview.chromium.org/2770413003/diff/20001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp#newcode15 third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp:15: static bool doesNotOverlap(const Member<DocumentMarker>& lhv, The name doesn't match ...
3 years, 9 months ago (2017-03-25 18:55:53 UTC) #8
rlanday
https://codereview.chromium.org/2770413003/diff/20001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp File third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp (right): https://codereview.chromium.org/2770413003/diff/20001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp#newcode44 third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp:44: m_markers.remove(it - m_markers.begin()); On 2017/03/25 at 18:55:52, Xiaocheng wrote: ...
3 years, 9 months ago (2017-03-25 19:33:01 UTC) #9
yosin_UTC9
https://codereview.chromium.org/2770413003/diff/20001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h File third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h (right): https://codereview.chromium.org/2770413003/diff/20001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h#newcode14 third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h:14: class CORE_EXPORT SpellCheckMarkerList : public EditingMarkerList { nit: Please ...
3 years, 9 months ago (2017-03-27 05:02:51 UTC) #10
rlanday
https://codereview.chromium.org/2770413003/diff/20001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h File third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h (right): https://codereview.chromium.org/2770413003/diff/20001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h#newcode19 third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h:19: DocumentMarker::MarkerType allowedMarkerType() const final; On 2017/03/27 at 05:02:51, yosin_UTC9 ...
3 years, 9 months ago (2017-03-27 21:59:24 UTC) #11
Xiaocheng
https://codereview.chromium.org/2770413003/diff/20001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h File third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h (right): https://codereview.chromium.org/2770413003/diff/20001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h#newcode19 third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h:19: DocumentMarker::MarkerType allowedMarkerType() const final; On 2017/03/27 at 21:59:24, rlanday ...
3 years, 9 months ago (2017-03-27 22:08:24 UTC) #12
rlanday
On 2017/03/27 at 22:08:24, xiaochengh wrote: > https://codereview.chromium.org/2770413003/diff/20001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h > File third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h (right): > > https://codereview.chromium.org/2770413003/diff/20001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.h#newcode19 ...
3 years, 9 months ago (2017-03-27 22:22:01 UTC) #15
Xiaocheng
On 2017/03/27 at 22:22:01, rlanday wrote: > On 2017/03/27 at 22:08:24, xiaochengh wrote: > > ...
3 years, 9 months ago (2017-03-27 23:07:44 UTC) #18
rlanday
On 2017/03/27 at 23:07:44, xiaochengh wrote: > Btw, to make SpellCheckMarkerListTest compile, just make it ...
3 years, 9 months ago (2017-03-27 23:30:52 UTC) #19
rlanday
I've added an optimization to SpellCheckMarkerList so add() can be done in (amortized) O(1) time ...
3 years, 8 months ago (2017-03-29 18:26:12 UTC) #32
Xiaocheng
lgtm with a nit. https://codereview.chromium.org/2770413003/diff/120001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListTest.cpp File third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListTest.cpp (right): https://codereview.chromium.org/2770413003/diff/120001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListTest.cpp#newcode30 third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListTest.cpp:30: std::unique_ptr<DummyPageHolder> m_dummyPageHolder; nit: No need ...
3 years, 8 months ago (2017-03-29 20:24:21 UTC) #37
rlanday
On 2017/03/29 at 20:24:21, xiaochengh wrote: > lgtm with a nit. > > https://codereview.chromium.org/2770413003/diff/120001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerListTest.cpp > ...
3 years, 8 months ago (2017-03-29 22:51:54 UTC) #39
Xiaocheng
Still lgtm.
3 years, 8 months ago (2017-03-29 23:26:04 UTC) #41
yosin_UTC9
https://codereview.chromium.org/2770413003/diff/150001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp File third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp (right): https://codereview.chromium.org/2770413003/diff/150001/third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp#newcode23 third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp:23: DCHECK(marker->type() == allowedMarkerType()); nit: Let's use DCHECK_EQ(). If we ...
3 years, 8 months ago (2017-03-30 01:33:06 UTC) #44
rlanday
3 years, 8 months ago (2017-03-30 03:28:22 UTC) #48
On 2017/03/30 at 01:33:06, yosin wrote:
>
https://codereview.chromium.org/2770413003/diff/150001/third_party/WebKit/Sou...
> File third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp
(right):
> 
>
https://codereview.chromium.org/2770413003/diff/150001/third_party/WebKit/Sou...
> third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp:23:
DCHECK(marker->type() == allowedMarkerType());
> nit: Let's use DCHECK_EQ(). If we need to introduce printer, let's introduce
printer too for ease of debugging.
> 
>
https://codereview.chromium.org/2770413003/diff/150001/third_party/WebKit/Sou...
> third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp:32:
auto firstOverlappingIt = std::lower_bound(
> nit: s/auto/const auto&/
> 
>
https://codereview.chromium.org/2770413003/diff/150001/third_party/WebKit/Sou...
> third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp:40:
auto insertedIt = m_markers.begin() + index;
> nit: s/auto/const auto&/
> 
>
https://codereview.chromium.org/2770413003/diff/150001/third_party/WebKit/Sou...
> third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp:62:
for (Member<DocumentMarker> marker : m_markers) {
> Can we use std::copy_if()[1]?
> 
> [1] http://en.cppreference.com/w/cpp/algorithm/copy
> 
>
https://codereview.chromium.org/2770413003/diff/150001/third_party/WebKit/Sou...
> third_party/WebKit/Source/core/editing/markers/SpellCheckMarkerList.cpp:65:
String markerText = nodeText.substring(start, length);
> nit: s/String/const String&/

Updated

Powered by Google App Engine
This is Rietveld 408576698