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

Unified Diff: third_party/WebKit/Source/core/page/DragController.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/page/DragController.cpp
diff --git a/third_party/WebKit/Source/core/page/DragController.cpp b/third_party/WebKit/Source/core/page/DragController.cpp
index 9483dab469c5f2a40082349255947b8dff86d795..b6d0ed000fa5fb74ea7ea491dfdfb61fdb29b33c 100644
--- a/third_party/WebKit/Source/core/page/DragController.cpp
+++ b/third_party/WebKit/Source/core/page/DragController.cpp
@@ -199,7 +199,8 @@ static DocumentFragment* documentFragmentFromDragData(
bool DragController::dragIsMove(FrameSelection& selection, DragData* dragData) {
return m_documentUnderMouse == m_dragInitiator &&
- selection.isContentEditable() &&
+ selection.computeVisibleSelectionInDOMTreeDeprecated()
+ .isContentEditable() &&
selection.computeVisibleSelectionInDOMTreeDeprecated().isRange() &&
!isCopyKeyDown(dragData);
}
@@ -479,7 +480,10 @@ static bool setSelectionToDragCaret(LocalFrame* frame,
dragCaret = frame->selection().computeVisibleSelectionInDOMTreeDeprecated();
range = createRange(dragCaret.toNormalizedEphemeralRange());
}
- return !frame->selection().isNone() && frame->selection().isContentEditable();
+ return !frame->selection().isNone() &&
+ frame->selection()
+ .computeVisibleSelectionInDOMTreeDeprecated()
+ .isContentEditable();
}
DispatchEventResult DragController::dispatchTextInputEventFor(
@@ -1146,7 +1150,9 @@ bool DragController::startDrag(LocalFrame* src,
if (src->selection()
.computeVisibleSelectionInDOMTreeDeprecated()
.isCaret() &&
- src->selection().isContentEditable()) {
+ src->selection()
+ .computeVisibleSelectionInDOMTreeDeprecated()
+ .isContentEditable()) {
// a user can initiate a drag on a link without having any text
// selected. In this case, we should expand the selection to
// the enclosing anchor element

Powered by Google App Engine
This is Rietveld 408576698