Bug 1485063 Part 4 - Move preferences used in AccessibleCaretManager to StaticPrefList.h r=mats
authorTing-Yu Lin <aethanyc@gmail.com>
Fri, 21 Sep 2018 21:59:52 +0000
changeset 493486 df8cf3e01392d1c2ef27ae0a37fe76ffcb025a4e
parent 493485 253db3bbd64ff6960782d9351376673cc75b0ecb
child 493487 6c1f0d449eca8d1903d6878c2aa5d987f1d790a4
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1485063
milestone64.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 1485063 Part 4 - Move preferences used in AccessibleCaretManager to StaticPrefList.h r=mats Differential Revision: https://phabricator.services.mozilla.com/D5474
layout/base/AccessibleCaretManager.cpp
layout/base/AccessibleCaretManager.h
layout/base/gtest/TestAccessibleCaretManager.cpp
modules/libpref/init/StaticPrefList.h
modules/libpref/init/all.js
--- a/layout/base/AccessibleCaretManager.cpp
+++ b/layout/base/AccessibleCaretManager.cpp
@@ -13,17 +13,17 @@
 #include "mozilla/AutoRestore.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/MouseEventBinding.h"
 #include "mozilla/dom/NodeFilterBinding.h"
 #include "mozilla/dom/Selection.h"
 #include "mozilla/dom/TreeWalker.h"
 #include "mozilla/IMEStateManager.h"
 #include "mozilla/IntegerPrintfMacros.h"
-#include "mozilla/Preferences.h"
+#include "mozilla/StaticPrefs.h"
 #include "nsCaret.h"
 #include "nsContainerFrame.h"
 #include "nsContentUtils.h"
 #include "nsFocusManager.h"
 #include "nsFrame.h"
 #include "nsFrameSelection.h"
 #include "nsGenericHTMLElement.h"
 #include "nsIHapticFeedback.h"
@@ -64,60 +64,25 @@ std::ostream& operator<<(std::ostream& a
     AC_PROCESS_ENUM_TO_STREAM(UpdateCaretsHint::Default);
     AC_PROCESS_ENUM_TO_STREAM(UpdateCaretsHint::RespectOldAppearance);
     AC_PROCESS_ENUM_TO_STREAM(UpdateCaretsHint::DispatchNoEvent);
   }
   return aStream;
 }
 #undef AC_PROCESS_ENUM_TO_STREAM
 
-/* static */ bool
-AccessibleCaretManager::sCaretShownWhenLongTappingOnEmptyContent = false;
-/* static */ bool
-AccessibleCaretManager::sCaretsAlwaysTilt = false;
-/* static */ int32_t
-AccessibleCaretManager::sCaretsScriptUpdates =
-    AccessibleCaretManager::kScriptAlwaysHide;
-/* static */ bool
-AccessibleCaretManager::sCaretsAllowDraggingAcrossOtherCaret = true;
-/* static */ bool
-AccessibleCaretManager::sHapticFeedback = false;
-/* static */ bool
-AccessibleCaretManager::sExtendSelectionForPhoneNumber = false;
-/* static */ bool
-AccessibleCaretManager::sHideCaretsForMouseInput = true;
-
 AccessibleCaretManager::AccessibleCaretManager(nsIPresShell* aPresShell)
   : mPresShell(aPresShell)
 {
   if (!mPresShell) {
     return;
   }
 
   mFirstCaret = MakeUnique<AccessibleCaret>(mPresShell);
   mSecondCaret = MakeUnique<AccessibleCaret>(mPresShell);
-
-  static bool addedPrefs = false;
-  if (!addedPrefs) {
-    Preferences::AddBoolVarCache(&sCaretShownWhenLongTappingOnEmptyContent,
-      "layout.accessiblecaret.caret_shown_when_long_tapping_on_empty_content");
-    Preferences::AddBoolVarCache(&sCaretsAlwaysTilt,
-                                 "layout.accessiblecaret.always_tilt");
-    Preferences::AddIntVarCache(&sCaretsScriptUpdates,
-      "layout.accessiblecaret.script_change_update_mode");
-    Preferences::AddBoolVarCache(&sCaretsAllowDraggingAcrossOtherCaret,
-      "layout.accessiblecaret.allow_dragging_across_other_caret", true);
-    Preferences::AddBoolVarCache(&sHapticFeedback,
-                                 "layout.accessiblecaret.hapticfeedback");
-    Preferences::AddBoolVarCache(&sExtendSelectionForPhoneNumber,
-      "layout.accessiblecaret.extend_selection_for_phone_number");
-    Preferences::AddBoolVarCache(&sHideCaretsForMouseInput,
-      "layout.accessiblecaret.hide_carets_for_mouse_input");
-    addedPrefs = true;
-  }
 }
 
 AccessibleCaretManager::~AccessibleCaretManager()
 {
   MOZ_RELEASE_ASSERT(!mFlushingLayout, "Going away in FlushLayout? Bad!");
 }
 
 void
