OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/input/MouseEventManager.h" | 5 #include "core/input/MouseEventManager.h" |
6 | 6 |
7 #include "core/clipboard/DataObject.h" | 7 #include "core/clipboard/DataObject.h" |
8 #include "core/clipboard/DataTransfer.h" | 8 #include "core/clipboard/DataTransfer.h" |
9 #include "core/dom/Element.h" | 9 #include "core/dom/Element.h" |
10 #include "core/dom/ElementTraversal.h" | 10 #include "core/dom/ElementTraversal.h" |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 if (element->isMouseFocusable()) | 418 if (element->isMouseFocusable()) |
419 break; | 419 break; |
420 } | 420 } |
421 DCHECK(!element || element->isMouseFocusable()); | 421 DCHECK(!element || element->isMouseFocusable()); |
422 | 422 |
423 // To fix <rdar://problem/4895428> Can't drag selected ToDo, we don't focus | 423 // To fix <rdar://problem/4895428> Can't drag selected ToDo, we don't focus |
424 // a node on mouse down if it's selected and inside a focused node. It will | 424 // a node on mouse down if it's selected and inside a focused node. It will |
425 // be focused if the user does a mouseup over it, however, because the | 425 // be focused if the user does a mouseup over it, however, because the |
426 // mouseup will set a selection inside it, which will call | 426 // mouseup will set a selection inside it, which will call |
427 // FrameSelection::setFocusedNodeIfNeeded. | 427 // FrameSelection::setFocusedNodeIfNeeded. |
428 if (element && m_frame->selection().isRange()) { | 428 if (element && |
| 429 m_frame->selection() |
| 430 .computeVisibleSelectionInDOMTreeDeprecated() |
| 431 .isRange()) { |
429 // TODO(yosin) We should not create |Range| object for calling | 432 // TODO(yosin) We should not create |Range| object for calling |
430 // |isNodeFullyContained()|. | 433 // |isNodeFullyContained()|. |
431 if (createRange(m_frame->selection() | 434 if (createRange(m_frame->selection() |
432 .computeVisibleSelectionInDOMTreeDeprecated() | 435 .computeVisibleSelectionInDOMTreeDeprecated() |
433 .toNormalizedEphemeralRange()) | 436 .toNormalizedEphemeralRange()) |
434 ->isNodeFullyContained(*element) && | 437 ->isNodeFullyContained(*element) && |
435 element->isDescendantOf(m_frame->document()->focusedElement())) | 438 element->isDescendantOf(m_frame->document()->focusedElement())) |
436 return WebInputEventResult::NotHandled; | 439 return WebInputEventResult::NotHandled; |
437 } | 440 } |
438 | 441 |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 | 1011 |
1009 void MouseEventManager::setClickCount(int clickCount) { | 1012 void MouseEventManager::setClickCount(int clickCount) { |
1010 m_clickCount = clickCount; | 1013 m_clickCount = clickCount; |
1011 } | 1014 } |
1012 | 1015 |
1013 bool MouseEventManager::mouseDownMayStartDrag() { | 1016 bool MouseEventManager::mouseDownMayStartDrag() { |
1014 return m_mouseDownMayStartDrag; | 1017 return m_mouseDownMayStartDrag; |
1015 } | 1018 } |
1016 | 1019 |
1017 } // namespace blink | 1020 } // namespace blink |
OLD | NEW |