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

Unified Diff: third_party/WebKit/Source/core/page/DragController.cpp

Issue 2001083002: Explicit management of FrameSelection availability (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-06-08T18:08:39 Created 4 years, 6 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 3b559f9366ee8eba8cf1cfd56db82e9e2adfc328..819283e3f69b83e1460c4d55018a57ad47d5a4f1 100644
--- a/third_party/WebKit/Source/core/page/DragController.cpp
+++ b/third_party/WebKit/Source/core/page/DragController.cpp
@@ -491,6 +491,13 @@ bool DragController::concludeEditDrag(DragData* dragData)
VisibleSelection dragCaret(m_page->dragCaretController().caretPosition());
m_page->dragCaretController().clear();
+ // |innerFrame| can be removed by event handler called by
+ // |dispatchTextInputEventFor()|.
+ if (!innerFrame->selection().isAvailable()) {
+ // "editing/pasteboard/drop-text-events-sideeffect-crash.html" reaches
+ // here.
+ return false;
+ }
Range* range = createRange(dragCaret.toNormalizedEphemeralRange());
Element* rootEditableElement = innerFrame->selection().rootEditableElement();
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698