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

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

Issue 727593003: Implement MouseEvent buttons attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
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 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
1628 1628
1629 1629
1630 bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Node* dragTa rget, const PlatformMouseEvent& event, DataTransfer* dataTransfer) 1630 bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Node* dragTa rget, const PlatformMouseEvent& event, DataTransfer* dataTransfer)
1631 { 1631 {
1632 FrameView* view = m_frame->view(); 1632 FrameView* view = m_frame->view();
1633 1633
1634 // FIXME: We might want to dispatch a dragleave even if the view is gone. 1634 // FIXME: We might want to dispatch a dragleave even if the view is gone.
1635 if (!view) 1635 if (!view)
1636 return false; 1636 return false;
1637 1637
1638 // FIXME: The drag event have to support for |buttons| attribute because
1639 // the event is derived from mouse event. Please see crbug.com/276941.
1638 RefPtrWillBeRawPtr<MouseEvent> me = MouseEvent::create(eventType, 1640 RefPtrWillBeRawPtr<MouseEvent> me = MouseEvent::create(eventType,
1639 true, true, m_frame->document()->domWindow(), 1641 true, true, m_frame->document()->domWindow(),
1640 0, event.globalPosition().x(), event.globalPosition().y(), event.positio n().x(), event.position().y(), 1642 0, event.globalPosition().x(), event.globalPosition().y(), event.positio n().x(), event.position().y(),
1641 event.movementDelta().x(), event.movementDelta().y(), 1643 event.movementDelta().x(), event.movementDelta().y(),
1642 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 1644 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(),
1643 0, nullptr, dataTransfer); 1645 0, 0, nullptr, dataTransfer);
1644 1646
1645 dragTarget->dispatchEvent(me.get(), IGNORE_EXCEPTION); 1647 dragTarget->dispatchEvent(me.get(), IGNORE_EXCEPTION);
1646 return me->defaultPrevented(); 1648 return me->defaultPrevented();
1647 } 1649 }
1648 1650
1649 static bool targetIsFrame(Node* target, LocalFrame*& frame) 1651 static bool targetIsFrame(Node* target, LocalFrame*& frame)
1650 { 1652 {
1651 if (!isHTMLFrameElementBase(target)) 1653 if (!isHTMLFrameElementBase(target))
1652 return false; 1654 return false;
1653 1655
(...skipping 2205 matching lines...) Expand 10 before | Expand all | Expand 10 after
3859 unsigned EventHandler::accessKeyModifiers() 3861 unsigned EventHandler::accessKeyModifiers()
3860 { 3862 {
3861 #if OS(MACOSX) 3863 #if OS(MACOSX)
3862 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3864 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3863 #else 3865 #else
3864 return PlatformEvent::AltKey; 3866 return PlatformEvent::AltKey;
3865 #endif 3867 #endif
3866 } 3868 }
3867 3869
3868 } // namespace blink 3870 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698