Changeset 196112 in webkit
- Timestamp:
- Feb 4, 2016, 12:25:28 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r196105 r196112 1 2016-02-03 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Do not show context menu when right clicking on a scrollbar 4 https://bugs.webkit.org/show_bug.cgi?id=153493 5 6 Reviewed by Michael Catanzaro. 7 8 Add a test to check that context menu event is not sent when right 9 clicking on a scrollbar. 10 11 * fast/events/contextmenu-on-scrollbars-expected.txt: Added. 12 * fast/events/contextmenu-on-scrollbars.html: Added. 13 1 14 2016-02-03 Beth Dakin <bdakin@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r196104 r196112 1 2016-02-03 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Do not show context menu when right clicking on a scrollbar 4 https://bugs.webkit.org/show_bug.cgi?id=153493 5 6 Reviewed by Michael Catanzaro. 7 8 Scrollbars don't currently handle right clicks, but we are showing 9 the context menu when they are right clicked. This is not desired 10 at least in GTK+ and I've checked that it isn't consistent with 11 other applications in Mac either. 12 13 Test: fast/events/contextmenu-on-scrollbars.html 14 15 * page/EventHandler.cpp: 16 (WebCore::EventHandler::sendContextMenuEvent): 17 1 18 2016-02-03 Andreas Kling <akling@apple.com> 2 19 -
trunk/Source/WebCore/page/EventHandler.cpp
r196080 r196112 2693 2693 { 2694 2694 Document* doc = m_frame.document(); 2695 FrameView* v = m_frame.view();2696 if (!v )2697 return false; 2698 2695 FrameView* view = m_frame.view(); 2696 if (!view) 2697 return false; 2698 2699 2699 // Clear mouse press state to avoid initiating a drag while context menu is up. 2700 2700 m_mousePressed = false; 2701 2701 bool swallowEvent; 2702 LayoutPoint viewportPos = v ->windowToContents(event.position());2702 LayoutPoint viewportPos = view->windowToContents(event.position()); 2703 2703 HitTestRequest request(HitTestRequest::Active | HitTestRequest::DisallowShadowContent); 2704 2704 MouseEventWithHitTestResults mouseEvent = doc->prepareMouseEvent(request, viewportPos, event); 2705 2705 2706 // Do not show context menus when clicking on scrollbars. 2707 if (mouseEvent.scrollbar() || view->scrollbarAtPoint(event.position())) 2708 return false; 2709 2706 2710 if (m_frame.editor().behavior().shouldSelectOnContextualMenuClick() 2707 2711 && !m_frame.selection().contains(viewportPos) 2708 && !mouseEvent.scrollbar()2709 2712 // FIXME: In the editable case, word selection sometimes selects content that isn't underneath the mouse. 2710 2713 // If the selection is non-editable, we do word selection to make it easier to use the contextual menu items
Note:
See TracChangeset
for help on using the changeset viewer.