Bug 15279 - Right clicking over text (or multiple spaces) auto selects the word (or multiple spaces) under it
: Right clicking over text (or multiple spaces) auto selects the word (or multi...
Status: RESOLVED FIXED
: WebKit
WebCore Misc.
: 523.x (Safari 3)
: PC All
: P2 Normal
Assigned To:
:
: InRadar, ReviewedForRadar
:
:
  Show dependency treegraph
 
Reported: 2007-09-25 11:50 PST by
Modified: 2010-04-27 11:07 PST (History)


Attachments
Disables the word selection behavior for Chromium using an #ifdef. (1.58 KB, patch)
2008-11-12 15:02 PST, Aaron Boodman
no flags Review Patch | Details | Formatted Diff | Diff
Disables the word selection behavior for Chromium, take 2 (1.79 KB, patch)
2008-11-12 22:57 PST, Aaron Boodman
aroben: review+
Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2007-09-25 11:50:04 PST
Due to changes made in WebCore/page/EventHandler.cpp at @24499 & @24561, when I right click on a page, the word under is auto selected and I don't see the correct context menu (Reload, View Source etc). Instead a selection based menu of Search with Google, Copy etc is shown.
------- Comment #1 From 2007-09-25 12:59:35 PST -------
At least, it seems broken that this happens when right clicking on a link.
------- Comment #2 From 2007-09-25 13:44:15 PST -------
As you can see in the ChangeLog comments from r24499 <http://trac.webkit.org/projects/webkit/changeset/24499>, this is actually expected behavior. If you click on something other than a block of text, no selection should be made and you should see the Reload/View Source menu as you expected.
------- Comment #3 From 2007-09-25 14:12:26 PST -------
Really?  Even for hyperlinks?
------- Comment #4 From 2007-09-25 14:23:50 PST -------
This can't be wontfix.  At least it is very broken behavior on Windows.  Can we at least make it possible for embedders to define their own behavior here?
------- Comment #5 From 2007-09-25 14:29:39 PST -------
The behaviour when ctrl-clicking on a link in WebKit differs from that in TextEdit, so I think this is worthy of some investigation.  Ctrl-clicking on a link in TextEdit selects the entire URL, while in WebKit it only selects the word under the cursor.  There may be issues with right-clicking on other platforms at well, but at the very least this issue exists on Mac OS as well.
------- Comment #6 From 2007-09-25 14:29:58 PST -------
<rdar://problem/5450655>
------- Comment #7 From 2007-09-25 14:51:54 PST -------
(In reply to comment #4)
> At least it is very broken behavior on Windows.

ToT on Windows behaves the same as ToT on Mac for me in regards to selection behavior and the contents of the context menu, etc.
------- Comment #8 From 2008-03-10 13:18:58 PST -------
*** Bug 17747 has been marked as a duplicate of this bug. ***
------- Comment #9 From 2008-03-10 13:23:26 PST -------
*** Bug 14399 has been marked as a duplicate of this bug. ***
------- Comment #10 From 2008-04-06 02:24:41 PST -------
On the GTK+ port there's the same problem. When i right-click it selects the words before the cursor.
------- Comment #11 From 2008-06-06 03:24:29 PST -------
*** Bug 19039 has been marked as a duplicate of this bug. ***
------- Comment #12 From 2008-11-12 15:02:35 PST -------
Created an attachment (id=25104) [details]
Disables the word selection behavior for Chromium using an #ifdef. 
------- Comment #13 From 2008-11-12 15:11:46 PST -------
(From update of attachment 25104 [details])
You should set the review flag to "r?" for new patches to indicate that your patch is ready to review.

> +2008-11-12  aa  <set EMAIL_ADDRESS environment variable>

You should set the EMAIL_ADDRESS environment variable so that prepare-ChangeLog can fill in your email address correctly. You should also set the CHANGE_LOG_NAME environment variable to the name you want used in ChangeLogs.

> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        * page/EventHandler.cpp:
> +        (WebCore::EventHandler::sendContextMenuEvent):
> +        
> +        Disable word selection on context click for PLATFORM(CHROMIUM).

Normally we reference the Bugzilla bug we're fixing in the ChangeLog. Something like this:

Chromium fix for Bug 15279: Right clicking over text (or multiple spaces) auto selects the word (or multiple spaces) under it

<https://bugs.webkit.org/show_bug.cgi?id=15279>

> @@ -1627,8 +1627,9 @@ bool EventHandler::sendContextMenuEvent(
>      IntPoint viewportPos = v->windowToContents(event.pos());
>      MouseEventWithHitTestResults mev = doc->prepareMouseEvent(HitTestRequest(false, true), viewportPos, event);
>  
> -    // Context menu events shouldn't select text in GTK+ applications.
> -#if !PLATFORM(GTK)
> +    // Context menu events shouldn't select text in GTK+ applications or in Chromium.
> +    // TODO: This should probably be configurable by embedders. Consider making it a WebPreferences setting.

We normally use FIXME instead of TODO. If you have filed the bug for WebPreferences you could reference it here with a URL.

r=me

-Adam
------- Comment #14 From 2008-11-12 15:28:51 PST -------
Note: I talked about this on IRC with aroben. For now, we're going to change this using a macro, but in the future (perhaps when the Chromium mac team gets to this area), we should change it to use a WebPreferences setting.
------- Comment #15 From 2008-11-12 22:57:31 PST -------
Created an attachment (id=25117) [details]
Disables the word selection behavior for Chromium, take 2

New patch. I believe I've addressed all your comments.
------- Comment #16 From 2008-11-13 07:26:45 PST -------
(From update of attachment 25117 [details])
> Index: WebCore/ChangeLog
> ===================================================================
> --- WebCore/ChangeLog	(revision 38339)
> +++ WebCore/ChangeLog	(working copy)
> @@ -1,3 +1,16 @@
> +2008-11-12  aa  aa@chromium.org

We normally use full names in ChangeLog headers, but this isn't a requirement.

r=me
------- Comment #17 From 2008-12-02 12:38:33 PST -------
Shouldn't this only be disabled for chromium on windows and linux?
------- Comment #18 From 2009-01-15 11:31:25 PST -------
Committed in https://bugs.webkit.org/show_bug.cgi?id=23351

New bug for solution with WebPreferences created: https://bugs.webkit.org/show_bug.cgi?id=23351