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

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

Issue 2771463002: Revert "Send click event after pointer capturing retarget" (Closed)
Patch Set: Created 3 years, 9 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 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
6 * Copyright (C) 2015 Google Inc. All rights reserved. 6 * Copyright (C) 2015 Google Inc. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 return updateSelectionForMouseDownDispatchingSelectStart( 783 return updateSelectionForMouseDownDispatchingSelectStart(
784 innerNode, expandSelectionToRespectUserSelectAll(innerNode, newSelection), 784 innerNode, expandSelectionToRespectUserSelectAll(innerNode, newSelection),
785 ParagraphGranularity, isHandleVisible ? HandleVisibility::Visible 785 ParagraphGranularity, isHandleVisible ? HandleVisibility::Visible
786 : HandleVisibility::NotVisible); 786 : HandleVisibility::NotVisible);
787 } 787 }
788 788
789 void SelectionController::handleMousePressEvent( 789 void SelectionController::handleMousePressEvent(
790 const MouseEventWithHitTestResults& event) { 790 const MouseEventWithHitTestResults& event) {
791 // If we got the event back, that must mean it wasn't prevented, 791 // If we got the event back, that must mean it wasn't prevented,
792 // so it's allowed to start a drag or selection if it wasn't in a scrollbar. 792 // so it's allowed to start a drag or selection if it wasn't in a scrollbar.
793 m_mouseDownMayStartSelect = (canMouseDownStartSelect(event.innerNode()) || 793 m_mouseDownMayStartSelect =
794 isSelectionOverLink(event)) && 794 (canMouseDownStartSelect(event.innerNode()) || isLinkSelection(event)) &&
795 !event.scrollbar(); 795 !event.scrollbar();
796 m_mouseDownWasSingleClickInSelection = false; 796 m_mouseDownWasSingleClickInSelection = false;
797 if (!selection().isAvailable()) { 797 if (!selection().isAvailable()) {
798 // "gesture-tap-frame-removed.html" reaches here. 798 // "gesture-tap-frame-removed.html" reaches here.
799 m_mouseDownAllowsMultiClick = !event.event().fromTouch(); 799 m_mouseDownAllowsMultiClick = !event.event().fromTouch();
800 return; 800 return;
801 } 801 }
802 802
803 // Avoid double-tap touch gesture confusion by restricting multi-click side 803 // Avoid double-tap touch gesture confusion by restricting multi-click side
804 // effects, e.g., word selection, to editable regions. 804 // effects, e.g., word selection, to editable regions.
805 m_mouseDownAllowsMultiClick = 805 m_mouseDownAllowsMultiClick =
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 m_selectionState = SelectionState::ExtendedSelection; 1078 m_selectionState = SelectionState::ExtendedSelection;
1079 return; 1079 return;
1080 } 1080 }
1081 NOTREACHED() << "We should handle all SelectionType" << selection; 1081 NOTREACHED() << "We should handle all SelectionType" << selection;
1082 } 1082 }
1083 1083
1084 FrameSelection& SelectionController::selection() const { 1084 FrameSelection& SelectionController::selection() const {
1085 return m_frame->selection(); 1085 return m_frame->selection();
1086 } 1086 }
1087 1087
1088 bool isSelectionOverLink(const MouseEventWithHitTestResults& event) { 1088 bool isLinkSelection(const MouseEventWithHitTestResults& event) {
1089 return (event.event().modifiers() & WebInputEvent::Modifiers::AltKey) != 0 && 1089 return (event.event().modifiers() & WebInputEvent::Modifiers::AltKey) != 0 &&
1090 event.isOverLink(); 1090 event.isOverLink();
1091 } 1091 }
1092 1092
1093 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { 1093 bool isExtendingSelection(const MouseEventWithHitTestResults& event) {
1094 bool isMouseDownOnLinkOrImage = 1094 bool isMouseDownOnLinkOrImage =
1095 event.isOverLink() || event.hitTestResult().image(); 1095 event.isOverLink() || event.hitTestResult().image();
1096 return (event.event().modifiers() & WebInputEvent::Modifiers::ShiftKey) != 1096 return (event.event().modifiers() & WebInputEvent::Modifiers::ShiftKey) !=
1097 0 && 1097 0 &&
1098 !isMouseDownOnLinkOrImage; 1098 !isMouseDownOnLinkOrImage;
1099 } 1099 }
1100 1100
1101 } // namespace blink 1101 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionController.h ('k') | third_party/WebKit/Source/core/input/EventHandler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698