Bug 1270030 - Remove "layout.accessiblecaret.extendedvisibility" pref from IMETextTxn. r=mats
authorTing-Yu Lin <tlin@mozilla.com>
Wed, 04 May 2016 17:05:35 +0800
changeset 296155 5137c2a0f917f3ac094441915b1321724226f3c4
parent 296154 945893b62336d110c88f12b102502cf13361799e
child 296156 d032f77a55f38746f404d9e9458d2f9ef762ecc1
push id76227
push usertlin@mozilla.com
push dateThu, 05 May 2016 02:44:05 +0000
treeherdermozilla-inbound@5137c2a0f917 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1270030, 1249201
milestone49.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 1270030 - Remove "layout.accessiblecaret.extendedvisibility" pref from IMETextTxn. r=mats The pref had been removed in bug 1249201. Need to clean it up for IMETextTxn. MozReview-Commit-ID: EaFaN1yzoyP
editor/libeditor/IMETextTxn.cpp
editor/libeditor/IMETextTxn.h
--- a/editor/libeditor/IMETextTxn.cpp
+++ b/editor/libeditor/IMETextTxn.cpp
@@ -2,52 +2,41 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "IMETextTxn.h"
 
 #include "mozilla/dom/Selection.h"      // local var
 #include "mozilla/dom/Text.h"           // mTextNode
-#include "mozilla/Preferences.h"        // nsCaret Visibility
 #include "nsAString.h"                  // params
 #include "nsDebug.h"                    // for NS_ASSERTION, etc
 #include "nsEditor.h"                   // mEditor
 #include "nsError.h"                    // for NS_SUCCEEDED, NS_FAILED, etc
 #include "nsIPresShell.h"               // nsISelectionController constants
 #include "nsRange.h"                    // local var
 #include "nsQueryObject.h"              // for do_QueryObject
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
-/*static*/ bool
-IMETextTxn::sCaretsExtendedVisibility = false;
-
-
 IMETextTxn::IMETextTxn(Text& aTextNode, uint32_t aOffset,
                        uint32_t aReplaceLength,
                        TextRangeArray* aTextRangeArray,
                        const nsAString& aStringToInsert,
                        nsEditor& aEditor)
   : EditTxn()
   , mTextNode(&aTextNode)
   , mOffset(aOffset)
   , mReplaceLength(aReplaceLength)
   , mRanges(aTextRangeArray)
   , mStringToInsert(aStringToInsert)
   , mEditor(aEditor)
   , mFixed(false)
 {
-  static bool addedPrefs = false;
-  if (!addedPrefs) {
-    mozilla::Preferences::AddBoolVarCache(&sCaretsExtendedVisibility,
-                                          "layout.accessiblecaret.extendedvisibility");
-    addedPrefs = true;
-  }
 }
 
 IMETextTxn::~IMETextTxn()
 {
 }
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(IMETextTxn, EditTxn,
                                    mTextNode)
@@ -305,20 +294,17 @@ IMETextTxn::SetIMESelection(nsEditor& aE
       static_cast<int32_t>(aOffsetInNode + aLengthOfCompositionString);
     MOZ_ASSERT(caretOffset >= 0 &&
                static_cast<uint32_t>(caretOffset) <= maxOffset);
     rv = selection->Collapse(aTextNode, caretOffset);
     NS_ASSERTION(NS_SUCCEEDED(rv),
                  "Failed to set caret at the end of composition string");
 
     // If caret range isn't specified explicitly, we should hide the caret.
-    // Hiding the caret benefits a Windows build (see bug 555642 comment #6),
-    // but causes loss of Fennec AccessibleCaret visibility during Caret drag.
-    if (!sCaretsExtendedVisibility) {
-      aEditor.HideCaret(true);
-    }
+    // Hiding the caret benefits a Windows build (see bug 555642 comment #6).
+    aEditor.HideCaret(true);
   }
 
   rv = selection->EndBatchChangesInternal();
   NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to end batch changes");
 
   return rv;
 }
--- a/editor/libeditor/IMETextTxn.h
+++ b/editor/libeditor/IMETextTxn.h
@@ -78,23 +78,16 @@ private:
 
   /** The text to insert into mTextNode at mOffset */
   nsString mStringToInsert;
 
   /** The editor, which is used to get the selection controller */
   nsEditor& mEditor;
 
   bool mFixed;
-
-  /*
-   * AccessibleCaret visibility preference. Used to avoid hiding caret during
-   * handle drag, caused by dynamic eCompositionCommit events generated by
-   * the keyboard IME for autoSuggest/autoCorrect support.
-   */
-  static bool sCaretsExtendedVisibility;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(IMETextTxn, NS_IMETEXTTXN_IID)
 
 } // namespace dom
 } // namespace mozilla
 
 #endif