Bug 39291

Summary: [Qt] Links are selected on right click by default
Product: WebKit Reporter: Pierre Rossi <pierre.rossi>
Component: TextAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Minor CC: benjamin, kling, tonikitoo
Priority: P5 Keywords: Qt, QtTriaged
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 23351    
Bug Blocks:    

Description Pierre Rossi 2010-05-18 07:25:50 PDT
And the current selection is discarded as a consequence.
The behavior seems different on Chromium though.
Comment 1 Antonio Gomes 2010-05-18 07:32:24 PDT
imo, it either depends on bug 23351 or is a duplicated of bug 36627

ps: when reporting, please use the 'Qt' Keyword, assign to unassigned-qtwebkit-bugs and etc ...
Comment 2 Antonio Gomes 2010-05-18 07:40:38 PDT
more info here:

WebCore/page/EventHandler.cpp
(...)
#if ENABLE(CONTEXT_MENUS)
bool EventHandler::sendContextMenuEvent(const PlatformMouseEvent& event)
{
  Document* doc = m_frame->document();
  FrameView* v = m_frame->view();
  if (!v)
      return false;
(...)

  // Context menu events shouldn't select text in GTK+ applications or in Chromium.
  // FIXME: This should probably be configurable by embedders. Consider making it a WebPreferences setting.
  // See: https://bugs.webkit.org/show_bug.cgi?id=15279
#if !PLATFORM(GTK) && !PLATFORM(CHROMIUM)
  if (!m_frame->selection()->contains(viewportPos) && 
    // FIXME: In the editable case, word selection sometimes selects content that isn't underneath the mouse.
    // If the selection is non-editable, we do word selection to make it easier to use the contextual menu items
    // available for text selections.  But only if we're above text.
    (m_frame->selection()->isContentEditable() || (mev.targetNode() && mev.targetNode()->isTextNode()))) {
    m_mouseDownMayStartSelect = true; // context menu events are always allowed to perform a selection
    selectClosestWordOrLinkFromMouseEvent(mev);
  }
#endif
(...)
Comment 3 Benjamin Poulain 2010-11-10 07:15:21 PST
Pierre, this bug is for you :). It should be trivial as soon as Antonio land 23351.
Comment 4 Antonio Gomes 2010-11-10 07:35:39 PST
(In reply to comment #3)
> Pierre, this bug is for you :). It should be trivial as soon as Antonio land 23351.

Plan is for it to land tonight :)
Comment 5 Pierre Rossi 2010-11-26 04:39:48 PST
Fixed as a consequence of fixing 23351.
The test editing/selection/context-menu-text-selection.html works as well, so there is really nothing left to do about this. :)