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

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

Issue 2708213006: Expand FrameSeleciton::hasEditableStyle() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-23T18:38:07 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | 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 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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 m_mouseDownWasSingleClickInSelection = false; 788 m_mouseDownWasSingleClickInSelection = false;
789 if (!selection().isAvailable()) { 789 if (!selection().isAvailable()) {
790 // "gesture-tap-frame-removed.html" reaches here. 790 // "gesture-tap-frame-removed.html" reaches here.
791 m_mouseDownAllowsMultiClick = !event.event().fromTouch(); 791 m_mouseDownAllowsMultiClick = !event.event().fromTouch();
792 return; 792 return;
793 } 793 }
794 794
795 // Avoid double-tap touch gesture confusion by restricting multi-click side 795 // Avoid double-tap touch gesture confusion by restricting multi-click side
796 // effects, e.g., word selection, to editable regions. 796 // effects, e.g., word selection, to editable regions.
797 m_mouseDownAllowsMultiClick = 797 m_mouseDownAllowsMultiClick =
798 !event.event().fromTouch() || selection().hasEditableStyle(); 798 !event.event().fromTouch() ||
799 selection()
800 .computeVisibleSelectionInDOMTreeDeprecated()
801 .hasEditableStyle();
799 } 802 }
800 803
801 void SelectionController::handleMouseDraggedEvent( 804 void SelectionController::handleMouseDraggedEvent(
802 const MouseEventWithHitTestResults& event, 805 const MouseEventWithHitTestResults& event,
803 const IntPoint& mouseDownPos, 806 const IntPoint& mouseDownPos,
804 const LayoutPoint& dragStartPos, 807 const LayoutPoint& dragStartPos,
805 Node* mousePressNode, 808 Node* mousePressNode,
806 const IntPoint& lastKnownMousePosition) { 809 const IntPoint& lastKnownMousePosition) {
807 if (!selection().isAvailable()) 810 if (!selection().isAvailable())
808 return; 811 return;
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 1084
1082 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { 1085 bool isExtendingSelection(const MouseEventWithHitTestResults& event) {
1083 bool isMouseDownOnLinkOrImage = 1086 bool isMouseDownOnLinkOrImage =
1084 event.isOverLink() || event.hitTestResult().image(); 1087 event.isOverLink() || event.hitTestResult().image();
1085 return (event.event().modifiers() & WebInputEvent::Modifiers::ShiftKey) != 1088 return (event.event().modifiers() & WebInputEvent::Modifiers::ShiftKey) !=
1086 0 && 1089 0 &&
1087 !isMouseDownOnLinkOrImage; 1090 !isMouseDownOnLinkOrImage;
1088 } 1091 }
1089 1092
1090 } // namespace blink 1093 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/FrameSelection.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698