Bug 72847

Summary: Refactoring: SpellChecker::requestCheckingFor should take Range instead of Node.
Product: WebKit Reporter: Shinya Kawanaka <shinyak>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, morrita, shinyak, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 71991    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

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.