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

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

Issue 286903011: Show DragImage when the dragged element or its parent has transform (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 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 | « no previous file | Source/core/rendering/RenderObject.cpp » ('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 3147 matching lines...) Expand 10 before | Expand all | Expand 10 after
3158 bool EventHandler::tryStartDrag(const MouseEventWithHitTestResults& event) 3158 bool EventHandler::tryStartDrag(const MouseEventWithHitTestResults& event)
3159 { 3159 {
3160 freeClipboard(); // would only happen if we missed a dragEnd. Do it anyway, just 3160 freeClipboard(); // would only happen if we missed a dragEnd. Do it anyway, just
3161 // to make sure it gets numbified 3161 // to make sure it gets numbified
3162 dragState().m_dragClipboard = createDraggingClipboard(); 3162 dragState().m_dragClipboard = createDraggingClipboard();
3163 3163
3164 // Check to see if this a DOM based drag, if it is get the DOM specified dra g 3164 // Check to see if this a DOM based drag, if it is get the DOM specified dra g
3165 // image and offset 3165 // image and offset
3166 if (dragState().m_dragType == DragSourceActionDHTML) { 3166 if (dragState().m_dragType == DragSourceActionDHTML) {
3167 if (RenderObject* renderer = dragState().m_dragSrc->renderer()) { 3167 if (RenderObject* renderer = dragState().m_dragSrc->renderer()) {
3168 // FIXME: This doesn't work correctly with transforms. 3168 FloatPoint absPos = renderer->localToAbsolute(FloatPoint(), UseTrans forms);
3169 FloatPoint absPos = renderer->localToAbsolute();
3170 IntSize delta = m_mouseDownPos - roundedIntPoint(absPos); 3169 IntSize delta = m_mouseDownPos - roundedIntPoint(absPos);
3171 dragState().m_dragClipboard->setDragImageElement(dragState().m_dragS rc.get(), IntPoint(delta)); 3170 dragState().m_dragClipboard->setDragImageElement(dragState().m_dragS rc.get(), IntPoint(delta));
3172 } else { 3171 } else {
3173 // The renderer has disappeared, this can happen if the onStartDrag handler has hidden 3172 // The renderer has disappeared, this can happen if the onStartDrag handler has hidden
3174 // the element in some way. In this case we just kill the drag. 3173 // the element in some way. In this case we just kill the drag.
3175 return false; 3174 return false;
3176 } 3175 }
3177 } 3176 }
3178 3177
3179 DragController& dragController = m_frame->page()->dragController(); 3178 DragController& dragController = m_frame->page()->dragController();
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
3753 unsigned EventHandler::accessKeyModifiers() 3752 unsigned EventHandler::accessKeyModifiers()
3754 { 3753 {
3755 #if OS(MACOSX) 3754 #if OS(MACOSX)
3756 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3755 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3757 #else 3756 #else
3758 return PlatformEvent::AltKey; 3757 return PlatformEvent::AltKey;
3759 #endif 3758 #endif
3760 } 3759 }
3761 3760
3762 } // namespace WebCore 3761 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698