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

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

Issue 894913002: Prevent default actions for JS-generated mouse events other than click (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: TIL, gclient sync may rebase changes back in time Created 5 years, 6 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 | « Source/core/events/MouseEvent.cpp ('k') | Source/platform/PlatformMouseEvent.h » ('j') | 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 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 if (!view) 1688 if (!view)
1689 return false; 1689 return false;
1690 1690
1691 RefPtrWillBeRawPtr<MouseEvent> me = MouseEvent::create(eventType, 1691 RefPtrWillBeRawPtr<MouseEvent> me = MouseEvent::create(eventType,
1692 true, true, m_frame->document()->domWindow(), 1692 true, true, m_frame->document()->domWindow(),
1693 0, event.globalPosition().x(), event.globalPosition().y(), event.positio n().x(), event.position().y(), 1693 0, event.globalPosition().x(), event.globalPosition().y(), event.positio n().x(), event.position().y(),
1694 event.movementDelta().x(), event.movementDelta().y(), 1694 event.movementDelta().x(), event.movementDelta().y(),
1695 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 1695 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(),
1696 0, MouseEvent::platformModifiersToButtons(event.modifiers()), nullptr, d ataTransfer); 1696 0, MouseEvent::platformModifiersToButtons(event.modifiers()), nullptr, d ataTransfer);
1697 1697
1698 dragTarget->dispatchEvent(me.get(), IGNORE_EXCEPTION); 1698 dragTarget->dispatchMouseEvent(me.get());
1699
1699 return me->defaultPrevented(); 1700 return me->defaultPrevented();
1700 } 1701 }
1701 1702
1702 static bool targetIsFrame(Node* target, LocalFrame*& frame) 1703 static bool targetIsFrame(Node* target, LocalFrame*& frame)
1703 { 1704 {
1704 if (!isHTMLFrameElementBase(target)) 1705 if (!isHTMLFrameElementBase(target))
1705 return false; 1706 return false;
1706 1707
1707 // Cross-process drag and drop is not yet supported. 1708 // Cross-process drag and drop is not yet supported.
1708 if (toHTMLFrameElementBase(target)->contentFrame() && !toHTMLFrameElementBas e(target)->contentFrame()->isLocalFrame()) 1709 if (toHTMLFrameElementBase(target)->contentFrame() && !toHTMLFrameElementBas e(target)->contentFrame()->isLocalFrame())
(...skipping 2494 matching lines...) Expand 10 before | Expand all | Expand 10 after
4203 unsigned EventHandler::accessKeyModifiers() 4204 unsigned EventHandler::accessKeyModifiers()
4204 { 4205 {
4205 #if OS(MACOSX) 4206 #if OS(MACOSX)
4206 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 4207 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
4207 #else 4208 #else
4208 return PlatformEvent::AltKey; 4209 return PlatformEvent::AltKey;
4209 #endif 4210 #endif
4210 } 4211 }
4211 4212
4212 } // namespace blink 4213 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/events/MouseEvent.cpp ('k') | Source/platform/PlatformMouseEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698