Bug 1105184 - Setup the mCaret used for DND so that it displays the caret also when dragging a selection within the same shell. r=roc
authorMats Palmgren <mats@mozilla.com>
Mon, 01 Dec 2014 15:55:16 +0000
changeset 218174 05ef711f1e133fac24f5b56dd0d53f5c680c62f6
parent 218173 fdc27ab62b4f67fbe31dd6ca446e425a1de121f3
child 218175 265e01c7ff55061403da9877f84499b33df34587
push id27919
push userphilringnalda@gmail.com
push dateTue, 02 Dec 2014 03:07:26 +0000
treeherdermozilla-central@265e01c7ff55 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1105184
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1105184 - Setup the mCaret used for DND so that it displays the caret also when dragging a selection within the same shell. r=roc
editor/libeditor/nsEditorEventListener.cpp
--- a/editor/libeditor/nsEditorEventListener.cpp
+++ b/editor/libeditor/nsEditorEventListener.cpp
@@ -808,16 +808,20 @@ nsEditorEventListener::DragEnter(nsIDOMD
 
   nsCOMPtr<nsIPresShell> presShell = GetPresShell();
   NS_ENSURE_TRUE(presShell, NS_OK);
 
   if (!mCaret) {
     mCaret = new nsCaret();
     mCaret->Init(presShell);
     mCaret->SetCaretReadOnly(true);
+    // This is to avoid the requirement that the Selection is Collapsed which
+    // it can't be when dragging a selection in the same shell.
+    // See nsCaret::IsVisible().
+    mCaret->SetVisibilityDuringSelection(true);
   }
 
   presShell->SetCaret(mCaret);
 
   return DragOver(aDragEvent);
 }
 
 nsresult