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

Side by Side Diff: third_party/WebKit/Source/core/editing/SelectionController.cpp

Issue 2407193003: draggable=true elements should drag even if shift-key is pressed
Patch Set: Created 4 years, 2 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 | no next file » | 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 * Copyright (C) 2015 Google Inc. All rights reserved. 5 * Copyright (C) 2015 Google Inc. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 814
815 FrameSelection& SelectionController::selection() const { 815 FrameSelection& SelectionController::selection() const {
816 return m_frame->selection(); 816 return m_frame->selection();
817 } 817 }
818 818
819 bool isLinkSelection(const MouseEventWithHitTestResults& event) { 819 bool isLinkSelection(const MouseEventWithHitTestResults& event) {
820 return event.event().altKey() && event.isOverLink(); 820 return event.event().altKey() && event.isOverLink();
821 } 821 }
822 822
823 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { 823 bool isExtendingSelection(const MouseEventWithHitTestResults& event) {
824 bool isDraggable = false;
825 Node* innerNode = event.innerNode();
826 if (LayoutObject* layoutObject = innerNode->layoutObject()) {
827 const ComputedStyle& style = layoutObject->styleRef();
828 if (style.userDrag() == DRAG_ELEMENT)
829 isDraggable = true;
830 }
831
824 bool isMouseDownOnLinkOrImage = 832 bool isMouseDownOnLinkOrImage =
825 event.isOverLink() || event.hitTestResult().image(); 833 event.isOverLink() || event.hitTestResult().image();
826 return event.event().shiftKey() && !isMouseDownOnLinkOrImage; 834 return event.event().shiftKey() && !isMouseDownOnLinkOrImage && !isDraggable;
827 } 835 }
828 836
829 } // namespace blink 837 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698