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

Issue 419563003: Adding a word to dictionary should remove spelling markers (Closed)

Created:
6 years, 5 months ago by Klemen Forstnerič
Modified:
6 years, 4 months ago
Reviewers:
tkent, jamesr, yosin_UTC9, dcheng
CC:
dcheng, abarth-chromium, blink-reviews, blink-reviews-dom_chromium.org, dglazkov+blink, eae+blinkwatch, groby+blinkspell_chromium.org, jamesr, rwlbuis, sof, please use gerrit instead, rouslan+spellwatch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Adding a word to dictionary should remove spelling markers. This patch adds code for removing spelling markers under words on blink's side. BUG=3506 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=180382

Patch Set 1 #

Patch Set 2 : Added a test to WebFrameTest #

Patch Set 3 : Rebased to a newer master #

Patch Set 4 : Tidied the patch a bit #

Total comments: 2

Patch Set 5 : Removed the removeSpellingMarkersUnderWords method from WebRemoteFrameImpl #

Total comments: 12

Patch Set 6 : Addressed comment #

Total comments: 13

Patch Set 7 : Addressed dcheng's comment #

Total comments: 12

Patch Set 8 : Addressed yosin's comments #

Total comments: 4

Patch Set 9 : Addressed yosin's second comment #

Total comments: 1

Patch Set 10 : Addressed my own nit #

Total comments: 19

Patch Set 11 : Addressed tkent's comment #

Patch Set 12 : Removed the WebLocalFrameImpl indirection #

