Bug 72847 - Refactoring: SpellChecker::requestCheckingFor should take Range instead of Node.
Summary: Refactoring: SpellChecker::requestCheckingFor should take Range instead of Node.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 71991
  Show dependency treegraph
 
Reported: 2011-11-20 20:18 PST by Shinya Kawanaka
Modified: 2011-11-21 01:21 PST (History)
4 users (show)

See Also:


Attachments
Patch (8.41 KB, patch)
2011-11-20 20:36 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (8.26 KB, patch)
2011-11-20 22:00 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff
Patch (8.30 KB, patch)
2011-11-20 23:30 PST, Shinya Kawanaka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shinya Kawanaka 2011-11-20 20:18:59 PST
Current SpellChecker::requestCheckingFor takes Node as an argument.
This may be too wide, so should be Range.
Also, this is required to implement asynchronous spellchecker.
Comment 1 Shinya Kawanaka 2011-11-20 20:36:34 PST
Created attachment 116023 [details]
Patch
Comment 2 Hajime Morrita 2011-11-20 20:54:10 PST
Comment on attachment 116023 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=116023&action=review

> Source/WebCore/editing/Editor.cpp:415
>      Node* nodeToCheck = m_frame->selection()->rootEditableElement();

We can create a Range from the selection, instead of using the root editable node. It would save the size of the checked text.
I don't think the change needs to be done in this patch. But registering a new bug is highly welcome ;-)

> Source/WebCore/editing/Editor.cpp:416
> +    RefPtr<Range> rangeToCheck = Range::create(m_frame->document(), firstPositionInNode(nodeToCheck), lastPositionInNode(nodeToCheck));

You can use PassRefPtr here.

> Source/WebCore/editing/SpellChecker.cpp:-111
> -void SpellChecker::requestCheckingFor(TextCheckingTypeMask mask, Node* node)

A pattern is to give a usual name to outer function and call internal one as XxInternal() or doXx()
Comment 3 Shinya Kawanaka 2011-11-20 22:00:26 PST
Created attachment 116028 [details]
Patch
Comment 4 Hajime Morrita 2011-11-20 22:07:48 PST
Comment on attachment 116028 [details]
Patch

Looks good.
Comment 5 WebKit Review Bot 2011-11-20 22:28:21 PST
Comment on attachment 116028 [details]
Patch

Attachment 116028 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10533167

New failing tests:
editing/pasteboard/paste-table-001.html
Comment 6 Shinya Kawanaka 2011-11-20 23:30:00 PST
Created attachment 116034 [details]
Patch
Comment 7 WebKit Review Bot 2011-11-21 01:21:12 PST
Comment on attachment 116034 [details]
Patch

Clearing flags on attachment: 116034

Committed r100890: <http://trac.webkit.org/changeset/100890>
Comment 8 WebKit Review Bot 2011-11-21 01:21:17 PST
All reviewed patches have been landed.  Closing bug.