Changeset 72618 in webkit


Ignore:
Timestamp:
Nov 23, 2010 11:33:57 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2010-11-23 Avi Drissman <avi@google.com>

Reviewed by Antonio Gomes.

Add preference to not select when right-clicked
https://bugs.webkit.org/show_bug.cgi?id=23351

  • editing/selection/context-menu-text-selection-expected.txt: Added.
  • editing/selection/context-menu-text-selection.html: Added.

2010-11-23 Avi Drissman <avi@google.com>

Reviewed by Antonio Gomes.

Add preference to not select when right-clicked
https://bugs.webkit.org/show_bug.cgi?id=23351

Test: editing/selection/context-menu-text-selection.html

  • editing/EditingBehavior.h: (WebCore::EditingBehavior::shouldSelectOnContextualMenuClick):
  • page/EventHandler.cpp: (WebCore::EventHandler::sendContextMenuEvent):
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r72615 r72618  
     12010-11-23  Avi Drissman  <avi@google.com>
     2
     3        Reviewed by Antonio Gomes.
     4
     5        Add preference to not select when right-clicked
     6        https://bugs.webkit.org/show_bug.cgi?id=23351
     7
     8        * editing/selection/context-menu-text-selection-expected.txt: Added.
     9        * editing/selection/context-menu-text-selection.html: Added.
     10
    1112010-11-23  Alexander Pavlov  <apavlov@chromium.org>
    212
  • trunk/WebCore/ChangeLog

    r72615 r72618  
     12010-11-23  Avi Drissman  <avi@google.com>
     2
     3        Reviewed by Antonio Gomes.
     4
     5        Add preference to not select when right-clicked
     6        https://bugs.webkit.org/show_bug.cgi?id=23351
     7
     8        Test: editing/selection/context-menu-text-selection.html
     9
     10        * editing/EditingBehavior.h:
     11        (WebCore::EditingBehavior::shouldSelectOnContextualMenuClick):
     12        * page/EventHandler.cpp:
     13        (WebCore::EventHandler::sendContextMenuEvent):
     14
    1152010-11-23  Alexander Pavlov  <apavlov@chromium.org>
    216
  • trunk/WebCore/editing/EditingBehavior.h

    r67909 r72618  
    5858    bool shouldAlwaysGrowSelectionWhenExtendingToBoundary() const { return m_type == EditingMacBehavior; }
    5959
     60    // On Mac, when processing a contextual click, the object being clicked upon should be selected.
     61    bool shouldSelectOnContextualMenuClick() const { return m_type == EditingMacBehavior; }
     62
    6063private:
    6164    EditingBehaviorType m_type;
  • trunk/WebCore/page/EventHandler.cpp

    r72013 r72618  
    20082008    MouseEventWithHitTestResults mev = doc->prepareMouseEvent(request, viewportPos, event);
    20092009
    2010     // Context menu events shouldn't select text in GTK+ applications or in Chromium.
    2011     // FIXME: This should probably be configurable by embedders. Consider making it a WebPreferences setting.
    2012     // See: https://bugs.webkit.org/show_bug.cgi?id=15279
    2013 #if !PLATFORM(GTK) && !PLATFORM(CHROMIUM)
    2014     if (!m_frame->selection()->contains(viewportPos)
     2010    if (m_frame->editor()->behavior().shouldSelectOnContextualMenuClick()
     2011        && !m_frame->selection()->contains(viewportPos)
    20152012        // FIXME: In the editable case, word selection sometimes selects content that isn't underneath the mouse.
    20162013        // If the selection is non-editable, we do word selection to make it easier to use the contextual menu items
     
    20202017        selectClosestWordOrLinkFromMouseEvent(mev);
    20212018    }
    2022 #endif
    20232019
    20242020    swallowEvent = dispatchMouseEvent(eventNames().contextmenuEvent, mev.targetNode(), true, 0, event, false);
Note: See TracChangeset for help on using the changeset viewer.