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 3126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3137 bool EventHandler::tryStartDrag(const MouseEventWithHitTestResults& event) | 3137 bool EventHandler::tryStartDrag(const MouseEventWithHitTestResults& event) |
3138 { | 3138 { |
3139 freeClipboard(); // would only happen if we missed a dragEnd. Do it anyway,
just | 3139 freeClipboard(); // would only happen if we missed a dragEnd. Do it anyway,
just |
3140 // to make sure it gets numbified | 3140 // to make sure it gets numbified |
3141 dragState().m_dragClipboard = createDraggingClipboard(); | 3141 dragState().m_dragClipboard = createDraggingClipboard(); |
3142 | 3142 |
3143 // Check to see if this a DOM based drag, if it is get the DOM specified dra
g | 3143 // Check to see if this a DOM based drag, if it is get the DOM specified dra
g |
3144 // image and offset | 3144 // image and offset |
3145 if (dragState().m_dragType == DragSourceActionDHTML) { | 3145 if (dragState().m_dragType == DragSourceActionDHTML) { |
3146 if (RenderObject* renderer = dragState().m_dragSrc->renderer()) { | 3146 if (RenderObject* renderer = dragState().m_dragSrc->renderer()) { |
3147 // FIXME: This doesn't work correctly with transforms. | 3147 FloatPoint absPos = renderer->localToAbsolute(FloatPoint(), UseTrans
forms); |
3148 FloatPoint absPos = renderer->localToAbsolute(); | |
3149 IntSize delta = m_mouseDownPos - roundedIntPoint(absPos); | 3148 IntSize delta = m_mouseDownPos - roundedIntPoint(absPos); |
3150 dragState().m_dragClipboard->setDragImageElement(dragState().m_dragS
rc.get(), IntPoint(delta)); | 3149 dragState().m_dragClipboard->setDragImageElement(dragState().m_dragS
rc.get(), IntPoint(delta)); |
3151 } else { | 3150 } else { |
3152 // The renderer has disappeared, this can happen if the onStartDrag
handler has hidden | 3151 // The renderer has disappeared, this can happen if the onStartDrag
handler has hidden |
3153 // the element in some way. In this case we just kill the drag. | 3152 // the element in some way. In this case we just kill the drag. |
3154 return false; | 3153 return false; |
3155 } | 3154 } |
3156 } | 3155 } |
3157 | 3156 |
3158 DragController& dragController = m_frame->page()->dragController(); | 3157 DragController& dragController = m_frame->page()->dragController(); |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3730 unsigned EventHandler::accessKeyModifiers() | 3729 unsigned EventHandler::accessKeyModifiers() |
3731 { | 3730 { |
3732 #if OS(MACOSX) | 3731 #if OS(MACOSX) |
3733 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3732 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
3734 #else | 3733 #else |
3735 return PlatformEvent::AltKey; | 3734 return PlatformEvent::AltKey; |
3736 #endif | 3735 #endif |
3737 } | 3736 } |
3738 | 3737 |
3739 } // namespace WebCore | 3738 } // namespace WebCore |
OLD | NEW |