Bug 1485063 Part 2 - Move preferences used in AccessibleCaretEventHub to StaticPrefList.h. r=mats

"layers.async-pan-zoom.enabled" has been enabled for all platforms for a
long time. I reword the comment to avoid confusion.

Differential Revision: https://phabricator.services.mozilla.com/D5471

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ting-Yu Lin 2018-09-10 22:22:24 +00:00
Родитель b1effb9c51
Коммит 1ff0aabd92
4 изменённых файлов: 10 добавлений и 17 удалений

Просмотреть файл

@ -12,9 +12,9 @@
#include "gfxPrefs.h"
#include "mozilla/AutoRestore.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/TextEvents.h"
#include "mozilla/TouchEvents.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/MouseEventBinding.h"
#include "mozilla/dom/Selection.h"
#include "nsCanvasFrame.h"
@ -363,17 +363,9 @@ MOZ_IMPL_STATE_CLASS_GETTER(PressNoCaretState)
MOZ_IMPL_STATE_CLASS_GETTER(ScrollState)
MOZ_IMPL_STATE_CLASS_GETTER(LongTapState)
bool AccessibleCaretEventHub::sUseLongTapInjector = false;
AccessibleCaretEventHub::AccessibleCaretEventHub(nsIPresShell* aPresShell)
: mPresShell(aPresShell)
{
static bool prefsAdded = false;
if (!prefsAdded) {
Preferences::AddBoolVarCache(
&sUseLongTapInjector, "layout.accessiblecaret.use_long_tap_injector");
prefsAdded = true;
}
}
void
@ -416,7 +408,7 @@ AccessibleCaretEventHub::Init()
mDocShell = static_cast<nsDocShell*>(docShell);
if (sUseLongTapInjector) {
if (StaticPrefs::layout_accessiblecaret_use_long_tap_injector()) {
mLongTapInjectorTimer = NS_NewTimer();
}

Просмотреть файл

@ -179,9 +179,6 @@ protected:
// Flag to avoid calling Reflow() callback recursively.
bool mIsInReflowCallback = false;
// Simulate long tap if the platform does not support eMouseLongTap events.
static bool sUseLongTapInjector;
static const int32_t kMoveStartToleranceInPixel = 5;
static const int32_t kInvalidTouchId = -1;
static const int32_t kDefaultTouchId = 0; // For mouse event

Просмотреть файл

@ -466,6 +466,14 @@ VARCACHE_PREF(
float, -18.5f
)
// Simulate long tap events to select words. Mainly used in manual testing
// with mouse.
VARCACHE_PREF(
"layout.accessiblecaret.use_long_tap_injector",
layout_accessiblecaret_use_long_tap_injector,
bool, false
)
// Is parallel CSS parsing enabled?
VARCACHE_PREF(
"layout.css.parsing.parallel",

Просмотреть файл

@ -5528,10 +5528,6 @@ pref("layout.accessiblecaret.enabled_on_touch", true);
// Show the caret when long tapping on an empty content.
pref("layout.accessiblecaret.caret_shown_when_long_tapping_on_empty_content", false);
// Simulate long tap to select words on the platforms where APZ is not enabled
// or long tap events does not fired by APZ.
pref("layout.accessiblecaret.use_long_tap_injector", false);
// By default, carets become tilt only when they are overlapping.
pref("layout.accessiblecaret.always_tilt", false);