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

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

Powered by Google App Engine
This is Rietveld 408576698