OLD | NEW |
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 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1652 | 1652 |
1653 | 1653 |
1654 bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Node* dragTa
rget, const PlatformMouseEvent& event, DataTransfer* dataTransfer) | 1654 bool EventHandler::dispatchDragEvent(const AtomicString& eventType, Node* dragTa
rget, const PlatformMouseEvent& event, DataTransfer* dataTransfer) |
1655 { | 1655 { |
1656 FrameView* view = m_frame->view(); | 1656 FrameView* view = m_frame->view(); |
1657 | 1657 |
1658 // FIXME: We might want to dispatch a dragleave even if the view is gone. | 1658 // FIXME: We might want to dispatch a dragleave even if the view is gone. |
1659 if (!view) | 1659 if (!view) |
1660 return false; | 1660 return false; |
1661 | 1661 |
1662 // FIXME: The drag event have to support for |buttons| attribute because | |
1663 // the event is derived from mouse event. Please see crbug.com/276941. | |
1664 RefPtrWillBeRawPtr<MouseEvent> me = MouseEvent::create(eventType, | 1662 RefPtrWillBeRawPtr<MouseEvent> me = MouseEvent::create(eventType, |
1665 true, true, m_frame->document()->domWindow(), | 1663 true, true, m_frame->document()->domWindow(), |
1666 0, event.globalPosition().x(), event.globalPosition().y(), event.positio
n().x(), event.position().y(), | 1664 0, event.globalPosition().x(), event.globalPosition().y(), event.positio
n().x(), event.position().y(), |
1667 event.movementDelta().x(), event.movementDelta().y(), | 1665 event.movementDelta().x(), event.movementDelta().y(), |
1668 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), | 1666 event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), |
1669 0, 0, nullptr, dataTransfer); | 1667 0, MouseEvent::platformModifiersToButtons(event.modifiers()), nullptr, d
ataTransfer); |
1670 | 1668 |
1671 dragTarget->dispatchEvent(me.get(), IGNORE_EXCEPTION); | 1669 dragTarget->dispatchEvent(me.get(), IGNORE_EXCEPTION); |
1672 return me->defaultPrevented(); | 1670 return me->defaultPrevented(); |
1673 } | 1671 } |
1674 | 1672 |
1675 static bool targetIsFrame(Node* target, LocalFrame*& frame) | 1673 static bool targetIsFrame(Node* target, LocalFrame*& frame) |
1676 { | 1674 { |
1677 if (!isHTMLFrameElementBase(target)) | 1675 if (!isHTMLFrameElementBase(target)) |
1678 return false; | 1676 return false; |
1679 | 1677 |
(...skipping 2226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3906 unsigned EventHandler::accessKeyModifiers() | 3904 unsigned EventHandler::accessKeyModifiers() |
3907 { | 3905 { |
3908 #if OS(MACOSX) | 3906 #if OS(MACOSX) |
3909 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3907 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
3910 #else | 3908 #else |
3911 return PlatformEvent::AltKey; | 3909 return PlatformEvent::AltKey; |
3912 #endif | 3910 #endif |
3913 } | 3911 } |
3914 | 3912 |
3915 } // namespace blink | 3913 } // namespace blink |
OLD | NEW |