Summary: | [GTK] Utility methods for UA spellchecking | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Xan Lopez <xan.lopez> | ||||||
Component: | WebKitGTK | Assignee: | Xan Lopez <xan.lopez> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | mrobinson, xan.lopez | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Xan Lopez
2011-05-31 08:58:12 PDT
Created attachment 95439 [details]
Patch
Comment on attachment 95439 [details]
Patch
These methods are on WebFrame in Chromium. What's the reasoning behind having them in WebView here?
Since they operate on the selection/caret and there can be only one of those it seemed to me the common case is just "give me the stuff wherever it is", so I put them in WebView. If they were in Frame you'd need to figure out what frame you want to use from the UA. Not sure what's the reasoning behind having them in Frame for Chrome. (In reply to comment #3) > Since they operate on the selection/caret and there can be only one of those it seemed to me the common case is just "give me the stuff wherever it is", so I put them in WebView. If they were in Frame you'd need to figure out what frame you want to use from the UA. Not sure what's the reasoning behind having them in Frame for Chrome. Each frame has its own selection and caret actually. The correct approach probably involves moving from the hit test result of the context click, unfortunately. (In reply to comment #4) > Each frame has its own selection and caret actually. The correct approach probably involves moving from the hit test result of the context click, unfortunately. Is this ever exposed to the user? The usual way to access this from the DOM is window.getSelection(), which seems to assume that there's only one selection that you could possibly care about at any given time. I figured window ~= view and ran with that. Created attachment 95619 [details]
Patch
Comment on attachment 95619 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=95619&action=review Great! > Source/WebKit/gtk/webkit/webkitwebframe.cpp:1009 > + * Returns: a #WebKitDOMRange spanning the word, if any, where the > + * caret currently is positioned Should probably say something like: a #WebKitDOMRange spanning the word where the caret is currently positioned. If there is no caret this method returns null. Explicitly mentioning null here is a tipoff to embedders that they need to handle that. Comment on attachment 95619 [details]
Patch
This is confirmed.
|