Patch Set 13 : Rebased to a newer master #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+109 lines, -1 line) Patch
M Source/core/dom/DocumentMarkerController.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +11 lines, -0 lines 0 comments Download
M Source/core/dom/DocumentMarkerController.cpp View 1 2 3 4 5 6 7 8 9 10 3 chunks +34 lines, -0 lines 5 comments Download
M Source/core/editing/SpellChecker.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/editing/SpellChecker.cpp View 1 2 3 4 5 6 7 8 1 chunk +9 lines, -0 lines 0 comments Download
M Source/core/frame/LocalFrame.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/frame/LocalFrame.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +5 lines, -0 lines 0 comments Download
M Source/web/WebViewImpl.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M Source/web/WebViewImpl.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +13 lines, -0 lines 2 comments Download
M Source/web/tests/WebFrameTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +32 lines, -0 lines 0 comments Download
M public/web/WebView.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 36 (0 generated)
Klemen Forstnerič
jamesr: PTAL Patch Set 4.
6 years, 4 months ago (2014-07-30 17:26:29 UTC) #1
dcheng
https://codereview.chromium.org/419563003/diff/60001/public/web/WebFrame.h File public/web/WebFrame.h (right): https://codereview.chromium.org/419563003/diff/60001/public/web/WebFrame.h#newcode443 public/web/WebFrame.h:443: Please consider adding this new member to WebLocalFrame instead, ...
6 years, 4 months ago (2014-07-30 18:18:50 UTC) #2
Klemen Forstnerič
https://codereview.chromium.org/419563003/diff/60001/public/web/WebFrame.h File public/web/WebFrame.h (right): https://codereview.chromium.org/419563003/diff/60001/public/web/WebFrame.h#newcode443 public/web/WebFrame.h:443: On 2014/07/30 18:18:50, dcheng (OOO) wrote: > Please consider ...
6 years, 4 months ago (2014-07-30 19:57:35 UTC) #3
groby-ooo-7-16
drive-by comments https://codereview.chromium.org/419563003/diff/100001/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/419563003/diff/100001/Source/core/dom/DocumentMarkerController.cpp#newcode420 Source/core/dom/DocumentMarkerController.cpp:420: DocumentMarkerAndNodeVector DocumentMarkerController::markerNodePairs() This seems to copy a ...
6 years, 4 months ago (2014-07-30 21:13:27 UTC) #4
Klemen Forstnerič
https://codereview.chromium.org/419563003/diff/100001/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/419563003/diff/100001/Source/core/dom/DocumentMarkerController.cpp#newcode420 Source/core/dom/DocumentMarkerController.cpp:420: DocumentMarkerAndNodeVector DocumentMarkerController::markerNodePairs() On 2014/07/30 21:13:27, groby wrote: > This ...
6 years, 4 months ago (2014-07-31 17:14:00 UTC) #5
groby-ooo-7-16
https://codereview.chromium.org/419563003/diff/100001/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/419563003/diff/100001/Source/core/dom/DocumentMarkerController.cpp#newcode420 Source/core/dom/DocumentMarkerController.cpp:420: DocumentMarkerAndNodeVector DocumentMarkerController::markerNodePairs() On 2014/07/31 17:14:00, Klemen Forstnerič wrote: > ...
6 years, 4 months ago (2014-08-01 00:13:23 UTC) #6
Klemen Forstnerič
https://codereview.chromium.org/419563003/diff/100001/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/419563003/diff/100001/Source/core/dom/DocumentMarkerController.cpp#newcode420 Source/core/dom/DocumentMarkerController.cpp:420: DocumentMarkerAndNodeVector DocumentMarkerController::markerNodePairs() On 2014/08/01 00:13:22, groby wrote: > On ...
6 years, 4 months ago (2014-08-01 21:58:17 UTC) #7
Klemen Forstnerič
On 2014/08/01 21:58:17, Klemen Forstnerič wrote: > https://codereview.chromium.org/419563003/diff/100001/Source/core/dom/DocumentMarkerController.cpp > File Source/core/dom/DocumentMarkerController.cpp (right): > > https://codereview.chromium.org/419563003/diff/100001/Source/core/dom/DocumentMarkerController.cpp#newcode420 ...
6 years, 4 months ago (2014-08-04 20:27:15 UTC) #8
dcheng
I don't have time to take a more in-depth look at the moment, so I'll ...
6 years, 4 months ago (2014-08-05 20:30:39 UTC) #9
Klemen Forstnerič
I'll take a look if Range::create can be replaced with something more efficient :-). https://codereview.chromium.org/419563003/diff/140001/Source/core/dom/DocumentMarkerController.h ...
6 years, 4 months ago (2014-08-07 17:47:29 UTC) #10
Klemen Forstnerič
yosin: PTAL Patch Set 7.
6 years, 4 months ago (2014-08-08 20:23:20 UTC) #11
Klemen Forstnerič
On 2014/08/08 20:23:20, Klemen Forstnerič wrote: > yosin: PTAL Patch Set 7. yosin: ping :-)
6 years, 4 months ago (2014-08-10 08:47:51 UTC) #12
yosin_UTC9
https://codereview.chromium.org/419563003/diff/180001/Source/core/dom/DocumentMarkerController.h File Source/core/dom/DocumentMarkerController.h (right): https://codereview.chromium.org/419563003/diff/180001/Source/core/dom/DocumentMarkerController.h#newcode48 Source/core/dom/DocumentMarkerController.h:48: nit: Please remove an extra blank line. https://codereview.chromium.org/419563003/diff/180001/Source/core/dom/DocumentMarkerController.h#newcode49 Source/core/dom/DocumentMarkerController.h:49: ...
6 years, 4 months ago (2014-08-11 01:01:59 UTC) #13
Klemen Forstnerič
yosin: PTAL Patch Set 8. https://codereview.chromium.org/419563003/diff/180001/Source/core/dom/DocumentMarkerController.h File Source/core/dom/DocumentMarkerController.h (right): https://codereview.chromium.org/419563003/diff/180001/Source/core/dom/DocumentMarkerController.h#newcode48 Source/core/dom/DocumentMarkerController.h:48: On 2014/08/11 01:01:59, Yosi_UTC9 ...
6 years, 4 months ago (2014-08-11 16:24:49 UTC) #14
Klemen Forstnerič
yosin: please also see my question inline. On 2014/08/11 16:24:49, Klemen Forstnerič wrote: > yosin: ...
6 years, 4 months ago (2014-08-11 18:29:26 UTC) #15
yosin_UTC9
https://codereview.chromium.org/419563003/diff/200001/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/419563003/diff/200001/Source/core/dom/DocumentMarkerController.cpp#newcode51 Source/core/dom/DocumentMarkerController.cpp:51: RefPtr<Range> markerRange = Range::create(m_document, nit: s/RefPtr/RefPtrWIllBeRawPtr/ https://codereview.chromium.org/419563003/diff/200001/Source/core/dom/DocumentMarkerController.cpp#newcode51 Source/core/dom/DocumentMarkerController.cpp:51: RefPtr<Range> ...
6 years, 4 months ago (2014-08-12 01:18:08 UTC) #16
Klemen Forstnerič
yosin: PTAL Patch Set 9. I noticed one thing about WTF::Vector: if you construct it ...
6 years, 4 months ago (2014-08-12 18:38:02 UTC) #17
yosin_UTC9
LGTM +tkent@ for OWNERS review. https://codereview.chromium.org/419563003/diff/240001/Source/core/dom/DocumentMarkerController.h File Source/core/dom/DocumentMarkerController.h (right): https://codereview.chromium.org/419563003/diff/240001/Source/core/dom/DocumentMarkerController.h#newcode51 Source/core/dom/DocumentMarkerController.h:51: Vector<String> m_words; > m_words ...
6 years, 4 months ago (2014-08-13 01:29:52 UTC) #18
Klemen Forstnerič
I changed the |const Text*| to a |const Text&| in the method |MarkerRemoverPredicate::operator()|, since as ...
6 years, 4 months ago (2014-08-13 17:46:19 UTC) #19
tkent
https://codereview.chromium.org/419563003/diff/260001/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/419563003/diff/260001/Source/core/dom/DocumentMarkerController.cpp#newcode519 Source/core/dom/DocumentMarkerController.cpp:519: Vector<RenderedDocumentMarker *> markersToBeRemoved; |Vector<RenderedDocumentMarker *>| should be |WillBeHeapVector<RawPtrWillBeMember<RenderedDocumentMarker> >|. ...
6 years, 4 months ago (2014-08-14 01:17:15 UTC) #20
Klemen Forstnerič
tkent: PTAL Patch Set 10. Could you also clarify what you meant with your comment ...
6 years, 4 months ago (2014-08-14 16:42:54 UTC) #21
dcheng
https://codereview.chromium.org/419563003/diff/260001/Source/web/WebViewImpl.cpp File Source/web/WebViewImpl.cpp (right): https://codereview.chromium.org/419563003/diff/260001/Source/web/WebViewImpl.cpp#newcode3382 Source/web/WebViewImpl.cpp:3382: LocalFrame* localFrame = static_cast<LocalFrame*>(frame); Please use toLocalFrame() instead of ...
6 years, 4 months ago (2014-08-14 17:34:28 UTC) #22
Klemen Forstnerič
On 2014/08/14 17:34:28, dcheng (OOO) wrote: > https://codereview.chromium.org/419563003/diff/260001/Source/web/WebViewImpl.cpp > File Source/web/WebViewImpl.cpp (right): > > https://codereview.chromium.org/419563003/diff/260001/Source/web/WebViewImpl.cpp#newcode3382 ...
6 years, 4 months ago (2014-08-14 17:53:29 UTC) #23
Klemen Forstnerič
tkent: PTAL Patch Set 12.
6 years, 4 months ago (2014-08-14 18:34:04 UTC) #24
tkent
The CQ bit was checked by tkent@chromium.org
6 years, 4 months ago (2014-08-14 22:59:46 UTC) #25
tkent
lgtm https://codereview.chromium.org/419563003/diff/260001/Source/web/WebViewImpl.cpp File Source/web/WebViewImpl.cpp (right): https://codereview.chromium.org/419563003/diff/260001/Source/web/WebViewImpl.cpp#newcode3384 Source/web/WebViewImpl.cpp:3384: WebLocalFrameImpl::fromFrame(localFrame); On 2014/08/14 16:42:54, Klemen Forstnerič wrote: > ...
6 years, 4 months ago (2014-08-14 22:59:47 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/klemen.forstneric@gmail.com/419563003/300001
6 years, 4 months ago (2014-08-14 23:00:58 UTC) #27
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_blink_compile_dbg on tryserver.blink ...
6 years, 4 months ago (2014-08-14 23:33:35 UTC) #28
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-14 23:35:16 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: mac_blink_compile_dbg on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/mac_blink_compile_dbg/builds/16337) mac_blink_rel on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/mac_blink_rel/builds/19897) mac_gpu ...
6 years, 4 months ago (2014-08-14 23:35:18 UTC) #30
please use gerrit instead
The CQ bit was checked by rouslan@chromium.org
6 years, 4 months ago (2014-08-15 17:11:50 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/klemen.forstneric@gmail.com/419563003/320001
6 years, 4 months ago (2014-08-15 17:13:16 UTC) #32
commit-bot: I haz the power
Committed patchset #13 (320001) as 180382
6 years, 4 months ago (2014-08-15 18:09:09 UTC) #33
please use gerrit instead
Klemen: Thank you very much for the patch! Could you please address the following comments ...
6 years, 4 months ago (2014-08-15 19:08:07 UTC) #34
Klemen Forstnerič
https://codereview.chromium.org/419563003/diff/320001/Source/core/dom/DocumentMarkerController.cpp File Source/core/dom/DocumentMarkerController.cpp (right): https://codereview.chromium.org/419563003/diff/320001/Source/core/dom/DocumentMarkerController.cpp#newcode50 Source/core/dom/DocumentMarkerController.cpp:50: const Text& textNode) const { On 2014/08/15 19:08:07, Rouslan ...
6 years, 4 months ago (2014-08-16 15:45:50 UTC) #35
please use gerrit instead
6 years, 4 months ago (2014-08-16 19:54:36 UTC) #36
Message was sent while issue was closed.
https://codereview.chromium.org/419563003/diff/320001/Source/core/dom/Documen...
File Source/core/dom/DocumentMarkerController.cpp (right):

https://codereview.chromium.org/419563003/diff/320001/Source/core/dom/Documen...
Source/core/dom/DocumentMarkerController.cpp:526:
list->remove(list->find(markersToBeRemoved[j].get()));
On 2014/08/16 15:45:50, Klemen Forstnerič wrote:
> On 2014/08/15 19:08:07, Rouslan Solomakhin wrote:
> > 
> > Running list->find for every element in markersToBeRemoved may be slow (on
the
> > order of size of |list| times size of |markersToBeRemoved|). Instead of
> keeping
> > track of makers to be removed, I recommend keeping track of markers to keep
> and
> > then swapping that with |list|. That is:
> > 
> > -------------------------------
> > 
> > WillBeHeapVector<RawPtrWillBeMember<RenderedDocumentMarker> > markersToKeep;
> > for (size_t j = 0; list.get() && j < list->size(); ++j) {
> >     if (!i->key->isTextNode() || !shouldRemoveMarker(*list->at(j).get(),
> > static_cast<const Text&>(*i->key)))
> >         markersToKeep.append(list->at(j).get());
> > }
> > 
> > swap(*list, markersToKeep);
> > 
> > -------------------------------
> > 
> > I hope that compiles ;-).
> 
> I was able to make the code compile by making markersToKeep of type MarkerList
> and then transfering ownership of the markers I wanted to keep to that
> MarkerList. Unfortunately though, the code crashes the tab process. This is
the
> code I had:
> 
> MarkerList markersToKeep;
> for (size_t j = 0; list.get() && j < list->size(); ++j) {
>     if (!i->key->isTextNode() || !shouldRemoveMarker(*list->at(j).get(),
> static_cast<const Text&>(*i->key)))
>         markersToKeep.append(list->at(j).release());
> }
> 
> swap(*list, markersToKeep);
> 
> Thoughts? :-)

As discussed in IRC, you can discard my suggestion here, because the increased
complexity of memory management may not be worth the performance improvement.

If you're still interested in investigating the crash in your patch, then use
gdb and/or address sanitizer
(http://www.chromium.org/developers/testing/addresssanitizer).

Powered by Google App Engine
This is Rietveld 408576698