Re: Fix the range returned by findFirstMisspelling (issue 908303002 by sbaig1@bloomberg.net)

0 views
Skip to first unread message

yo...@chromium.org

unread,
May 20, 2015, 10:28:50 PM5/20/15
to sba...@bloomberg.net, blink-...@chromium.org, groby+bl...@chromium.org
Sorry for super late response. m(_ _)m


https://codereview.chromium.org/908303002/diff/1/Source/core/editing/TextCheckingHelper.cpp
File Source/core/editing/TextCheckingHelper.cpp (right):

https://codereview.chromium.org/908303002/diff/1/Source/core/editing/TextCheckingHelper.cpp#newcode272
Source/core/editing/TextCheckingHelper.cpp:272: firstMisspellingRange =
Range::create(misspellingStart.containerNode()->document(),
misspellingStart, misspellingEnd);
It seems current code is correct, since |misspellingStart == m_start|
and |misspellingEnd == m_end|.

https://codereview.chromium.org/908303002/

sba...@bloomberg.net

unread,
May 21, 2015, 5:19:39 AM5/21/15
to yo...@chromium.org, blink-...@chromium.org, groby+bl...@chromium.org
It does look like that at first, doesn't it? :)

It took me a while to figure out, but they are actually not the same because
|misspellingStart| and |misspellingEnd| are modified by the
|TextIterator::subrange| function.


https://codereview.chromium.org/908303002/

yo...@chromium.org

unread,
May 21, 2015, 9:32:48 PM5/21/15
to sba...@bloomberg.net, blink-...@chromium.org, groby+bl...@chromium.org
Good catch! It is difficult to know that. Using non-const reference isn't
good.
We should use pointer.

Could you write test script for your change?
I think DocumentMarkerControllerTest.cpp is the best place.

Thanks!


https://codereview.chromium.org/908303002/

sba...@bloomberg.net

unread,
May 22, 2015, 7:51:06 AM5/22/15
to yo...@chromium.org, blink-...@chromium.org, groby+bl...@chromium.org
On 2015/05/22 01:32:48, Yosi_UTC9 wrote:
> Could you write test script for your change?
> I think DocumentMarkerControllerTest.cpp is the best place.


Hmm, I looked at DocumentMarkerControllerTest.cpp but not sure what's the
best
way to test this there. The TextCheckingHelper needs a SpellCheckerClient,
and
looks like the DummyPageHolder inside DocumentMarkerControllerTest.cpp
doesn't
create a SpellCheckerClient.

I noticed that HTMLTextFormControlElementTest.cpp does have a
DummySpellCheckerClient.

So I wonder if HTMLTextFormControlElementTest.cpp would be a better place?
Or
do you think we should add a DummySpellCheckerClient to
DocumentMarkerControllerTest.cpp?


https://codereview.chromium.org/908303002/

yo...@chromium.org

unread,
May 25, 2015, 12:25:15 AM5/25/15
to sba...@bloomberg.net, blink-...@chromium.org, groby+bl...@chromium.org
On 2015/05/22 11:51:05, Shezan Baig (Bloomberg) wrote:
> So I wonder if HTMLTextFormControlElementTest.cpp would be a better
> place? Or
> do you think we should add a DummySpellCheckerClient to
> DocumentMarkerControllerTest.cpp?

I prefer DocumentMarkerControllerTest.cpp to have test script in same
directory.


https://codereview.chromium.org/908303002/
Reply all
Reply to author
Forward
0 new messages