[Webkit-unassigned] [Bug 33364] [Chromium] Should not select a word on right-click in editable text

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 14 21:51:42 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=33364


Darin Fisher (:fishd, Google) <fishd at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #46552|review?                     |review-
               Flag|                            |




--- Comment #12 from Darin Fisher (:fishd, Google) <fishd at chromium.org>  2010-01-14 21:51:41 PST ---
(From update of attachment 46552)

> +++ b/WebKit/chromium/public/WebFrame.h
> @@ -327,6 +327,9 @@ public:
>  
>      // Replaces the selection with the given text.
>      virtual void replaceSelection(const WebString& text) = 0;
> +    // Replaces the selection with the given text or replaces a word around the

^^^ please insert a new line above the comment so that there is a new line
between functions.


> +    virtual void replaceWord(const WebString& text) = 0;

I think you should give this function a more descriptive name.  I'm also
concerned that it has the side-effect of altering the selection.  Perhaps
for the WebKit API we should really break this up.  We already have a
hasSelection() method, so it seems like you could just add a method
that causes selection to be set at the word around the caret.  Like this:

  virtual void selectWordAroundCaret() = 0;


> +++ b/WebKit/chromium/src/WebFrameImpl.cpp
...
> +void WebFrameImpl::replaceWord(const WebString& text)
> +{
> +    SelectionController* controller = frame()->selection();
> +    // Should have a caret or a ranged selection because the corrected word was
> +    // based on them. See selectMisspelledWord() in ContextMenuClientImpl.cpp.
> +    ASSERT(!controller->isNone());

It seems like there could be a race here.  Do we allow events to be processed
between the time selectMisspelledWord is called and the time that replaceWord
is called?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list