@@ -145,18 +110,20 @@ AccessibleCaretManager::OnSelectionChang
   // actions, either positioning cursor for text insert, or selecting
   // text-to-be-replaced. None should affect AccessibleCaret visibility.
   if (aReason & nsISelectionListener::IME_REASON) {
     return NS_OK;
   }
 
   // Move the cursor by JavaScript or unknown internal call.
   if (aReason == nsISelectionListener::NO_REASON) {
-    if (sCaretsScriptUpdates == kScriptAlwaysShow ||
-        (sCaretsScriptUpdates == kScriptUpdateVisible &&
+    auto mode = static_cast<ScriptUpdateMode>(
+      StaticPrefs::layout_accessiblecaret_script_change_update_mode());
+    if (mode == kScriptAlwaysShow ||
+        (mode == kScriptUpdateVisible &&
          (mFirstCaret->IsLogicallyVisible() ||
           mSecondCaret->IsLogicallyVisible()))) {
         UpdateCarets();
         return NS_OK;
     }
     // Default for NO_REASON is to make hidden.
     HideCarets();
     return NS_OK;
@@ -178,25 +145,25 @@ AccessibleCaretManager::OnSelectionChang
   // Range will collapse after cutting or copying text.
   if (aReason & (nsISelectionListener::COLLAPSETOSTART_REASON |
                  nsISelectionListener::COLLAPSETOEND_REASON)) {
     HideCarets();
     return NS_OK;
   }
 
   // For mouse input we don't want to show the carets.
-  if (sHideCaretsForMouseInput &&
+  if (StaticPrefs::layout_accessiblecaret_hide_carets_for_mouse_input() &&
       mLastInputSource == MouseEvent_Binding::MOZ_SOURCE_MOUSE) {
     HideCarets();
     return NS_OK;
   }
 
   // When we want to hide the carets for mouse input, hide them for select
   // all action fired by keyboard as well.
-  if (sHideCaretsForMouseInput &&
+  if (StaticPrefs::layout_accessiblecaret_hide_carets_for_mouse_input() &&
       mLastInputSource == MouseEvent_Binding::MOZ_SOURCE_KEYBOARD &&
       (aReason & nsISelectionListener::SELECTALL_REASON)) {
     HideCarets();
     return NS_OK;
   }
 
   UpdateCarets();
   return NS_OK;
@@ -288,17 +255,17 @@ AccessibleCaretManager::UpdateCaretsForC
   PositionChangedResult result = mFirstCaret->SetPosition(frame, offset);
 
   switch (result) {
     case PositionChangedResult::NotChanged:
     case PositionChangedResult::Changed:
       if (aHints == UpdateCaretsHint::Default) {
         if (HasNonEmptyTextContent(GetEditingHostForFrame(frame))) {
           mFirstCaret->SetAppearance(Appearance::Normal);
-        } else if (sCaretShownWhenLongTappingOnEmptyContent) {
+        } else if (StaticPrefs::layout_accessiblecaret_caret_shown_when_long_tapping_on_empty_content()) {
           if (mFirstCaret->IsLogicallyVisible()) {
             // Possible cases are: 1) SelectWordOrShortcut() sets the
             // appearance to Normal. 2) When the caret is out of viewport and
             // now scrolling into viewport, it has appearance NormalNotShown.
             mFirstCaret->SetAppearance(Appearance::Normal);
           } else {
             // Possible cases are: a) Single tap on current empty content;
             // OnSelectionChanged() sets the appearance to None due to
@@ -384,17 +351,17 @@ AccessibleCaretManager::UpdateCaretsForS
     if (!FlushLayout()) {
       return;
     }
   }
 
   if (aHints == UpdateCaretsHint::Default) {
     // Only check for tilt carets with default update hint. Otherwise we might
     // override the appearance set by the caller.
-    if (sCaretsAlwaysTilt) {
+    if (StaticPrefs::layout_accessiblecaret_always_tilt()) {
       UpdateCaretsForAlwaysTilt(startFrame, endFrame);
     } else {
       UpdateCaretsForOverlappingTilt();
     }
   }
 
   if (!aHints.contains(UpdateCaretsHint::DispatchNoEvent) &&
       !mActiveCaret) {
@@ -447,17 +414,17 @@ AccessibleCaretManager::UpdateCaretsForA
     mSecondCaret->SetAppearance(endFrameWritingMode.IsBidiLTR() ?
                                 Appearance::Right : Appearance::Left);
   }
 }
 
 void
 AccessibleCaretManager::ProvideHapticFeedback()
 {
-  if (sHapticFeedback) {
+  if (StaticPrefs::layout_accessiblecaret_hapticfeedback()) {
     nsCOMPtr<nsIHapticFeedback> haptic =
       do_GetService("@mozilla.org/widget/hapticfeedback;1");
     haptic->PerformSimpleAction(haptic->LongPress);
   }
 }
 
 nsresult
 AccessibleCaretManager::PressCaret(const nsPoint& aPoint,
@@ -584,17 +551,17 @@ AccessibleCaretManager::SelectWordOrShor
   nsLayoutUtils::TransformPoint(rootFrame, ptFrame, ptInFrame);
 
   // Firstly check long press on an empty editable content.
   Element* newFocusEditingHost = GetEditingHostForFrame(ptFrame);
   if (focusableFrame && newFocusEditingHost &&
       !HasNonEmptyTextContent(newFocusEditingHost)) {
     ChangeFocusToOrClearOldFocus(focusableFrame);
 
-    if (sCaretShownWhenLongTappingOnEmptyContent) {
+    if (StaticPrefs::layout_accessiblecaret_caret_shown_when_long_tapping_on_empty_content()) {
       mFirstCaret->SetAppearance(Appearance::Normal);
     }
     // We need to update carets to get correct information before dispatching
     // CaretStateChangedEvent.
     UpdateCarets();
     ProvideHapticFeedback();
     DispatchCaretStateChangedEvent(CaretChangedReason::Longpressonemptycontent);
     return NS_OK;
@@ -662,17 +629,17 @@ AccessibleCaretManager::OnScrollEnd()
     if (!mFirstCaret->IsLogicallyVisible()) {
       // If the caret is hidden (Appearance::None) due to blur, no
       // need to update it.
       return;
     }
   }
 
   // For mouse input we don't want to show the carets.
-  if (sHideCaretsForMouseInput &&
+  if (StaticPrefs::layout_accessiblecaret_hide_carets_for_mouse_input() &&
       mLastInputSource == MouseEvent_Binding::MOZ_SOURCE_MOUSE) {
     AC_LOG("%s: HideCarets()", __FUNCTION__);
     HideCarets();
     return;
   }
 
   AC_LOG("%s: UpdateCarets()", __FUNCTION__);
   UpdateCarets();
@@ -872,17 +839,17 @@ AccessibleCaretManager::SelectWord(nsIFr
   nsFrame* frame = static_cast<nsFrame*>(aFrame);
   nsresult rs = frame->SelectByTypeAtPoint(mPresShell->GetPresContext(), aPoint,
                                            eSelectWord, eSelectWord, 0);
 
   SetSelectionDragState(false);
   ClearMaintainedSelection();
 
   // Smart-select phone numbers if possible.
-  if (sExtendSelectionForPhoneNumber) {
+  if (StaticPrefs::layout_accessiblecaret_extend_selection_for_phone_number()) {
     SelectMoreIfPhoneNumber();
   }
 
   return rs;
 }
 
 void
 AccessibleCaretManager::SetSelectionDragState(bool aState) const
@@ -1138,17 +1105,17 @@ AccessibleCaretManager::RestrictCaretDra
                                   limit.mResultContent, limit.mContentOffset);
 
   auto SetOffsetsToLimit = [&aOffsets, &limit] () {
     aOffsets.content = limit.mResultContent;
     aOffsets.offset = limit.mContentOffset;
     aOffsets.secondaryOffset = limit.mContentOffset;
   };
 
-  if (!sCaretsAllowDraggingAcrossOtherCaret) {
+  if (!StaticPrefs::layout_accessiblecaret_allow_dragging_across_other_caret()) {
     if ((mActiveCaret == mFirstCaret.get() && cmpToLimit == 1) ||
         (mActiveCaret == mSecondCaret.get() && cmpToLimit == -1)) {
       // The active caret's position is past the limit, which we don't allow
       // here. So set it to the limit, resulting in one character being
       // selected.
       SetOffsetsToLimit();
     }
   } else {
@@ -1304,17 +1271,17 @@ AccessibleCaretManager::AdjustDragBounda
       // Shrink the rect to make sure we never hit the boundary.
       boundary.Deflate(kBoundaryAppUnits);
 
       adjustedPoint = boundary.ClampPoint(adjustedPoint);
     }
   }
 
   if (GetCaretMode() == CaretMode::Selection &&
-      !sCaretsAllowDraggingAcrossOtherCaret) {
+      !StaticPrefs::layout_accessiblecaret_allow_dragging_across_other_caret()) {
     // Bug 1068474: Adjust the Y-coordinate so that the carets won't be in tilt
     // mode when a caret is being dragged surpass the other caret.
     //
     // For example, when dragging the second caret, the horizontal boundary (lower
     // bound) of its Y-coordinate is the logical position of the first caret.
     // Likewise, when dragging the first caret, the horizontal boundary (upper
     // bound) of its Y-coordinate is the logical position of the second caret.
     if (mActiveCaret == mFirstCaret.get()) {
--- a/layout/base/AccessibleCaretManager.h
+++ b/layout/base/AccessibleCaretManager.h
@@ -326,55 +326,25 @@ protected:
   static const int32_t kAutoScrollTimerDelay = 30;
 
   // Clicking on the boundary of input or textarea will move the caret to the
   // front or end of the content. To avoid this, we need to deflate the content
   // boundary by 61 app units, which is 1 pixel + 1 app unit as defined in
   // AppUnit.h.
   static const int32_t kBoundaryAppUnits = 61;
 
-  // Preference to allow smarter selection of phone numbers,
-  // when user long presses text to start.
-  static bool sExtendSelectionForPhoneNumber;
-
-  // Preference to show caret in cursor mode when long tapping on an empty
-  // content. This also changes the default update behavior in cursor mode,
-  // which is based on the emptiness of the content, into something more
-  // heuristic. See UpdateCaretsForCursorMode() for the details.
-  static bool sCaretShownWhenLongTappingOnEmptyContent;
-
-  // Preference to make carets always tilt in selection mode. By default, the
-  // carets become tilt only when they are overlapping.
-  static bool sCaretsAlwaysTilt;
-
   enum ScriptUpdateMode : int32_t {
     // By default, always hide carets for selection changes due to JS calls.
     kScriptAlwaysHide,
     // Update any visible carets for selection changes due to JS calls,
     // but don't show carets if carets are hidden.
     kScriptUpdateVisible,
     // Always show carets for selection changes due to JS calls.
     kScriptAlwaysShow
   };
-
-  // Preference to indicate how to update carets for selection changes due to
-  // JS calls, as one of the ScriptUpdateMode constants.
-  static int32_t sCaretsScriptUpdates;
-
-  // Preference to allow one caret to be dragged across the other caret without
-  // any limitation. When set to false, one caret cannot be dragged across the
-  // other one.
-  static bool sCaretsAllowDraggingAcrossOtherCaret;
-
-  // AccessibleCaret pref for haptic feedback behaviour on longPress.
-  static bool sHapticFeedback;
-
-  // Preference to keep carets hidden when the selection is being manipulated
-  // by mouse input (as opposed to touch/pen/etc.).
-  static bool sHideCaretsForMouseInput;
 };
 
 std::ostream& operator<<(std::ostream& aStream,
                          const AccessibleCaretManager::CaretMode& aCaretMode);
 
 std::ostream& operator<<(std::ostream& aStream,
                          const AccessibleCaretManager::UpdateCaretsHint& aResult);
 
--- a/layout/base/gtest/TestAccessibleCaretManager.cpp
+++ b/layout/base/gtest/TestAccessibleCaretManager.cpp
@@ -6,17 +6,18 @@
 
 #include "gtest/gtest.h"
 #include "gmock/gmock.h"
 
 #include <string>
 
 #include "AccessibleCaret.h"
 #include "AccessibleCaretManager.h"
-#include "mozilla/AutoRestore.h"
+#include "mozilla/Preferences.h"
+#include "mozilla/StaticPrefs.h"
 
 using ::testing::DefaultValue;
 using ::testing::Eq;
 using ::testing::InSequence;
 using ::testing::MockFunction;
 using ::testing::Return;
 using ::testing::_;
 
@@ -48,18 +49,16 @@ public:
   }; // class MockAccessibleCaret
 
   class MockAccessibleCaretManager : public AccessibleCaretManager
   {
   public:
     using CaretMode = AccessibleCaretManager::CaretMode;
     using AccessibleCaretManager::UpdateCarets;
     using AccessibleCaretManager::HideCarets;
-    using AccessibleCaretManager::sCaretShownWhenLongTappingOnEmptyContent;
-    using AccessibleCaretManager::sCaretsAlwaysTilt;
 
     MockAccessibleCaretManager()
       : AccessibleCaretManager(nullptr)
     {
       mFirstCaret = MakeUnique<MockAccessibleCaret>();
       mSecondCaret = MakeUnique<MockAccessibleCaret>();
     }
 
@@ -429,19 +428,18 @@ MOZ_CAN_RUN_SCRIPT
   check.Call("scrollend2");
 }
 
 TEST_F(AccessibleCaretManagerTester,
        TestScrollInSelectionModeWithAlwaysTiltPref)
 MOZ_CAN_RUN_SCRIPT
 {
   // Simulate Firefox Android preference.
-  AutoRestore<bool> saveCaretsAlwaysTilt(
-    MockAccessibleCaretManager::sCaretsAlwaysTilt);
-  MockAccessibleCaretManager::sCaretsAlwaysTilt = true;
+  bool oldPref = StaticPrefs::layout_accessiblecaret_always_tilt();
+  Preferences::SetBool("layout.accessiblecaret.always_tilt", true);
 
   EXPECT_CALL(mManager, GetCaretMode())
     .WillRepeatedly(Return(CaretMode::Selection));
 
   MockFunction<void(std::string aCheckPointName)> check;
   {
     InSequence dummy;
 
@@ -529,16 +527,18 @@ MOZ_CAN_RUN_SCRIPT
   EXPECT_EQ(FirstCaretAppearance(), Appearance::Left);
   EXPECT_EQ(SecondCaretAppearance(), Appearance::NormalNotShown);
   check.Call("reflow2");
 
   mManager.OnScrollEnd();
   EXPECT_EQ(FirstCaretAppearance(), Appearance::Left);
   EXPECT_EQ(SecondCaretAppearance(), Appearance::Right);
   check.Call("scrollend2");
+
+  Preferences::SetBool("layout.accessiblecaret.always_tilt", oldPref);
 }
 
 TEST_F(AccessibleCaretManagerTester, TestScrollInCursorModeWhenLogicallyVisible)
 MOZ_CAN_RUN_SCRIPT
 {
   EXPECT_CALL(mManager, GetCaretMode())
     .WillRepeatedly(Return(CaretMode::Cursor));
 
@@ -723,19 +723,18 @@ MOZ_CAN_RUN_SCRIPT
   check.Call("scrollend3");
 }
 
 TEST_F(AccessibleCaretManagerTester,
        TestScrollInCursorModeWithCaretShownWhenLongTappingOnEmptyContentPref)
 MOZ_CAN_RUN_SCRIPT
 {
   // Simulate Firefox Android preference.
-  AutoRestore<bool> savesCaretShownWhenLongTappingOnEmptyContent(
-    MockAccessibleCaretManager::sCaretShownWhenLongTappingOnEmptyContent);
-  MockAccessibleCaretManager::sCaretShownWhenLongTappingOnEmptyContent = true;
+  bool oldPref = StaticPrefs::layout_accessiblecaret_caret_shown_when_long_tapping_on_empty_content();
+  Preferences::SetBool("layout.accessiblecaret.caret_shown_when_long_tapping_on_empty_content", true);
 
   EXPECT_CALL(mManager, GetCaretMode())
     .WillRepeatedly(Return(CaretMode::Cursor));
 
   EXPECT_CALL(mManager, HasNonEmptyTextContent(_))
     .WillRepeatedly(Return(false));
 
   MockFunction<void(std::string aCheckPointName)> check;
@@ -811,11 +810,13 @@ MOZ_CAN_RUN_SCRIPT
 
   // Scroll the caret within the viewport.
   mManager.OnScrollStart();
   check.Call("longtap scrollstart3");
   mManager.OnScrollPositionChanged();
   mManager.OnScrollEnd();
   EXPECT_EQ(FirstCaretAppearance(), Appearance::Normal);
   check.Call("longtap scrollend3");
+
+  Preferences::SetBool("layout.accessiblecaret.caret_shown_when_long_tapping_on_empty_content", oldPref);
 }
 
 } // namespace mozilla
--- a/modules/libpref/init/StaticPrefList.h
+++ b/modules/libpref/init/StaticPrefList.h
@@ -471,16 +471,73 @@ VARCACHE_PREF(
 // additional way to enable the accessible carets, rather than
 // overriding the layout.accessiblecaret.enabled pref.
 VARCACHE_PREF(
   "layout.accessiblecaret.enabled_on_touch",
    layout_accessiblecaret_enabled_on_touch,
   bool, true
 )
 
+// By default, carets become tilt only when they are overlapping.
+VARCACHE_PREF(
+  "layout.accessiblecaret.always_tilt",
+   layout_accessiblecaret_always_tilt,
+  bool, false
+)
+
+// Show caret in cursor mode when long tapping on an empty content. This
+// also changes the default update behavior in cursor mode, which is based
+// on the emptiness of the content, into something more heuristic. See
+// AccessibleCaretManager::UpdateCaretsForCursorMode() for the details.
+VARCACHE_PREF(
+  "layout.accessiblecaret.caret_shown_when_long_tapping_on_empty_content",
+   layout_accessiblecaret_caret_shown_when_long_tapping_on_empty_content,
+  bool, false
+)
+
+// 0 = by default, always hide carets for selection changes due to JS calls.
+// 1 = update any visible carets for selection changes due to JS calls,
+//     but don't show carets if carets are hidden.
+// 2 = always show carets for selection changes due to JS calls.
+VARCACHE_PREF(
+  "layout.accessiblecaret.script_change_update_mode",
+   layout_accessiblecaret_script_change_update_mode,
+  int32_t, 0
+)
+
+// Allow one caret to be dragged across the other caret without any limitation.
+// This matches the built-in convention for all desktop platforms.
+VARCACHE_PREF(
+  "layout.accessiblecaret.allow_dragging_across_other_caret",
+   layout_accessiblecaret_allow_dragging_across_other_caret,
+  bool, true
+)
+
+// Optionally provide haptic feedback on long-press selection events.
+VARCACHE_PREF(
+  "layout.accessiblecaret.hapticfeedback",
+   layout_accessiblecaret_hapticfeedback,
+  bool, false
+)
+
+// Smart phone-number selection on long-press is not enabled by default.
+VARCACHE_PREF(
+  "layout.accessiblecaret.extend_selection_for_phone_number",
+   layout_accessiblecaret_extend_selection_for_phone_number,
+  bool, false
+)
+
+// Keep the accessible carets hidden when the user is using mouse input (as
+// opposed to touch/pen/etc.).
+VARCACHE_PREF(
+  "layout.accessiblecaret.hide_carets_for_mouse_input",
+   layout_accessiblecaret_hide_carets_for_mouse_input,
+  bool, true
+)
+
 // CSS attributes (width, height, margin-left) of the AccessibleCaret in CSS
 // pixels.
 VARCACHE_PREF(
   "layout.accessiblecaret.width",
    layout_accessiblecaret_width,
   float, 34.0f
 )
 
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -5537,41 +5537,16 @@ pref("urlclassifier.flashSubDocExceptTab
 pref("urlclassifier.flashInfobarTable", "except-flashinfobar-digest256");
 
 pref("plugins.http_https_only", true);
 pref("plugins.flashBlock.enabled", false);
 
 // Turn off Spatial navigation by default.
 pref("snav.enabled", false);
 
-// Show the caret when long tapping on an empty content.
-pref("layout.accessiblecaret.caret_shown_when_long_tapping_on_empty_content", false);
-
-// By default, carets become tilt only when they are overlapping.
-pref("layout.accessiblecaret.always_tilt", false);
-
-// 0 = by default, always hide carets for selection changes due to JS calls.
-// 1 = update any visible carets for selection changes due to JS calls,
-//     but don't show carets if carets are hidden.
-// 2 = always show carets for selection changes due to JS calls.
-pref("layout.accessiblecaret.script_change_update_mode", 0);
-
-// Allow one caret to be dragged across the other caret without any limitation.
-// This matches the built-in convention for all desktop platforms.
-pref("layout.accessiblecaret.allow_dragging_across_other_caret", true);
-
-// Optionally provide haptic feedback on longPress selection events.
-pref("layout.accessiblecaret.hapticfeedback", false);
-
-// Smart phone-number selection on long-press is not enabled by default.
-pref("layout.accessiblecaret.extend_selection_for_phone_number", false);
-
-// Keep the accessible carets hidden when the user is using mouse input.
-pref("layout.accessiblecaret.hide_carets_for_mouse_input", true);
-
 // Wakelock is disabled by default.
 pref("dom.wakelock.enabled", false);
 
 // The URL of the Firefox Accounts auth server backend
 pref("identity.fxaccounts.auth.uri", "https://api.accounts.firefox.com/v1");
 
 pref("beacon.enabled", true);