Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 2107093003: Revert middle click related changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/events/MouseEvent.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 m_clickNode->updateDistribution(); 1185 m_clickNode->updateDistribution();
1186 mev.innerNode()->updateDistribution(); 1186 mev.innerNode()->updateDistribution();
1187 clickTargetNode = mev.innerNode()->commonAncestor( 1187 clickTargetNode = mev.innerNode()->commonAncestor(
1188 *m_clickNode, parentForClickEvent); 1188 *m_clickNode, parentForClickEvent);
1189 } 1189 }
1190 if (clickTargetNode) { 1190 if (clickTargetNode) {
1191 // Dispatch mouseup directly w/o calling updateMouseEventTargetNodeA ndSendEvents 1191 // Dispatch mouseup directly w/o calling updateMouseEventTargetNodeA ndSendEvents
1192 // because the mouseup dispatch above has already updated it 1192 // because the mouseup dispatch above has already updated it
1193 // correctly. Moreover, clickTargetNode is different from 1193 // correctly. Moreover, clickTargetNode is different from
1194 // mev.innerNode at drag-release. 1194 // mev.innerNode at drag-release.
1195 1195 clickEventResult = toWebInputEventResult(clickTargetNode->dispatchMo useEvent(mev.event(),
1196 MouseEvent* event = MouseEvent::create( 1196 EventTypeNames::click, m_clickCount));
1197 EventTypeNames::click,
1198 clickTargetNode->document().domWindow(),
1199 mev.event(), m_clickCount, nullptr);
1200
1201 // This is to suppress sending click events for non-primary buttons.
1202 // But still doing default action like opening a new tab for middle
1203 // click (crbug.com/255).
1204 if (mev.event().button() != MouseButton::LeftButton)
1205 event->stopPropagation();
1206
1207 clickEventResult = toWebInputEventResult(clickTargetNode->dispatchEv ent(event));
1208 } 1197 }
1209 } 1198 }
1210 1199
1211 m_scrollManager.clearResizeScrollableArea(false); 1200 m_scrollManager.clearResizeScrollableArea(false);
1212 1201
1213 if (eventResult == WebInputEventResult::NotHandled) 1202 if (eventResult == WebInputEventResult::NotHandled)
1214 eventResult = handleMouseReleaseEvent(mev); 1203 eventResult = handleMouseReleaseEvent(mev);
1215 1204
1216 invalidateClick(); 1205 invalidateClick();
1217 1206
(...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after
2850 2839
2851 FrameHost* EventHandler::frameHost() const 2840 FrameHost* EventHandler::frameHost() const
2852 { 2841 {
2853 if (!m_frame->page()) 2842 if (!m_frame->page())
2854 return nullptr; 2843 return nullptr;
2855 2844
2856 return &m_frame->page()->frameHost(); 2845 return &m_frame->page()->frameHost();
2857 } 2846 }
2858 2847
2859 } // namespace blink 2848 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/MouseEvent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698