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

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

Issue 2709503003: Expand FrameSeleciton::isContentEditable() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-22T08:13:55 rebase Created 3 years, 10 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 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 const MouseEventWithHitTestResults& mev, 980 const MouseEventWithHitTestResults& mev,
981 const LayoutPoint& position) { 981 const LayoutPoint& position) {
982 if (!selection().isAvailable()) 982 if (!selection().isAvailable())
983 return; 983 return;
984 if (selection().contains(position) || mev.scrollbar() || 984 if (selection().contains(position) || mev.scrollbar() ||
985 // FIXME: In the editable case, word selection sometimes selects content 985 // FIXME: In the editable case, word selection sometimes selects content
986 // that isn't underneath the mouse. 986 // that isn't underneath the mouse.
987 // If the selection is non-editable, we do word selection to make it 987 // If the selection is non-editable, we do word selection to make it
988 // easier to use the contextual menu items available for text selections. 988 // easier to use the contextual menu items available for text selections.
989 // But only if we're above text. 989 // But only if we're above text.
990 !(selection().isContentEditable() || 990 !(selection()
991 .computeVisibleSelectionInDOMTreeDeprecated()
992 .isContentEditable() ||
991 (mev.innerNode() && mev.innerNode()->isTextNode()))) 993 (mev.innerNode() && mev.innerNode()->isTextNode())))
992 return; 994 return;
993 995
994 // Context menu events are always allowed to perform a selection. 996 // Context menu events are always allowed to perform a selection.
995 AutoReset<bool> mouseDownMayStartSelectChange(&m_mouseDownMayStartSelect, 997 AutoReset<bool> mouseDownMayStartSelectChange(&m_mouseDownMayStartSelect,
996 true); 998 true);
997 999
998 if (hitTestResultIsMisspelled(mev.hitTestResult())) 1000 if (hitTestResultIsMisspelled(mev.hitTestResult()))
999 return selectClosestMisspellingFromMouseEvent(mev); 1001 return selectClosestMisspellingFromMouseEvent(mev);
1000 1002
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 1081
1080 bool isExtendingSelection(const MouseEventWithHitTestResults& event) { 1082 bool isExtendingSelection(const MouseEventWithHitTestResults& event) {
1081 bool isMouseDownOnLinkOrImage = 1083 bool isMouseDownOnLinkOrImage =
1082 event.isOverLink() || event.hitTestResult().image(); 1084 event.isOverLink() || event.hitTestResult().image();
1083 return (event.event().modifiers() & WebInputEvent::Modifiers::ShiftKey) != 1085 return (event.event().modifiers() & WebInputEvent::Modifiers::ShiftKey) !=
1084 0 && 1086 0 &&
1085 !isMouseDownOnLinkOrImage; 1087 !isMouseDownOnLinkOrImage;
1086 } 1088 }
1087 1089
1088 } // namespace blink 1090 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698