Bug 1490044 - Move all prefs used in WebIDL to StaticPrefs. r=bzbarsky

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Peter Van der Beken 2019-06-13 09:00:59 +00:00
Родитель 099e60b97b
Коммит 8b00dd9ff2
48 изменённых файлов: 701 добавлений и 459 удалений

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

@ -1473,8 +1473,6 @@ pref("identity.fxaccounts.commands.missed.fetch_interval", 86400);
pref("ui.key.menuAccessKeyFocuses", true);
#endif
pref("media.eme.hdcp-policy-check.enabled", false);
// Whether we should run a test-pattern through EME GMPs before assuming they'll
// decode H.264.
pref("media.gmp.trial-create.enabled", true);

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

@ -15453,15 +15453,8 @@ void Document::RecordNavigationTiming(ReadyState aReadyState) {
}
bool Document::ModuleScriptsEnabled() {
static bool sEnabledForContent = false;
static bool sCachedPref = false;
if (!sCachedPref) {
sCachedPref = true;
Preferences::AddBoolVarCache(&sEnabledForContent,
"dom.moduleScripts.enabled", false);
}
return nsContentUtils::IsChromeDoc(this) || sEnabledForContent;
return nsContentUtils::IsChromeDoc(this) ||
StaticPrefs::dom_moduleScripts_enabled();
}
void Document::ReportShadowDOMUsage() {

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

@ -23,6 +23,7 @@
#include "mozilla/HTMLEditor.h"
#include "mozilla/PresShell.h"
#include "mozilla/RangeBoundary.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/Telemetry.h"
#include "nsCOMPtr.h"
@ -938,7 +939,7 @@ nsresult Selection::AddItem(nsRange* aItem, int32_t* aOutIndex,
Document* doc = GetParentObject();
bool selectEventsEnabled =
nsFrameSelection::sSelectionEventsEnabled ||
StaticPrefs::dom_select_events_enabled() ||
(doc && nsContentUtils::IsSystemPrincipal(doc->NodePrincipal()));
if (!aNoStartSelect && mSelectionType == SelectionType::eNormal &&

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

@ -11,6 +11,7 @@
#include "SelectionChangeEventDispatcher.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/StaticPrefs.h"
#include "nsCOMPtr.h"
#include "nsContentUtils.h"
#include "mozilla/dom/Document.h"
@ -77,7 +78,7 @@ void SelectionChangeEventDispatcher::OnSelectionChange(Document* aDoc,
int16_t aReason) {
Document* doc = aSel->GetParentObject();
if (!(doc && nsContentUtils::IsSystemPrincipal(doc->NodePrincipal())) &&
!nsFrameSelection::sSelectionEventsEnabled) {
!StaticPrefs::dom_select_events_enabled()) {
return;
}

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

@ -6147,7 +6147,7 @@ bool nsContentUtils::IsSubDocumentTabbable(nsIContent* aContent) {
}
bool nsContentUtils::IsUserFocusIgnored(nsINode* aNode) {
if (!nsGenericHTMLFrameElement::BrowserFramesEnabled()) {
if (!StaticPrefs::dom_mozBrowserFramesEnabled()) {
return false;
}

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

@ -12,7 +12,7 @@ typedef CustomEventInit TestDictionaryTypedef;
interface TestExternalInterface;
// We need a pref name that's in StaticPrefList.h here.
[Pref="browser.dom.window.dump.enabled"]
[Pref="abc.def"]
interface TestRenamedInterface {
};
@ -1221,10 +1221,9 @@ dictionary DictWithConditionalMembers {
[ChromeOnly, Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
long chromeOnlyFuncControlledMember;
// We need a pref name that's in StaticPrefList.h here.
[Pref="browser.dom.window.dump.enabled"]
[Pref="abc.def"]
long prefControlledMember;
[Pref="browser.dom.window.dump.enabled", ChromeOnly,
Func="TestFuncControlledMember"]
[Pref="abc.def", ChromeOnly, Func="TestFuncControlledMember"]
long chromeOnlyFuncAndPrefControlledMember;
};

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

@ -1672,7 +1672,7 @@ void EventStateManager::MaybeFirePointerCancel(WidgetInputEvent* aEvent) {
RefPtr<PresShell> presShell = mPresContext->GetPresShell();
AutoWeakFrame targetFrame = mCurrentTarget;
if (!PointerEventHandler::IsPointerEventEnabled() || !presShell ||
if (!StaticPrefs::dom_w3c_pointer_events_enabled() || !presShell ||
!targetFrame) {
return;
}
@ -4442,7 +4442,7 @@ static LayoutDeviceIntPoint GetWindowClientRectCenter(nsIWidget* aWidget) {
void EventStateManager::GeneratePointerEnterExit(EventMessage aMessage,
WidgetMouseEvent* aEvent) {
if (!PointerEventHandler::IsPointerEventEnabled()) {
if (!StaticPrefs::dom_w3c_pointer_events_enabled()) {
return;
}
WidgetPointerEvent pointerEvent(*aEvent);

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

@ -15,6 +15,7 @@
#include "mozilla/MouseEvents.h"
#include "mozilla/Preferences.h"
#include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/TextComposition.h"
#include "mozilla/TextEvents.h"
#include "mozilla/Unused.h"
@ -138,7 +139,6 @@ InputContext IMEStateManager::sActiveChildInputContext;
bool IMEStateManager::sInstalledMenuKeyboardListener = false;
bool IMEStateManager::sIsGettingNewIMEState = false;
bool IMEStateManager::sCheckForIMEUnawareWebApps = false;
bool IMEStateManager::sInputModeSupported = false;
// static
void IMEStateManager::Init() {
@ -147,9 +147,6 @@ void IMEStateManager::Init() {
"intl.ime.hack.on_ime_unaware_apps.fire_key_events_for_composition",
false);
Preferences::AddBoolVarCache(&sInputModeSupported, "dom.forms.inputmode",
false);
sOrigin = XRE_IsParentProcess() ? InputContext::ORIGIN_MAIN
: InputContext::ORIGIN_CONTENT;
ResetActiveChildInputContext();
@ -1349,7 +1346,7 @@ void IMEStateManager::SetIMEState(const IMEState& aState,
context.mHTMLInputType.Assign(nsGkAtoms::textarea->GetUTF16String());
}
if (sInputModeSupported ||
if (StaticPrefs::dom_forms_inputmode() ||
nsContentUtils::IsChromeDoc(aContent->OwnerDoc())) {
aContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::inputmode,
context.mHTMLInputInputmode);

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

@ -354,7 +354,6 @@ class IMEStateManager {
static bool sIsGettingNewIMEState;
static bool sCheckForIMEUnawareWebApps;
static bool sInputModeSupported;
class MOZ_STACK_CLASS GettingNewIMEStateBlocker final {
public:

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

@ -8,13 +8,13 @@
#include "nsIFrame.h"
#include "PointerEvent.h"
#include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/dom/MouseEventBinding.h"
namespace mozilla {
using namespace dom;
static bool sPointerEventEnabled = true;
static bool sPointerEventImplicitCapture = false;
Maybe<int32_t> PointerEventHandler::sSpoofedPointerId;
@ -50,8 +50,6 @@ void PointerEventHandler::Initialize() {
return;
}
initialized = true;
Preferences::AddBoolVarCache(&sPointerEventEnabled,
"dom.w3c_pointer_events.enabled", true);
Preferences::AddBoolVarCache(&sPointerEventImplicitCapture,
"dom.w3c_pointer_events.implicit_capture", true);
}
@ -73,19 +71,15 @@ void PointerEventHandler::ReleaseStatics() {
sActivePointersIds = nullptr;
}
/* static */
bool PointerEventHandler::IsPointerEventEnabled() {
return sPointerEventEnabled;
}
/* static */
bool PointerEventHandler::IsPointerEventImplicitCaptureForTouchEnabled() {
return sPointerEventEnabled && sPointerEventImplicitCapture;
return StaticPrefs::dom_w3c_pointer_events_enabled() &&
sPointerEventImplicitCapture;
}
/* static */
void PointerEventHandler::UpdateActivePointerState(WidgetMouseEvent* aEvent) {
if (!IsPointerEventEnabled() || !aEvent) {
if (!StaticPrefs::dom_w3c_pointer_events_enabled() || !aEvent) {
return;
}
switch (aEvent->mMessage) {
@ -253,7 +247,7 @@ void PointerEventHandler::CheckPointerCaptureState(WidgetPointerEvent* aEvent) {
if (!aEvent) {
return;
}
MOZ_ASSERT(IsPointerEventEnabled());
MOZ_ASSERT(StaticPrefs::dom_w3c_pointer_events_enabled());
MOZ_ASSERT(aEvent->mClass == ePointerEventClass);
PointerCaptureInfo* captureInfo = GetPointerCaptureInfo(aEvent->pointerId);
@ -309,7 +303,7 @@ void PointerEventHandler::CheckPointerCaptureState(WidgetPointerEvent* aEvent) {
void PointerEventHandler::ImplicitlyCapturePointer(nsIFrame* aFrame,
WidgetEvent* aEvent) {
MOZ_ASSERT(aEvent->mMessage == ePointerDown);
if (!aFrame || !IsPointerEventEnabled() ||
if (!aFrame || !StaticPrefs::dom_w3c_pointer_events_enabled() ||
!IsPointerEventImplicitCaptureForTouchEnabled()) {
return;
}
@ -355,7 +349,7 @@ nsIContent* PointerEventHandler::GetPointerCapturingContent(
/* static */
nsIContent* PointerEventHandler::GetPointerCapturingContent(
WidgetGUIEvent* aEvent) {
if (!IsPointerEventEnabled() ||
if (!StaticPrefs::dom_w3c_pointer_events_enabled() ||
(aEvent->mClass != ePointerEventClass &&
aEvent->mClass != eMouseEventClass) ||
aEvent->mMessage == ePointerDown || aEvent->mMessage == eMouseDown) {
@ -494,7 +488,7 @@ void PointerEventHandler::DispatchPointerFromMouseOrTouch(
PresShell* aShell, nsIFrame* aFrame, nsIContent* aContent,
WidgetGUIEvent* aEvent, bool aDontRetargetEvents, nsEventStatus* aStatus,
nsIContent** aTargetContent) {
MOZ_ASSERT(IsPointerEventEnabled());
MOZ_ASSERT(StaticPrefs::dom_w3c_pointer_events_enabled());
MOZ_ASSERT(aFrame || aContent);
MOZ_ASSERT(aEvent);

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

@ -44,9 +44,6 @@ class PointerEventHandler final {
static void InitializeStatics();
static void ReleaseStatics();
// Return the preference value of pointer event enabled.
static bool IsPointerEventEnabled();
// Return the preference value of implicit capture.
static bool IsPointerEventImplicitCaptureForTouchEnabled();

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

@ -60,7 +60,7 @@ GamepadManager::GamepadManager()
mPromiseID(0) {}
nsresult GamepadManager::Init() {
mEnabled = IsAPIEnabled();
mEnabled = StaticPrefs::dom_gamepad_enabled();
mNonstandardEventsEnabled =
StaticPrefs::dom_gamepad_non_standard_events_enabled();
nsCOMPtr<nsIObserverService> observerService =
@ -412,11 +412,6 @@ already_AddRefed<GamepadManager> GamepadManager::GetService() {
return service.forget();
}
// static
bool GamepadManager::IsAPIEnabled() {
return StaticPrefs::dom_gamepad_enabled();
}
bool GamepadManager::MaybeWindowHasSeenGamepad(nsGlobalWindowInner* aWindow,
uint32_t aIndex) {
if (!WindowHasSeenGamepad(aWindow, aIndex)) {

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

@ -34,8 +34,6 @@ class GamepadManager final : public nsIObserver {
static bool IsServiceRunning();
// Get the singleton service
static already_AddRefed<GamepadManager> GetService();
// Return true if the API is preffed on.
static bool IsAPIEnabled();
void BeginShutdown();
void StopMonitoring();

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

@ -15,6 +15,7 @@
#include "mozilla/dom/PositionErrorBinding.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/Telemetry.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/Unused.h"
@ -502,16 +503,13 @@ NS_INTERFACE_MAP_END
NS_IMPL_ADDREF(nsGeolocationService)
NS_IMPL_RELEASE(nsGeolocationService)
static bool sGeoEnabled = true;
static int32_t sProviderTimeout = 6000; // Time, in milliseconds, to wait for
// the location provider to spin up.
nsresult nsGeolocationService::Init() {
Preferences::AddIntVarCache(&sProviderTimeout, "geo.timeout",
sProviderTimeout);
Preferences::AddBoolVarCache(&sGeoEnabled, "geo.enabled", sGeoEnabled);
if (!sGeoEnabled) {
if (!StaticPrefs::geo_enabled()) {
return NS_ERROR_FAILURE;
}
@ -644,7 +642,7 @@ CachedPositionAndAccuracy nsGeolocationService::GetCachedPosition() {
}
nsresult nsGeolocationService::StartDevice(nsIPrincipal* aPrincipal) {
if (!sGeoEnabled) {
if (!StaticPrefs::geo_enabled()) {
return NS_ERROR_NOT_AVAILABLE;
}
@ -1069,7 +1067,7 @@ nsresult Geolocation::GetCurrentPosition(GeoPositionCallback callback,
this, std::move(callback), std::move(errorCallback), std::move(options),
static_cast<uint8_t>(mProtocolType), target);
if (!sGeoEnabled || ShouldBlockInsecureRequests() ||
if (!StaticPrefs::geo_enabled() || ShouldBlockInsecureRequests() ||
!FeaturePolicyBlocked()) {
request->RequestDelayedTask(target,
nsGeolocationRequest::DelayedTaskType::Deny);
@ -1142,7 +1140,7 @@ int32_t Geolocation::WatchPosition(GeoPositionCallback aCallback,
std::move(aOptions), static_cast<uint8_t>(mProtocolType), target, true,
watchId);
if (!sGeoEnabled || ShouldBlockInsecureRequests() ||
if (!StaticPrefs::geo_enabled() || ShouldBlockInsecureRequests() ||
!FeaturePolicyBlocked()) {
request->RequestDelayedTask(target,
nsGeolocationRequest::DelayedTaskType::Deny);

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

@ -448,7 +448,7 @@ void GetDOMFileOrDirectoryPath(const OwningFileOrDirectory& aData,
/* static */
bool HTMLInputElement::ValueAsDateEnabled(JSContext* cx, JSObject* obj) {
return IsExperimentalFormsEnabled() || IsInputDateTimeEnabled() ||
return IsExperimentalFormsEnabled() || StaticPrefs::dom_forms_datetime() ||
IsInputDateTimeOthersEnabled();
}
@ -1918,7 +1918,7 @@ nsresult HTMLInputElement::ApplyStep(int32_t aStep) {
/* static */
bool HTMLInputElement::IsExperimentalMobileType(uint8_t aType) {
return (aType == NS_FORM_INPUT_DATE || aType == NS_FORM_INPUT_TIME) &&
!IsInputDateTimeEnabled();
!StaticPrefs::dom_forms_datetime();
}
bool HTMLInputElement::IsDateTimeInputType(uint8_t aType) {
@ -2336,7 +2336,7 @@ void HTMLInputElement::GetDisplayFileName(nsAString& aValue) const {
nsAutoString value;
if (mFileData->mFilesOrDirectories.IsEmpty()) {
if ((IsDirPickerEnabled() && Allowdirs()) ||
if ((StaticPrefs::dom_input_dirpicker() && Allowdirs()) ||
(StaticPrefs::dom_webkitBlink_dirPicker_enabled() &&
HasAttr(kNameSpaceID_None, nsGkAtoms::webkitdirectory))) {
nsContentUtils::GetLocalizedString(nsContentUtils::eFORMS_PROPERTIES,
@ -2375,7 +2375,7 @@ void HTMLInputElement::SetFilesOrDirectories(
mFileData->ClearGetFilesHelpers();
if (IsWebkitFileSystemEnabled()) {
if (StaticPrefs::dom_webkitBlink_filesystem_enabled()) {
HTMLInputElement_Binding::ClearCachedWebkitEntriesValue(this);
mFileData->mEntries.Clear();
}
@ -2392,7 +2392,7 @@ void HTMLInputElement::SetFiles(FileList* aFiles, bool aSetValueChanged) {
mFileData->mFilesOrDirectories.Clear();
mFileData->ClearGetFilesHelpers();
if (IsWebkitFileSystemEnabled()) {
if (StaticPrefs::dom_webkitBlink_filesystem_enabled()) {
HTMLInputElement_Binding::ClearCachedWebkitEntriesValue(this);
mFileData->mEntries.Clear();
}
@ -2418,7 +2418,7 @@ void HTMLInputElement::MozSetDndFilesAndDirectories(
SetFilesOrDirectories(aFilesOrDirectories, true);
if (IsWebkitFileSystemEnabled()) {
if (StaticPrefs::dom_webkitBlink_filesystem_enabled()) {
UpdateEntries(aFilesOrDirectories);
}
@ -2499,7 +2499,7 @@ FileList* HTMLInputElement::GetFiles() {
return nullptr;
}
if (IsDirPickerEnabled() && Allowdirs() &&
if (StaticPrefs::dom_input_dirpicker() && Allowdirs() &&
(!StaticPrefs::dom_webkitBlink_dirPicker_enabled() ||
!HasAttr(kNameSpaceID_None, nsGkAtoms::webkitdirectory))) {
return nullptr;
@ -3647,7 +3647,7 @@ nsresult HTMLInputElement::MaybeInitPickers(EventChainPostVisitor& aVisitor) {
nsCOMPtr<nsIContent> target =
do_QueryInterface(aVisitor.mEvent->mOriginalTarget);
if (target && target->FindFirstNonChromeOnlyAccessContent() == this &&
((IsDirPickerEnabled() && Allowdirs()) ||
((StaticPrefs::dom_input_dirpicker() && Allowdirs()) ||
(StaticPrefs::dom_webkitBlink_dirPicker_enabled() &&
HasAttr(kNameSpaceID_None, nsGkAtoms::webkitdirectory)))) {
type = FILE_PICKER_DIRECTORY;
@ -5108,39 +5108,14 @@ bool HTMLInputElement::ParseTime(const nsAString& aValue, uint32_t* aResult) {
bool HTMLInputElement::IsDateTimeTypeSupported(uint8_t aDateTimeInputType) {
return ((aDateTimeInputType == NS_FORM_INPUT_DATE ||
aDateTimeInputType == NS_FORM_INPUT_TIME) &&
(IsInputDateTimeEnabled() || IsExperimentalFormsEnabled())) ||
(StaticPrefs::dom_forms_datetime() ||
IsExperimentalFormsEnabled())) ||
((aDateTimeInputType == NS_FORM_INPUT_MONTH ||
aDateTimeInputType == NS_FORM_INPUT_WEEK ||
aDateTimeInputType == NS_FORM_INPUT_DATETIME_LOCAL) &&
IsInputDateTimeOthersEnabled());
}
/* static */
bool HTMLInputElement::IsWebkitFileSystemEnabled() {
static bool sWebkitFileSystemEnabled = false;
static bool sWebkitFileSystemPrefCached = false;
if (!sWebkitFileSystemPrefCached) {
sWebkitFileSystemPrefCached = true;
Preferences::AddBoolVarCache(&sWebkitFileSystemEnabled,
"dom.webkitBlink.filesystem.enabled", false);
}
return sWebkitFileSystemEnabled;
}
/* static */
bool HTMLInputElement::IsDirPickerEnabled() {
static bool sDirPickerEnabled = false;
static bool sDirPickerPrefCached = false;
if (!sDirPickerPrefCached) {
sDirPickerPrefCached = true;
Preferences::AddBoolVarCache(&sDirPickerEnabled, "dom.input.dirpicker",
false);
}
return sDirPickerEnabled;
}
/* static */
bool HTMLInputElement::IsExperimentalFormsEnabled() {
static bool sExperimentalFormsEnabled = false;
@ -5154,19 +5129,6 @@ bool HTMLInputElement::IsExperimentalFormsEnabled() {
return sExperimentalFormsEnabled;
}
/* static */
bool HTMLInputElement::IsInputDateTimeEnabled() {
static bool sDateTimeEnabled = false;
static bool sDateTimePrefCached = false;
if (!sDateTimePrefCached) {
sDateTimePrefCached = true;
Preferences::AddBoolVarCache(&sDateTimeEnabled, "dom.forms.datetime",
false);
}
return sDateTimeEnabled;
}
/* static */
bool HTMLInputElement::IsInputDateTimeOthersEnabled() {
static bool sDateTimeOthersEnabled = false;

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

@ -1597,30 +1597,12 @@ class HTMLInputElement final : public nsGenericHTMLFormElementWithState,
*/
static bool IsDateTimeTypeSupported(uint8_t aDateTimeInputType);
/**
* Checks preference "dom.webkitBlink.filesystem.enabled" to determine if
* webkitEntries should be supported.
*/
static bool IsWebkitFileSystemEnabled();
/**
* Checks preference "dom.input.dirpicker" to determine if file and directory
* entries API should be supported.
*/
static bool IsDirPickerEnabled();
/**
* Checks preference "dom.experimental_forms" to determine if experimental
* implementation of input element should be enabled.
*/
static bool IsExperimentalFormsEnabled();
/**
* Checks preference "dom.forms.datetime" to determine if input date and time
* should be supported.
*/
static bool IsInputDateTimeEnabled();
/**
* Checks preference "dom.forms.datetime.others" to determine if input week,
* month and datetime-local should be supported.

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

@ -6381,7 +6381,7 @@ void HTMLMediaElement::OnVisibilityChange(Visibility aNewVisibility) {
("OnVisibilityChange(): %s\n", VisibilityString(aNewVisibility)));
mVisibilityState = aNewVisibility;
if (StaticPrefs::MediaTestVideoSuspend()) {
if (StaticPrefs::media_test_video_suspend()) {
DispatchAsyncEvent(NS_LITERAL_STRING("visibilitychanged"));
}

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

@ -131,7 +131,7 @@ class HTMLVideoElement final : public HTMLMediaElement {
already_AddRefed<VideoPlaybackQuality> GetVideoPlaybackQuality();
bool MozOrientationLockEnabled() const {
return StaticPrefs::MediaVideocontrolsLockVideoOrientation();
return StaticPrefs::media_videocontrols_lock_video_orientation();
}
bool MozIsOrientationLocked() const { return mIsOrientationLocked; }

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

@ -8,6 +8,7 @@
#include "js/Date.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/dom/HTMLInputElement.h"
#include "nsDOMTokenList.h"
@ -20,19 +21,6 @@ const double DateTimeInputTypeBase::kMsPerDay = 24 * 60 * 60 * 1000;
using namespace mozilla;
using namespace mozilla::dom;
/* static */
bool DateTimeInputTypeBase::IsInputDateTimeEnabled() {
static bool sDateTimeEnabled = false;
static bool sDateTimePrefCached = false;
if (!sDateTimePrefCached) {
sDateTimePrefCached = true;
mozilla::Preferences::AddBoolVarCache(&sDateTimeEnabled,
"dom.forms.datetime", false);
}
return sDateTimeEnabled;
}
bool DateTimeInputTypeBase::IsMutable() const {
return !mInputElement->IsDisabled() &&
!mInputElement->HasAttr(kNameSpaceID_None, nsGkAtoms::readonly);
@ -187,7 +175,7 @@ bool DateTimeInputTypeBase::GetTimeFromMs(double aValue, uint16_t* aHours,
// input type=date
nsresult DateInputType::GetBadInputMessage(nsAString& aMessage) {
if (!IsInputDateTimeEnabled()) {
if (!StaticPrefs::dom_forms_datetime()) {
return NS_ERROR_UNEXPECTED;
}

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

@ -28,12 +28,6 @@ class DateTimeInputTypeBase : public ::InputType {
explicit DateTimeInputTypeBase(mozilla::dom::HTMLInputElement* aInputElement)
: InputType(aInputElement) {}
/**
* Checks preference "dom.forms.datetime" to determine if input date and time
* should be supported.
*/
static bool IsInputDateTimeEnabled();
bool IsMutable() const override;
/**

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

@ -11,6 +11,7 @@
#include "mozilla/dom/WindowProxyHolder.h"
#include "mozilla/Preferences.h"
#include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/ErrorResult.h"
#include "GeckoProfiler.h"
#include "nsAttrValueInlines.h"
@ -318,7 +319,8 @@ nsresult nsGenericHTMLFrameElement::AfterSetAttr(
}
}
} else if (aName == nsGkAtoms::mozbrowser) {
mReallyIsBrowser = !!aValue && BrowserFramesEnabled() &&
mReallyIsBrowser = !!aValue &&
StaticPrefs::dom_mozBrowserFramesEnabled() &&
PrincipalAllowsBrowserFrame(NodePrincipal());
}
}
@ -409,26 +411,6 @@ bool nsGenericHTMLFrameElement::IsHTMLFocusable(bool aWithMouse,
return false;
}
static bool sMozBrowserFramesEnabled = false;
#ifdef DEBUG
static bool sBoolVarCacheInitialized = false;
#endif
void nsGenericHTMLFrameElement::InitStatics() {
MOZ_ASSERT(!sBoolVarCacheInitialized);
MOZ_ASSERT(NS_IsMainThread());
Preferences::AddBoolVarCache(&sMozBrowserFramesEnabled,
"dom.mozBrowserFramesEnabled");
#ifdef DEBUG
sBoolVarCacheInitialized = true;
#endif
}
bool nsGenericHTMLFrameElement::BrowserFramesEnabled() {
MOZ_ASSERT(sBoolVarCacheInitialized);
return sMozBrowserFramesEnabled;
}
/**
* Return true if this frame element really is a mozbrowser. (It
* needs to have the right attributes, and its creator must have the right

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

@ -114,9 +114,6 @@ class nsGenericHTMLFrameElement : public nsGenericHTMLElement,
*/
void CreateRemoteFrameLoader(mozilla::dom::BrowserParent* aBrowserParent);
static void InitStatics();
static bool BrowserFramesEnabled();
/**
* Helper method to map a HTML 'scrolling' attribute value to a nsIScrollable
* enum value. scrolling="no" (and its synonyms) maps to

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

@ -57,6 +57,7 @@
#include "mozilla/ScopeExit.h"
#include "mozilla/Services.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/TextEvents.h"
#include "mozilla/TouchEvents.h"
#include "mozilla/Unused.h"
@ -1790,7 +1791,7 @@ mozilla::ipc::IPCResult BrowserChild::RecvRealTouchEvent(
if (localEvent.mMessage == eTouchStart && AsyncPanZoomEnabled()) {
nsCOMPtr<Document> document = GetTopLevelDocument();
if (StaticPrefs::TouchActionEnabled()) {
if (StaticPrefs::layout_css_touch_action_enabled()) {
APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(
mPuppetWidget, document, localEvent, aInputBlockId,
mSetAllowedTouchBehaviorCallback);

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

@ -9,6 +9,7 @@
#include "BrowserChild.h"
#include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -36,7 +37,7 @@ void CoalescedMouseData::Coalesce(const WidgetMouseEvent& aEvent,
}
if (aEvent.mMessage == eMouseMove &&
PointerEventHandler::IsPointerEventEnabled()) {
StaticPrefs::dom_w3c_pointer_events_enabled()) {
// PointerEvent::getCoalescedEvents is only applied to pointermove events.
if (!mCoalescedInputEvent->mCoalescedWidgetEvents) {
mCoalescedInputEvent->mCoalescedWidgetEvents =

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

@ -36,8 +36,6 @@ using namespace hal;
#define DEFAULT_SENSOR_POLL 100
static bool gPrefSensorsEnabled = false;
static const nsTArray<nsIDOMWindow*>::index_type NoIndex =
nsTArray<nsIDOMWindow*>::NoIndex;
@ -98,8 +96,6 @@ NS_IMPL_ISUPPORTS(nsDeviceSensors, nsIDeviceSensors)
nsDeviceSensors::nsDeviceSensors() {
mIsUserProximityNear = false;
mLastDOMMotionEventTime = TimeStamp::Now();
Preferences::AddBoolVarCache(&gPrefSensorsEnabled, "device.sensors.enabled",
true);
for (int i = 0; i < NUM_SENSOR_TYPE; i++) {
nsTArray<nsIDOMWindow*>* windows = new nsTArray<nsIDOMWindow*>();
@ -521,7 +517,7 @@ void nsDeviceSensors::FireDOMMotionEvent(Document* doc, EventTarget* target,
bool nsDeviceSensors::IsSensorAllowedByPref(uint32_t aType,
nsIDOMWindow* aWindow) {
// checks "device.sensors.enabled" master pref
if (!gPrefSensorsEnabled) {
if (!StaticPrefs::device_sensors_enabled()) {
return false;
}

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

@ -1405,7 +1405,7 @@ nsEventStatus AsyncPanZoomController::OnTouchMove(
}
MOZ_ASSERT(GetCurrentTouchBlock());
if (StaticPrefs::TouchActionEnabled() &&
if (StaticPrefs::layout_css_touch_action_enabled() &&
GetCurrentTouchBlock()->TouchActionAllowsPanningXY()) {
// User tries to trigger a touch behavior. If allowed touch behavior is
// vertical pan
@ -3066,7 +3066,7 @@ nsEventStatus AsyncPanZoomController::StartPanning(
angle = fabs(angle); // range [0, pi]
RecursiveMutexAutoLock lock(mRecursiveMutex);
if (StaticPrefs::TouchActionEnabled()) {
if (StaticPrefs::layout_css_touch_action_enabled()) {
HandlePanningWithTouchAction(angle);
} else {
if (GetAxisLockMode() == FREE) {

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

@ -6,6 +6,7 @@
#include "AsyncPanZoomController.h" // for AsyncPanZoomController
#include "LayersLogging.h" // for Stringify
#include "mozilla/StaticPrefs.h"
#include "mozilla/gfx/Point.h" // for Point4D
#include "mozilla/layers/APZUtils.h" // for CompleteAsyncTransform
#include "mozilla/layers/AsyncCompositionManager.h" // for ViewTransform::operator Matrix4x4()
@ -272,7 +273,7 @@ CompositorHitTestInfo HitTestingTreeNode::HitTest(
if (mEventRegions.mDTCRequiresTargetConfirmation) {
result += CompositorHitTestFlags::eRequiresTargetConfirmation;
}
} else if (StaticPrefs::TouchActionEnabled()) {
} else if (StaticPrefs::layout_css_touch_action_enabled()) {
if (mEventRegions.mNoActionRegion.Contains(point.x, point.y)) {
// set all the touch-action flags as disabled
result += CompositorHitTestTouchActionMask;

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

@ -11,6 +11,7 @@
#include "ScrollAnimationPhysics.h" // for kScrollSeriesTimeoutMs
#include "mozilla/MouseEvents.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/Telemetry.h" // for Telemetry
#include "mozilla/layers/IAPZCTreeManager.h" // for AllowedTouchBehavior
#include "OverscrollHandoffState.h"
@ -584,7 +585,7 @@ TouchBlockState::TouchBlockState(
mInSlop(false),
mTouchCounter(aCounter) {
TBS_LOG("Creating %p\n", this);
if (!StaticPrefs::TouchActionEnabled()) {
if (!StaticPrefs::layout_css_touch_action_enabled()) {
mAllowedTouchBehaviorSet = true;
}
}
@ -616,7 +617,7 @@ bool TouchBlockState::HasAllowedTouchBehaviors() const {
void TouchBlockState::CopyPropertiesFrom(const TouchBlockState& aOther) {
TBS_LOG("%p copying properties from %p\n", this, &aOther);
if (StaticPrefs::TouchActionEnabled()) {
if (StaticPrefs::layout_css_touch_action_enabled()) {
MOZ_ASSERT(aOther.mAllowedTouchBehaviorSet ||
aOther.IsContentResponseTimerExpired());
SetAllowedTouchBehaviors(aOther.mAllowedTouchBehaviors);
@ -627,7 +628,8 @@ void TouchBlockState::CopyPropertiesFrom(const TouchBlockState& aOther) {
bool TouchBlockState::HasReceivedAllContentNotifications() const {
return CancelableBlockState::HasReceivedAllContentNotifications()
// See comment in TouchBlockState::IsReadyforHandling()
&& (!StaticPrefs::TouchActionEnabled() || mAllowedTouchBehaviorSet);
&& (!StaticPrefs::layout_css_touch_action_enabled() ||
mAllowedTouchBehaviorSet);
}
bool TouchBlockState::IsReadyForHandling() const {
@ -635,13 +637,14 @@ bool TouchBlockState::IsReadyForHandling() const {
return false;
}
if (!StaticPrefs::TouchActionEnabled()) {
// If TouchActionEnabled() was false when this block was created, then
// mAllowedTouchBehaviorSet is guaranteed to the true. However, the pref
// may have been flipped to false after the block was created. In that case,
// we should eventually get the touch-behaviour notification, or expire the
// content response timeout, but we don't really need to wait for those,
// since we don't care about the touch-behaviour values any more.
if (!StaticPrefs::layout_css_touch_action_enabled()) {
// If layout_css_touch_action_enabled() was false when this block was
// created, then mAllowedTouchBehaviorSet is guaranteed to the true.
// However, the pref may have been flipped to false after the block was
// created. In that case, we should eventually get the touch-behaviour
// notification, or expire the content response timeout, but we don't really
// need to wait for those, since we don't care about the touch-behaviour
// values any more.
return true;
}
@ -673,7 +676,7 @@ void TouchBlockState::DispatchEvent(const InputData& aEvent) const {
}
bool TouchBlockState::TouchActionAllowsPinchZoom() const {
if (!StaticPrefs::TouchActionEnabled()) {
if (!StaticPrefs::layout_css_touch_action_enabled()) {
return true;
}
// Pointer events specification requires that all touch points allow zoom.
@ -686,7 +689,7 @@ bool TouchBlockState::TouchActionAllowsPinchZoom() const {
}
bool TouchBlockState::TouchActionAllowsDoubleTapZoom() const {
if (!StaticPrefs::TouchActionEnabled()) {
if (!StaticPrefs::layout_css_touch_action_enabled()) {
return true;
}
for (size_t i = 0; i < mAllowedTouchBehaviors.Length(); i++) {
@ -698,7 +701,7 @@ bool TouchBlockState::TouchActionAllowsDoubleTapZoom() const {
}
bool TouchBlockState::TouchActionAllowsPanningX() const {
if (!StaticPrefs::TouchActionEnabled()) {
if (!StaticPrefs::layout_css_touch_action_enabled()) {
return true;
}
if (mAllowedTouchBehaviors.IsEmpty()) {
@ -710,7 +713,7 @@ bool TouchBlockState::TouchActionAllowsPanningX() const {
}
bool TouchBlockState::TouchActionAllowsPanningY() const {
if (!StaticPrefs::TouchActionEnabled()) {
if (!StaticPrefs::layout_css_touch_action_enabled()) {
return true;
}
if (mAllowedTouchBehaviors.IsEmpty()) {
@ -722,7 +725,7 @@ bool TouchBlockState::TouchActionAllowsPanningY() const {
}
bool TouchBlockState::TouchActionAllowsPanningXY() const {
if (!StaticPrefs::TouchActionEnabled()) {
if (!StaticPrefs::layout_css_touch_action_enabled()) {
return true;
}
if (mAllowedTouchBehaviors.IsEmpty()) {

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

@ -13,6 +13,7 @@
#include "mozilla/layers/APZThreadUtils.h"
#include "OverscrollHandoffState.h"
#include "QueuedInput.h"
#include "mozilla/StaticPrefs.h"
#define INPQ_LOG(...)
// #define INPQ_LOG(...) printf_stderr("INPQ: " __VA_ARGS__)
@ -82,7 +83,7 @@ nsEventStatus InputQueue::ReceiveTouchInput(
if (aEvent.mType == MultiTouchInput::MULTITOUCH_START) {
nsTArray<TouchBehaviorFlags> currentBehaviors;
bool haveBehaviors = false;
if (!StaticPrefs::TouchActionEnabled()) {
if (!StaticPrefs::layout_css_touch_action_enabled()) {
haveBehaviors = true;
} else if (mActiveTouchBlock) {
haveBehaviors =
@ -114,7 +115,7 @@ nsEventStatus InputQueue::ReceiveTouchInput(
aTarget, InputBlockState::TargetConfirmationState::eConfirmed,
nullptr /* the block was just created so it has no events */,
false /* not a scrollbar drag */);
if (StaticPrefs::TouchActionEnabled()) {
if (StaticPrefs::layout_css_touch_action_enabled()) {
block->SetAllowedTouchBehaviors(currentBehaviors);
}
INPQ_LOG("block %p tagged as fast-motion\n", block);

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

@ -521,7 +521,7 @@ void APZCTesterBase::Tap(const RefPtr<InputReceiver>& aTarget,
// If touch-action is enabled then simulate the allowed touch behaviour
// notification that the main thread is supposed to deliver.
if (StaticPrefs::TouchActionEnabled() &&
if (StaticPrefs::layout_css_touch_action_enabled() &&
status != nsEventStatus_eConsumeNoDefault) {
SetDefaultAllowedTouchBehavior(aTarget, *aOutInputBlockId);
}
@ -597,7 +597,7 @@ void APZCTesterBase::Pan(const RefPtr<InputReceiver>& aTarget,
EXPECT_EQ(1UL, aAllowedTouchBehaviors->Length());
aTarget->SetAllowedTouchBehavior(*aOutInputBlockId,
*aAllowedTouchBehaviors);
} else if (StaticPrefs::TouchActionEnabled()) {
} else if (StaticPrefs::layout_css_touch_action_enabled()) {
SetDefaultAllowedTouchBehavior(aTarget, *aOutInputBlockId);
}
}
@ -682,7 +682,7 @@ void APZCTesterBase::DoubleTap(const RefPtr<InputReceiver>& aTarget,
// If touch-action is enabled then simulate the allowed touch behaviour
// notification that the main thread is supposed to deliver.
if (StaticPrefs::TouchActionEnabled() &&
if (StaticPrefs::layout_css_touch_action_enabled() &&
status != nsEventStatus_eConsumeNoDefault) {
SetDefaultAllowedTouchBehavior(aTarget, blockId);
}
@ -701,7 +701,7 @@ void APZCTesterBase::DoubleTap(const RefPtr<InputReceiver>& aTarget,
}
mcc->AdvanceByMillis(10);
if (StaticPrefs::TouchActionEnabled() &&
if (StaticPrefs::layout_css_touch_action_enabled() &&
status != nsEventStatus_eConsumeNoDefault) {
SetDefaultAllowedTouchBehavior(aTarget, blockId);
}
@ -774,7 +774,7 @@ void APZCTesterBase::PinchWithTouchInput(
EXPECT_EQ(2UL, aAllowedTouchBehaviors->Length());
aTarget->SetAllowedTouchBehavior(*aOutInputBlockId,
*aAllowedTouchBehaviors);
} else if (StaticPrefs::TouchActionEnabled()) {
} else if (StaticPrefs::layout_css_touch_action_enabled()) {
SetDefaultAllowedTouchBehavior(aTarget, *aOutInputBlockId, 2);
}

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

@ -348,7 +348,7 @@ TEST_F(APZCBasicTester, OverScroll_Bug1152051b) {
uint64_t blockId;
nsEventStatus status =
TouchDown(apzc, ScreenIntPoint(10, 10), mcc->Time(), &blockId);
if (StaticPrefs::TouchActionEnabled() &&
if (StaticPrefs::layout_css_touch_action_enabled() &&
status != nsEventStatus_eConsumeNoDefault) {
SetDefaultAllowedTouchBehavior(apzc, blockId);
}

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

@ -27,7 +27,7 @@ class APZCGestureDetectorTester : public APZCBasicTester {
};
TEST_F(APZCGestureDetectorTester, Pan_After_Pinch) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, false);
FrameMetrics originalMetrics = GetPinchableFrameMetrics();
apzc->SetFrameMetrics(originalMetrics);
@ -126,7 +126,7 @@ TEST_F(APZCGestureDetectorTester, Pan_After_Pinch) {
}
TEST_F(APZCGestureDetectorTester, Pan_With_Tap) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, false);
FrameMetrics originalMetrics = GetPinchableFrameMetrics();
apzc->SetFrameMetrics(originalMetrics);
@ -392,7 +392,7 @@ class APZCLongPressTester : public APZCGestureDetectorTester {
TouchDown(apzc, ScreenIntPoint(10, 10), mcc->Time(), &blockId);
EXPECT_EQ(nsEventStatus_eConsumeDoDefault, status);
if (StaticPrefs::TouchActionEnabled() &&
if (StaticPrefs::layout_css_touch_action_enabled() &&
status != nsEventStatus_eConsumeNoDefault) {
// SetAllowedTouchBehavior() must be called after sending touch-start.
nsTArray<uint32_t> allowedTouchBehaviors;
@ -458,7 +458,7 @@ class APZCLongPressTester : public APZCGestureDetectorTester {
mcc->Time(), &blockId);
EXPECT_EQ(nsEventStatus_eConsumeDoDefault, status);
if (StaticPrefs::TouchActionEnabled() &&
if (StaticPrefs::layout_css_touch_action_enabled() &&
status != nsEventStatus_eConsumeNoDefault) {
// SetAllowedTouchBehavior() must be called after sending touch-start.
nsTArray<uint32_t> allowedTouchBehaviors;
@ -521,24 +521,24 @@ class APZCLongPressTester : public APZCGestureDetectorTester {
};
TEST_F(APZCLongPressTester, LongPress) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, false);
DoLongPressTest(mozilla::layers::AllowedTouchBehavior::NONE);
}
TEST_F(APZCLongPressTester, LongPressWithTouchAction) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, true);
DoLongPressTest(mozilla::layers::AllowedTouchBehavior::HORIZONTAL_PAN |
mozilla::layers::AllowedTouchBehavior::VERTICAL_PAN |
mozilla::layers::AllowedTouchBehavior::PINCH_ZOOM);
}
TEST_F(APZCLongPressTester, LongPressPreventDefault) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, false);
DoLongPressPreventDefaultTest(mozilla::layers::AllowedTouchBehavior::NONE);
}
TEST_F(APZCLongPressTester, LongPressPreventDefaultWithTouchAction) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, true);
DoLongPressPreventDefaultTest(
mozilla::layers::AllowedTouchBehavior::HORIZONTAL_PAN |
mozilla::layers::AllowedTouchBehavior::VERTICAL_PAN |
@ -706,7 +706,7 @@ TEST_F(APZCGestureDetectorTester, LongPressInterruptedByWheel) {
uint64_t wheelBlockId = 0;
nsEventStatus status =
TouchDown(apzc, ScreenIntPoint(10, 10), mcc->Time(), &touchBlockId);
if (StaticPrefs::TouchActionEnabled() &&
if (StaticPrefs::layout_css_touch_action_enabled() &&
status != nsEventStatus_eConsumeNoDefault) {
SetDefaultAllowedTouchBehavior(apzc, touchBlockId);
}

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

@ -455,7 +455,7 @@ TEST_F(APZHitTestingTester, ComplexMultiLayerTree) {
}
TEST_F(APZHitTestingTester, TestRepaintFlushOnNewInputBlock) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, false);
// The main purpose of this test is to verify that touch-start events (or
// anything that starts a new input block) don't ever get untransformed. This
@ -637,7 +637,7 @@ TEST_F(APZHitTestingTester, Bug1148350) {
uint64_t blockId;
TouchDown(manager, ScreenIntPoint(100, 100), mcc->Time(), &blockId);
if (StaticPrefs::TouchActionEnabled()) {
if (StaticPrefs::layout_css_touch_action_enabled()) {
SetDefaultAllowedTouchBehavior(manager, blockId);
}
mcc->AdvanceByMillis(100);

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

@ -82,7 +82,7 @@ class APZCPanningTester : public APZCBasicTester {
};
TEST_F(APZCPanningTester, Pan) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, false);
SCOPED_GFX_PREF(APZVelocityBias, float,
0.0); // Velocity bias can cause extra repaint requests
DoPanTest(true, true, mozilla::layers::AllowedTouchBehavior::NONE);
@ -97,7 +97,7 @@ TEST_F(APZCPanningTester, Pan) {
// finger horizontally too - APZ has no way of knowing beforehand and so must
// consume the events.
TEST_F(APZCPanningTester, PanWithTouchActionAuto) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, true);
SCOPED_GFX_PREF(APZVelocityBias, float,
0.0); // Velocity bias can cause extra repaint requests
DoPanTest(true, true,
@ -106,14 +106,14 @@ TEST_F(APZCPanningTester, PanWithTouchActionAuto) {
}
TEST_F(APZCPanningTester, PanWithTouchActionNone) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, true);
SCOPED_GFX_PREF(APZVelocityBias, float,
0.0); // Velocity bias can cause extra repaint requests
DoPanTest(false, false, 0);
}
TEST_F(APZCPanningTester, PanWithTouchActionPanX) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, true);
SCOPED_GFX_PREF(APZVelocityBias, float,
0.0); // Velocity bias can cause extra repaint requests
DoPanTest(false, false,
@ -121,18 +121,18 @@ TEST_F(APZCPanningTester, PanWithTouchActionPanX) {
}
TEST_F(APZCPanningTester, PanWithTouchActionPanY) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, true);
SCOPED_GFX_PREF(APZVelocityBias, float,
0.0); // Velocity bias can cause extra repaint requests
DoPanTest(true, true, mozilla::layers::AllowedTouchBehavior::VERTICAL_PAN);
}
TEST_F(APZCPanningTester, PanWithPreventDefaultAndTouchAction) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, true);
DoPanWithPreventDefaultTest();
}
TEST_F(APZCPanningTester, PanWithPreventDefault) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, false);
DoPanWithPreventDefaultTest();
}

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

@ -210,18 +210,18 @@ class APZCPinchLockingTester : public APZCPinchTester {
};
TEST_F(APZCPinchTester, Pinch_DefaultGestures_NoTouchAction) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, false);
DoPinchTest(true);
}
TEST_F(APZCPinchGestureDetectorTester, Pinch_UseGestureDetector_NoTouchAction) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, false);
DoPinchTest(true);
}
TEST_F(APZCPinchGestureDetectorTester,
Pinch_UseGestureDetector_TouchActionNone) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, true);
nsTArray<uint32_t> behaviors = {mozilla::layers::AllowedTouchBehavior::NONE,
mozilla::layers::AllowedTouchBehavior::NONE};
DoPinchTest(false, &behaviors);
@ -229,7 +229,7 @@ TEST_F(APZCPinchGestureDetectorTester,
TEST_F(APZCPinchGestureDetectorTester,
Pinch_UseGestureDetector_TouchActionZoom) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, true);
nsTArray<uint32_t> behaviors;
behaviors.AppendElement(mozilla::layers::AllowedTouchBehavior::PINCH_ZOOM);
behaviors.AppendElement(mozilla::layers::AllowedTouchBehavior::PINCH_ZOOM);
@ -238,7 +238,7 @@ TEST_F(APZCPinchGestureDetectorTester,
TEST_F(APZCPinchGestureDetectorTester,
Pinch_UseGestureDetector_TouchActionNotAllowZoom) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, true);
nsTArray<uint32_t> behaviors;
behaviors.AppendElement(mozilla::layers::AllowedTouchBehavior::NONE);
behaviors.AppendElement(mozilla::layers::AllowedTouchBehavior::PINCH_ZOOM);
@ -247,7 +247,7 @@ TEST_F(APZCPinchGestureDetectorTester,
TEST_F(APZCPinchGestureDetectorTester,
Pinch_UseGestureDetector_TouchActionNone_NoAPZZoom) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, true);
SCOPED_GFX_PREF(APZAllowZooming, bool, false);
// Since we are preventing the pinch action via touch-action we should not be
@ -469,7 +469,7 @@ TEST_F(APZCPinchGestureDetectorTester, Pinch_APZZoom_Disabled) {
TEST_F(APZCPinchGestureDetectorTester, Pinch_NoSpan) {
SCOPED_GFX_PREF(APZAllowZooming, bool, false);
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, false);
FrameMetrics originalMetrics = GetPinchableFrameMetrics();
apzc->SetFrameMetrics(originalMetrics);

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

@ -614,11 +614,11 @@ TEST_F(APZScrollHandoffTester, ImmediateHandoffDisallowed_Fling) {
}
TEST_F(APZScrollHandoffTester, CrossApzcAxisLock_NoTouchAction) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, false);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, false);
TestCrossApzcAxisLock();
}
TEST_F(APZScrollHandoffTester, CrossApzcAxisLock_TouchAction) {
SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
SCOPED_GFX_PREF(layout_css_touch_action_enabled, bool, true);
TestCrossApzcAxisLock();
}

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

@ -551,7 +551,7 @@ class MOZ_STACK_CLASS AutoPointerEventTargetUpdater final {
MOZ_ASSERT(!aFrame->GetContent() ||
aShell->GetDocument() == aFrame->GetContent()->OwnerDoc());
MOZ_ASSERT(PointerEventHandler::IsPointerEventEnabled());
MOZ_ASSERT(StaticPrefs::dom_w3c_pointer_events_enabled());
mShell = aShell;
mWeakFrame = aFrame;
mTargetContent = aTargetContent;
@ -6909,7 +6909,7 @@ bool PresShell::EventHandler::DispatchPrecedingPointerEvent(
MOZ_ASSERT(aEventTargetData);
MOZ_ASSERT(aEventStatus);
if (!PointerEventHandler::IsPointerEventEnabled()) {
if (!StaticPrefs::dom_w3c_pointer_events_enabled()) {
return true;
}

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

@ -267,7 +267,6 @@ nsresult nsLayoutStatics::Initialize() {
nsApplicationCacheService::AppClearDataObserverInit();
HTMLVideoElement::InitStatics();
nsGenericHTMLFrameElement::InitStatics();
#ifdef MOZ_XUL
nsMenuBarListener::InitializeStatics();

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

@ -395,9 +395,8 @@ nsFileControlFrame::DnDListener::HandleEvent(Event* aEvent) {
inputElement->MozSetDndFilesAndDirectories(array);
} else {
bool blinkFileSystemEnabled =
Preferences::GetBool("dom.webkitBlink.filesystem.enabled", false);
bool dirPickerEnabled =
Preferences::GetBool("dom.input.dirpicker", false);
StaticPrefs::dom_webkitBlink_filesystem_enabled();
bool dirPickerEnabled = StaticPrefs::dom_input_dirpicker();
if (blinkFileSystemEnabled || dirPickerEnabled) {
FileList* files = static_cast<FileList*>(fileList.get());
if (files) {

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

@ -15,6 +15,7 @@
#include "mozilla/EventStates.h"
#include "mozilla/HTMLEditor.h"
#include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs.h"
#include "nsCOMPtr.h"
#include "nsString.h"
@ -585,8 +586,6 @@ void nsFrameSelection::Init(mozilla::PresShell* aPresShell,
if (!prefCachesInitialized) {
prefCachesInitialized = true;
Preferences::AddBoolVarCache(&sSelectionEventsEnabled,
"dom.select_events.enabled", false);
Preferences::AddBoolVarCache(&sSelectionEventsOnTextControlsEnabled,
"dom.select_events.textcontrols.enabled",
false);
@ -601,7 +600,7 @@ void nsFrameSelection::Init(mozilla::PresShell* aPresShell,
bool plaintextControl = (aLimiter != nullptr);
bool initSelectEvents = plaintextControl
? sSelectionEventsOnTextControlsEnabled
: sSelectionEventsEnabled;
: StaticPrefs::dom_select_events_enabled();
Document* doc = aPresShell->GetDocument();
if (initSelectEvents ||
@ -613,7 +612,6 @@ void nsFrameSelection::Init(mozilla::PresShell* aPresShell,
}
}
bool nsFrameSelection::sSelectionEventsEnabled = false;
bool nsFrameSelection::sSelectionEventsOnTextControlsEnabled = false;
nsresult nsFrameSelection::MoveCaret(nsDirection aDirection,

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

@ -880,7 +880,6 @@ class nsFrameSelection final {
int8_t mCaretMovementStyle = 0;
static bool sSelectionEventsEnabled;
static bool sSelectionEventsOnTextControlsEnabled;
};

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

@ -889,7 +889,7 @@ static void AddAnimationsForDisplayItem(nsIFrame* aFrame,
GroupAnimationsByProperty(matchedAnimations, propertySet);
// Bug 1424900: Drop this pref check after shipping individual transforms.
const bool hasMultipleTransformLikeProperties =
StaticPrefs::IndividualTransform() &&
StaticPrefs::layout_css_individual_transform_enabled() &&
aType == DisplayItemType::TYPE_TRANSFORM;
nsCSSPropertyIDSet nonAnimatingProperties =
nsCSSPropertyIDSet::TransformLikeProperties();

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

@ -81,7 +81,6 @@ pref("image.cache.size", 1048576); // bytes
/* offline cache prefs */
pref("browser.offline-apps.notify", true);
pref("browser.cache.offline.enable", true);
pref("browser.cache.offline.capacity", 5120); // kilobytes
pref("offline-apps.quota.warn", 1024); // kilobytes
@ -173,7 +172,6 @@ pref("browser.formfill.enable", true);
pref("layout.spellcheckDefault", 0);
/* new html5 forms */
pref("dom.forms.datetime", true);
pref("dom.forms.datetime.others", true);
/* extension manager and xpinstall */
@ -345,9 +343,6 @@ pref("privacy.item.geolocation", true);
pref("privacy.item.siteSettings", true);
pref("privacy.item.syncAccount", true);
// enable geo
pref("geo.enabled", true);
// content sink control -- controls responsiveness during page load
// see https://bugzilla.mozilla.org/show_bug.cgi?id=481566#c9
//pref("content.sink.enable_perf_mode", 2); // 0 - switch, 1 - interactive, 2 - perf
@ -794,11 +789,6 @@ pref("consoleservice.logcat", false);
pref("consoleservice.logcat", true);
#endif
#ifndef RELEASE_OR_BETA
// Enable VR on mobile, making it enable by default.
pref("dom.vr.enabled", true);
#endif
pref("browser.tabs.showAudioPlayingIcon", true);
pref("dom.serviceWorkers.enabled", true);
@ -829,13 +819,6 @@ pref("identity.fxaccounts.remote.oauth.uri", "https://oauth.accounts.firefox.com
// Token server used by Firefox Account-authenticated Sync.
pref("identity.sync.tokenserver.uri", "https://token.services.mozilla.com/1.0/sync/1.5");
#ifndef RELEASE_OR_BETA
// Enable Presentation API on Nightly
pref("dom.presentation.enabled", true);
pref("dom.presentation.controller.enabled", true); // enable 1-UA mode
pref("dom.presentation.receiver.enabled", true); // enable 1-UA mode
#endif
pref("dom.audiochannel.audioCompeting", true);
pref("dom.audiochannel.mediaControl", true);
pref("media.block-autoplay-until-in-foreground", false);

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

@ -104,6 +104,12 @@
// clang-format off
#ifdef RELEASE_OR_BETA
# define NOT_IN_RELEASE_OR_BETA_VALUE false
#else
# define NOT_IN_RELEASE_OR_BETA_VALUE true
#endif
//---------------------------------------------------------------------------
// Prefs starting with "accessibility."
//---------------------------------------------------------------------------
@ -682,6 +688,18 @@ VARCACHE_PREF(
bool, false
)
//---------------------------------------------------------------------------
// Prefs starting with "beacon."
//---------------------------------------------------------------------------
// Is support for Navigator.sendBeacon enabled?
VARCACHE_PREF(
Live,
"beacon.enabled",
beacon_enabled,
bool, true
)
//---------------------------------------------------------------------------
// Prefs starting with "browser."
//---------------------------------------------------------------------------
@ -959,6 +977,30 @@ VARCACHE_PREF(
bool, true
)
// Is support for CanvasRenderingContext2D.filter enabled?
VARCACHE_PREF(
Live,
"canvas.filters.enabled",
canvas_filters_enabled,
bool, true
)
// Provide ability to turn on support for canvas focus rings.
VARCACHE_PREF(
Live,
"canvas.focusring.enabled",
canvas_focusring_enabled,
bool, true
)
// Is support for CanvasRenderingContext2D's hitRegion APIs enabled?
VARCACHE_PREF(
Live,
"canvas.hitregions.enabled",
canvas_hitregions_enabled,
bool, false
)
//---------------------------------------------------------------------------
// Prefs starting with "channelclassifier."
//---------------------------------------------------------------------------
@ -990,6 +1032,15 @@ VARCACHE_PREF(
//---------------------------------------------------------------------------
// Prefs starting with "device."
//---------------------------------------------------------------------------
// Is support for the device sensors API enabled?
VARCACHE_PREF(
Live,
"device.sensors.enabled",
device_sensors_enabled,
bool, true
)
VARCACHE_PREF(
Live,
"device.sensors.ambientLight.enabled",
@ -1153,6 +1204,14 @@ VARCACHE_PREF(
bool, false
)
// Is support for Navigator.getBattery enabled?
VARCACHE_PREF(
Live,
"dom.battery.enabled",
dom_battery_enabled,
bool, true
)
// Block multiple external protocol URLs in iframes per single event.
VARCACHE_PREF(
Live,
@ -1217,6 +1276,14 @@ VARCACHE_PREF(
bool, false
)
// Is support for Performance.mozMemory enabled?
VARCACHE_PREF(
Live,
"dom.enable_memory_stats",
dom_enable_memory_stats,
bool, false
)
// Enable Performance API
// Whether nonzero values can be returned from performance.timing.*
VARCACHE_PREF(
@ -1439,6 +1506,54 @@ VARCACHE_PREF(
RelaxedAtomicBool, false
)
// Is support for input type=date and type=time enabled?
VARCACHE_PREF(
Live,
"dom.forms.datetime",
dom_forms_datetime,
bool, true
)
// Is support for HTMLInputElement.inputMode enabled?
VARCACHE_PREF(
Live,
"dom.forms.inputmode",
dom_forms_inputmode,
bool, NOT_IN_RELEASE_OR_BETA_VALUE
)
// Enable Directory API. By default, disabled.
VARCACHE_PREF(
Live,
"dom.input.dirpicker",
dom_input_dirpicker,
bool, false
)
// Is support for InputEvent.data enabled?
VARCACHE_PREF(
Live,
"dom.inputevent.data.enabled",
dom_inputevent_data_enabled,
bool, true
)
// Is support for InputEvent.dataTransfer enabled?
VARCACHE_PREF(
Live,
"dom.inputevent.datatransfer.enabled",
dom_inputevent_datatransfer_enabled,
bool, true
)
// Is support for InputEvent.inputType enabled?
VARCACHE_PREF(
Live,
"dom.inputevent.inputtype.enabled",
dom_inputevent_inputtype_enabled,
bool, true
)
// How long a content process can take before closing its IPC channel
// after shutdown is initiated. If the process exceeds the timeout,
// we fear the worst and kill it.
@ -1485,6 +1600,24 @@ VARCACHE_PREF(
bool, true
)
// Whether window.onappinstalled from "W3C Web Manifest" is enabled
VARCACHE_PREF(
Live,
"dom.manifest.onappinstalled",
dom_manifest_onappinstalled,
bool, false
)
// This pref is used to enable/disable the `document.autoplayPolicy` API which
// returns a enum string which presents current autoplay policy and can change
// overtime based on user session activity.
VARCACHE_PREF(
Live,
"dom.media.autoplay.autoplay-policy-api",
dom_media_autoplay_autoplay_policy_api,
bool, false
)
VARCACHE_PREF(
Live,
"dom.meta-viewport.enabled",
@ -1499,6 +1632,22 @@ VARCACHE_PREF(
bool, false
)
// Is support for module scripts (<script type="module">) enabled for content?
VARCACHE_PREF(
Live,
"dom.moduleScripts.enabled",
dom_moduleScripts_enabled,
bool, true
)
// Is support for mozBrowser frames enabled?
VARCACHE_PREF(
Live,
"dom.mozBrowserFramesEnabled",
dom_mozBrowserFramesEnabled,
bool, false
)
// Whether we disable triggering mutation events for changes to style
// attribute via CSSOM.
// NOTE: This preference is used in unit tests. If it is removed or its default
@ -1524,6 +1673,14 @@ VARCACHE_PREF(
)
#undef PREF_VALUE
// Is support for Window.paintWorklet enabled?
VARCACHE_PREF(
Live,
"dom.paintWorklet.enabled",
dom_paintWorklet_enabled,
bool, false
)
// Enable/disable the PaymentRequest API
VARCACHE_PREF(
Live,
@ -1573,6 +1730,46 @@ VARCACHE_PREF(
bool, false
)
// Is support for PerformanceTiming.timeToContentfulPaint enabled?
VARCACHE_PREF(
Live,
"dom.performance.time_to_contentful_paint.enabled",
dom_performance_time_to_contentful_paint_enabled,
bool, false
)
// Is support for PerformanceTiming.timeToDOMContentFlushed enabled?
VARCACHE_PREF(
Live,
"dom.performance.time_to_dom_content_flushed.enabled",
dom_performance_time_to_dom_content_flushed_enabled,
bool, false
)
// Is support for PerformanceTiming.timeToFirstInteractive enabled?
VARCACHE_PREF(
Live,
"dom.performance.time_to_first_interactive.enabled",
dom_performance_time_to_first_interactive_enabled,
bool, false
)
// Is support for PerformanceTiming.timeToNonBlankPaint enabled?
VARCACHE_PREF(
Live,
"dom.performance.time_to_non_blank_paint.enabled",
dom_performance_time_to_non_blank_paint_enabled,
bool, false
)
// Is support for Permissions.revoke enabled?
VARCACHE_PREF(
Live,
"dom.permissions.revoke.enable",
dom_permissions_revoke_enable,
bool, false
)
// Whether we should show the placeholder when the element is focused but empty.
VARCACHE_PREF(
Live,
@ -1581,27 +1778,44 @@ VARCACHE_PREF(
bool, true
)
// Is support for Element.requestPointerLock enabled?
// This is added for accessibility purpose. When user has no way to exit
// pointer lock (e.g. no keyboard available), they can use this pref to
// disable the Pointer Lock API altogether.
VARCACHE_PREF(
Live,
"dom.pointer-lock.enabled",
dom_pointer_lock_enabled,
bool, true
)
// Presentation API
#if defined(ANDROID)
# define PREF_VALUE NOT_IN_RELEASE_OR_BETA_VALUE
#else
# define PREF_VALUE false
#endif
VARCACHE_PREF(
Live,
"dom.presentation.enabled",
dom_presentation_enabled,
bool, false
bool, PREF_VALUE
)
VARCACHE_PREF(
Live,
"dom.presentation.controller.enabled",
dom_presentation_controller_enabled,
bool, false
bool, PREF_VALUE
)
VARCACHE_PREF(
Live,
"dom.presentation.receiver.enabled",
dom_presentation_receiver_enabled,
bool, false
bool, PREF_VALUE
)
#undef PREF_VALUE
VARCACHE_PREF(
Live,
@ -1635,6 +1849,14 @@ VARCACHE_PREF(
RelaxedAtomicBool, false
)
// Is support for Navigator.registerContentHandler enabled?
VARCACHE_PREF(
Live,
"dom.registerContentHandler.enabled",
dom_registerContentHandler_enabled,
bool, false
)
// Reporting API.
#ifdef NIGHTLY_BUILD
# define PREF_VALUE true
@ -1796,6 +2018,14 @@ VARCACHE_PREF(
)
#undef PREF_VALUE
// Is support for selection event APIs enabled?
VARCACHE_PREF(
Live,
"dom.select_events.enabled",
dom_select_events_enabled,
bool, true
)
VARCACHE_PREF(
Live,
"dom.separate_event_queue_for_post_message.enabled",
@ -1822,6 +2052,15 @@ VARCACHE_PREF(
RelaxedAtomicBool, false
)
// External.AddSearchProvider is deprecated and it will be removed in the next
// cycles.
VARCACHE_PREF(
Live,
"dom.sidebar.enabled",
dom_sidebar_enabled,
bool, true
)
// Are shared memory User Agent style sheets enabled?
VARCACHE_PREF(
Live,
@ -1852,6 +2091,14 @@ VARCACHE_PREF(
)
#undef PREF_VALUE
// Is support for Storage test APIs enabled?
VARCACHE_PREF(
Live,
"dom.storage.testing",
dom_storage_testing,
bool, false
)
// For area and anchor elements with target=_blank and no rel set to
// opener/noopener.
#ifdef EARLY_BETA_OR_EARLIER
@ -1867,6 +2114,14 @@ VARCACHE_PREF(
)
#undef PREF_VALUE
// Is support for Selection.GetRangesForInterval enabled?
VARCACHE_PREF(
Live,
"dom.testing.selection.GetRangesForInterval",
dom_testing_selection_GetRangesForInterval,
bool, false
)
VARCACHE_PREF(
Live,
"dom.testing.structuredclonetester.enabled",
@ -1899,12 +2154,29 @@ VARCACHE_PREF(
bool, false
)
// Is support for Window.visualViewport enabled?
VARCACHE_PREF(
Live,
"dom.visualviewport.enabled",
dom_visualviewport_enabled,
bool, false
)
// Is support for WebVR APIs enabled?
// Enabled by default in beta and release for Windows and OS X and for all
// platforms in nightly and aurora.
#if defined(XP_WIN) || defined(XP_DARWIN) || !defined(RELEASE_OR_BETA)
# define PREF_VALUE true
#else
# define PREF_VALUE false
#endif
VARCACHE_PREF(
Once,
"dom.vr.enabled",
dom_vr_enabled,
bool, false
bool, PREF_VALUE
)
#undef PREF_VALUE
VARCACHE_PREF(
Live,
@ -2096,6 +2368,14 @@ VARCACHE_PREF(
)
#undef PREF_VALUE
// Is support for Navigator.webdriver enabled?
VARCACHE_PREF(
Live,
"dom.webdriver.enabled",
dom_webdriver_enabled,
bool, true
)
// In case Touch API is enabled, this pref controls whether to support
// ontouch* event handlers, document.createTouch, document.createTouchList and
// document.createEvent("TouchEvent").
@ -2150,6 +2430,20 @@ VARCACHE_PREF(
bool, false
)
// Is support for HTMLInputElement.webkitEntries enabled?
#if !defined(MOZ_WIDGET_ANDROID)
# define PREF_VALUE true
#else
# define PREF_VALUE false
#endif
VARCACHE_PREF(
Live,
"dom.webkitBlink.filesystem.enabled",
dom_webkitBlink_filesystem_enabled,
bool, PREF_VALUE
)
#undef PREF_VALUE
// Whether the WebMIDI API is enabled
VARCACHE_PREF(
Live,
@ -2205,6 +2499,14 @@ VARCACHE_PREF(
RelaxedAtomicBool, true
)
// Is support for Window.event enabled?
VARCACHE_PREF(
Live,
"dom.window.event.enabled",
dom_window_event_enabled,
bool, true
)
// Enable the "noreferrer" feature argument for window.open()
VARCACHE_PREF(
Live,
@ -2257,6 +2559,45 @@ VARCACHE_PREF(
RelaxedAtomicBool, true
)
// Is support for XMLDocument.async enabled?
VARCACHE_PREF(
Live,
"dom.xmldocument.async.enabled",
dom_xmldocument_async_enabled,
bool, false
)
// Is support for XMLDocument.load enabled?
VARCACHE_PREF(
Live,
"dom.xmldocument.load.enabled",
dom_xmldocument_load_enabled,
bool, false
)
// Is support for Navigator.geolocation enabled?
VARCACHE_PREF(
Live,
"geo.enabled",
geo_enabled,
bool, true
)
// WebIDL test prefs
VARCACHE_PREF(
Live,
"abc.def",
abc_def,
bool, true
)
VARCACHE_PREF(
Live,
"ghi.jkl",
ghi_jkl,
bool, true
)
//---------------------------------------------------------------------------
// Prefs starting with "extensions."
//---------------------------------------------------------------------------
@ -4247,6 +4588,14 @@ VARCACHE_PREF(
)
#undef PREF_VALUE
// Is support for GeometryUtils.convert*FromNode enabled?
VARCACHE_PREF(
Live,
"layout.css.convertFromNode.enabled",
layout_css_convertFromNode_enabled,
bool, NOT_IN_RELEASE_OR_BETA_VALUE
)
// Is support for DOMMatrix enabled?
VARCACHE_PREF(
Live,
@ -4335,7 +4684,15 @@ VARCACHE_PREF(
VARCACHE_PREF(
Live,
"layout.css.individual-transform.enabled",
IndividualTransform,
layout_css_individual_transform_enabled,
bool, false
)
// Is support for CSS initial-letter property enabled?
VARCACHE_PREF(
Live,
"layout.css.initial-letter.enabled",
layout_css_initial_letter_enabled,
bool, false
)
@ -4347,6 +4704,22 @@ VARCACHE_PREF(
bool, false
)
// Is support for motion-path enabled?
VARCACHE_PREF(
Live,
"layout.css.motion-path.enabled",
layout_css_motion_path_enabled,
bool, NOT_IN_RELEASE_OR_BETA_VALUE
)
// Is support for -moz-binding enabled?
VARCACHE_PREF(
Live,
"layout.css.moz-binding.content.enabled",
layout_css_moz_binding_content_enabled,
bool, false
)
// Pref to control whether @-moz-document rules are enabled in content pages.
VARCACHE_PREF(
Live,
@ -4378,6 +4751,36 @@ VARCACHE_PREF(
bool, false
)
// Is -moz-osx-font-smoothing enabled? (Only supported in OSX builds)
#if defined(XP_MACOSX)
# define PREF_VALUE true
#else
# define PREF_VALUE false
#endif
VARCACHE_PREF(
Live,
"layout.css.osx-font-smoothing.enabled",
layout_css_osx_font_smoothing_enabled,
bool, PREF_VALUE
)
#undef PREF_VALUE
// Is support for CSS overflow-clip-box enabled for non-UA sheets?
VARCACHE_PREF(
Live,
"layout.css.overflow-clip-box.enabled",
layout_css_overflow_clip_box_enabled,
bool, false
)
// Is support for overscroll-behavior enabled?
VARCACHE_PREF(
Live,
"layout.css.overscroll-behavior.enabled",
layout_css_overscroll_behavior_enabled,
bool, true
)
VARCACHE_PREF(
Live,
"layout.css.paint-order.enabled",
@ -4393,6 +4796,30 @@ VARCACHE_PREF(
bool, true
)
// Is support for -moz-prefixed animation properties enabled?
VARCACHE_PREF(
Live,
"layout.css.prefixes.animations",
layout_css_prefixes_animations,
bool, true
)
// Is support for -moz-border-image enabled?
VARCACHE_PREF(
Live,
"layout.css.prefixes.border-image",
layout_css_prefixes_border_image,
bool, true
)
// Is support for -moz-box-sizing enabled?
VARCACHE_PREF(
Live,
"layout.css.prefixes.box-sizing",
layout_css_prefixes_box_sizing,
bool, true
)
// Are "-webkit-{min|max}-device-pixel-ratio" media queries supported?
VARCACHE_PREF(
Live,
@ -4401,6 +4828,30 @@ VARCACHE_PREF(
bool, true
)
// Is support for -moz-prefixed font feature properties enabled?
VARCACHE_PREF(
Live,
"layout.css.prefixes.font-features",
layout_css_prefixes_font_features,
bool, true
)
// Is support for -moz-prefixed transform properties enabled?
VARCACHE_PREF(
Live,
"layout.css.prefixes.transforms",
layout_css_prefixes_transforms,
bool, true
)
// Is support for -moz-prefixed transition properties enabled?
VARCACHE_PREF(
Live,
"layout.css.prefixes.transitions",
layout_css_prefixes_transitions,
bool, true
)
// Is CSS error reporting enabled?
VARCACHE_PREF(
Live,
@ -4416,6 +4867,22 @@ VARCACHE_PREF(
AtomicFloat, 1.0f
)
// Is support for scrollbar-color property enabled?
VARCACHE_PREF(
Live,
"layout.css.scrollbar-color.enabled",
layout_css_scrollbar_color_enabled,
bool, true
)
// Is support for scrollbar-width property enabled?
VARCACHE_PREF(
Live,
"layout.css.scrollbar-width.enabled",
layout_css_scrollbar_width_enabled,
bool, true
)
#ifdef NIGHTLY_BUILD
# define PREF_VALUE true
#else
@ -4472,11 +4939,16 @@ VARCACHE_PREF(
bool, true
)
// W3C touch-action css property (related to touch and pointer events)
// Note that we turn this on even on platforms/configurations where touch
// events are not supported (e.g. OS X, or Windows with e10s disabled). For
// those platforms we don't handle touch events anyway so it's conceptually
// a no-op.
VARCACHE_PREF(
Live,
"layout.css.touch_action.enabled",
TouchActionEnabled,
RelaxedAtomicBool, false
layout_css_touch_action_enabled,
RelaxedAtomicBool, true
)
// Does arbitrary ::-webkit-* pseudo-element parsed?
@ -4767,6 +5239,14 @@ VARCACHE_PREF(
)
#undef PREF_VALUE
// Is support for CSS text-justify property enabled?
VARCACHE_PREF(
Live,
"layout.css.text-justify.enabled",
layout_css_text_justify_enabled,
bool, true
)
// Is support for -webkit-line-clamp enabled?
VARCACHE_PREF(
Live,
@ -5536,7 +6016,7 @@ VARCACHE_PREF(
VARCACHE_PREF(
Live,
"media.videocontrols.lock-video-orientation",
MediaVideocontrolsLockVideoOrientation,
media_videocontrols_lock_video_orientation,
bool, PREF_VALUE
)
#undef PREF_VALUE
@ -5608,7 +6088,7 @@ VARCACHE_PREF(
VARCACHE_PREF(
Live,
"media.test.video-suspend",
MediaTestVideoSuspend,
media_test_video_suspend,
RelaxedAtomicBool, false
)
@ -5653,6 +6133,27 @@ VARCACHE_PREF(
bool, true
)
VARCACHE_PREF(
Live,
"media.peerconnection.dtmf.enabled",
media_peerconnection_dtmf_enabled,
bool, true
)
VARCACHE_PREF(
Live,
"media.peerconnection.identity.enabled",
media_peerconnection_identity_enabled,
bool, true
)
VARCACHE_PREF(
Live,
"media.peerconnection.rtpsourcesapi.enabled",
media_peerconnection_rtpsourcesapi_enabled,
bool, true
)
#ifdef MOZ_WEBRTC
#ifdef ANDROID
@ -5703,6 +6204,61 @@ VARCACHE_PREF(
#endif // MOZ_WEBRTC
// HTMLMediaElement.allowedToPlay should be exposed to web content when
// block autoplay rides the trains to release. Until then, Nightly only.
#ifdef NIGHTLY_BUILD
# define PREF_VALUE true
#else
# define PREF_VALUE false
#endif
VARCACHE_PREF(
Live,
"media.allowed-to-play.enabled",
media_allowed_to_play_enabled,
bool, PREF_VALUE
)
#undef PREF_VALUE
// Is support for MediaKeys.getStatusForPolicy enabled?
VARCACHE_PREF(
Live,
"media.eme.hdcp-policy-check.enabled",
media_eme_hdcp_policy_check_enabled,
bool, false
)
// Is support for MediaDevices.ondevicechange enabled?
VARCACHE_PREF(
Live,
"media.ondevicechange.enabled",
media_ondevicechange_enabled,
bool, true
)
// Is support for HTMLMediaElement.seekToNextFrame enabled?
VARCACHE_PREF(
Live,
"media.seekToNextFrame.enabled",
media_seekToNextFrame_enabled,
bool, true
)
// setSinkId will be enabled in bug 1498512. Till then the
// implementation will remain hidden behind this pref (Bug 1152401, Bug 934425).
VARCACHE_PREF(
Live,
"media.setsinkid.enabled",
media_setsinkid_enabled,
bool, false
)
VARCACHE_PREF(
Live,
"media.useAudioChannelService.testing",
media_useAudioChannelService_testing,
bool, false
)
//---------------------------------------------------------------------------
// Prefs starting with "mousewheel."
//---------------------------------------------------------------------------
@ -5844,14 +6400,14 @@ VARCACHE_PREF(
VARCACHE_PREF(
Live,
"network.cookie.thirdparty.sessionOnly",
network_cookie_thirdparty_sessionOnly,
network_cookie_thirdparty_sessionOnly,
bool, false
)
VARCACHE_PREF(
Live,
"network.cookie.thirdparty.nonsecureSessionOnly",
network_cookie_thirdparty_nonsecureSessionOnly,
network_cookie_thirdparty_nonsecureSessionOnly,
bool, false
)
@ -6347,6 +6903,18 @@ VARCACHE_PREF(
int32_t, 0
)
//---------------------------------------------------------------------------
// Prefs starting with "svg."
//---------------------------------------------------------------------------
// Is support for transform-box enabled?
VARCACHE_PREF(
Live,
"svg.transform-box.enabled",
svg_transform_box_enabled,
bool, true
)
//---------------------------------------------------------------------------
// Prefs starting with "telemetry."
//---------------------------------------------------------------------------
@ -6736,6 +7304,7 @@ VARCACHE_PREF(
)
#undef PREF_VALUE
//---------------------------------------------------------------------------
// End of prefs
//---------------------------------------------------------------------------

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

@ -99,9 +99,6 @@ pref("browser.cache.compression_level", 0);
// Don't show "Open with" option on download dialog if true.
pref("browser.download.forbid_open_with", false);
// Remove navigator.registerContentHandler
pref("dom.registerContentHandler.enabled", false);
// Insecure registerProtocolHandler is disabled by default
pref("dom.registerProtocolHandler.insecure.enabled", false);
@ -122,12 +119,6 @@ pref("dom.indexedDB.logging.profiler-marks", false);
// Whether or not File Handle is enabled.
pref("dom.fileHandle.enabled", true);
// Whether window.onappinstalled from "W3C Web Manifest" is enabled
pref("dom.manifest.onappinstalled", false);
// Whether or not selection events are enabled
pref("dom.select_events.enabled", true);
// Whether or not selection events on text controls are enabled
#ifdef NIGHTLY_BUILD
pref("dom.select_events.textcontrols.enabled", true);
@ -152,27 +143,6 @@ pref("dom.serviceWorkers.update_delay", 1000);
// Enable test for 24 hours update, service workers will always treat last update check time is over 24 hours
pref("dom.serviceWorkers.testUpdateOverOneDay", false);
// Enable Permission API's .revoke() method
pref("dom.permissions.revoke.enable", false);
// Enable exposing timeToNonBlankPaint
pref("dom.performance.time_to_non_blank_paint.enabled", false);
// Enable exposing timeToContentfulPaint
pref("dom.performance.time_to_contentful_paint.enabled", false);
// Enable exposing timeToDOMContentFlushed
pref("dom.performance.time_to_dom_content_flushed.enabled", false);
// Enable exposing timeToFirstInteractive
pref("dom.performance.time_to_first_interactive.enabled", false);
// Enable Pointer Lock API
// This is added for accessibility purpose. When user has no way to exit
// pointer lock (e.g. no keyboard available), they can use this pref to
// disable the Pointer Lock API altogether.
pref("dom.pointer-lock.enabled", true);
// If this is true, TextEventDispatcher dispatches keydown and keyup events
// even during composition (keypress events are never fired during composition
// even if this is true).
@ -208,15 +178,9 @@ pref("dom.keyboardevent.keypress.hack.use_legacy_keycode_and_charcode.addl", "")
// explanation for the detail.
pref("dom.mouseevent.click.hack.use_legacy_non-primary_dispatch", "");
// Whether InputEvent.data is enabled.
pref("dom.inputevent.data.enabled", true);
// Whether InputEvent.dataTransfer is enabled.
pref("dom.inputevent.datatransfer.enabled", true);
// Whether InputEvent.inputType is enabled.
pref("dom.inputevent.inputtype.enabled", true);
#ifdef JS_BUILD_BINAST
pref("dom.script_loader.binast_encoding.enabled", false);
@ -227,9 +191,6 @@ pref("dom.script_loader.binast_encoding.enabled", false);
pref("dom.script_loader.binast_encoding.domain.restrict.list", "*.facebook.com,static.xx.fbcdn.net,*.cloudflare.com,*.cloudflarestream.com,unpkg.com");
#endif
// Whether window.event is enabled
pref("dom.window.event.enabled", true);
// Fastback caching - if this pref is negative, then we calculate the number
// of content viewers to cache based on the amount of available memory.
pref("browser.sessionhistory.max_total_viewers", -1);
@ -402,8 +363,6 @@ pref("media.navigator.video.use_tmmbr", false);
pref("media.navigator.audio.use_fec", true);
pref("media.navigator.video.red_ulpfec_enabled", false);
pref("media.peerconnection.dtmf.enabled", true);
#ifdef NIGHTLY_BUILD
pref("media.peerconnection.sdp.rust.enabled", true);
pref("media.peerconnection.sdp.rust.compare", true);
@ -469,14 +428,12 @@ pref("media.peerconnection.ice.link_local", false); // Set only for testing IPV6
pref("media.peerconnection.ice.force_interface", ""); // Limit to only a single interface
pref("media.peerconnection.ice.relay_only", false); // Limit candidates to TURN
pref("media.peerconnection.use_document_iceservers", true);
pref("media.peerconnection.identity.enabled", true);
pref("media.peerconnection.identity.timeout", 10000);
pref("media.peerconnection.ice.stun_client_maximum_transmits", 7);
pref("media.peerconnection.ice.trickle_grace_period", 5000);
pref("media.peerconnection.ice.no_host", false);
pref("media.peerconnection.ice.default_address_only", false);
pref("media.peerconnection.ice.proxy_only", false);
pref("media.peerconnection.rtpsourcesapi.enabled", true);
pref("media.peerconnection.turn.disable", false);
// These values (aec, agc, and noise) are from:
@ -498,9 +455,6 @@ pref("media.getusermedia.agc", 1); // kAdaptiveDigital
pref("media.navigator.audio.full_duplex", true);
#endif
// Exposes the navigator.webdriver attribute.
pref("dom.webdriver.enabled", true);
#if !defined(ANDROID)
pref("media.getusermedia.screensharing.enabled", true);
#endif
@ -561,19 +515,6 @@ pref("media.autoplay.allow-extension-background-pages", true);
pref("media.autoplay.enabled.user-gestures-needed", false);
#endif
// HTMLMediaElement.allowedToPlay should be exposed to web content when
// block autoplay rides the trains to release. Until then, Nightly only.
#ifdef NIGHTLY_BUILD
pref("media.allowed-to-play.enabled", true);
#else
pref("media.allowed-to-play.enabled", false);
#endif
// This pref is used to enable/disable the `document.autoplayPolicy` API which
// returns a enum string which presents current autoplay policy and can change
// overtime based on user session activity.
pref("dom.media.autoplay.autoplay-policy-api", false);
// The default number of decoded video frames that are enqueued in
// MediaDecoderReader's mVideoQueue.
pref("media.video-queue.default-size", 10);
@ -620,10 +561,6 @@ pref("media.av1.use-dav1d", false);
pref("media.webaudio.audiocontextoptions-samplerate.enabled", true);
// setSinkId expected to be unconditionally enabled in 63. Till then the
// implementation will remain hidden behind this pref (Bug 1152401, Bug 934425).
pref("media.setsinkid.enabled", false);
// Weather we allow AMD switchable graphics
pref("layers.amd-switchable-gfx.enabled", true);
@ -961,11 +898,6 @@ pref("accessibility.tabfocus_applies_to_xul", true);
pref("ui.scrollToClick", 0);
#endif
// provide ability to turn on support for canvas focus rings
pref("canvas.focusring.enabled", true);
pref("canvas.hitregions.enabled", false);
pref("canvas.filters.enabled", true);
// We want the ability to forcibly disable platform a11y, because
// some non-a11y-related components attempt to bring it up. See bug
// 538530 for details about Windows; we have a pref here that allows it
@ -1263,7 +1195,6 @@ pref("dom.storage.shadow_writes", true);
pref("dom.storage.snapshot_prefill", 16384);
pref("dom.storage.snapshot_gradual_prefill", 4096);
pref("dom.storage.snapshot_reusing", true);
pref("dom.storage.testing", false);
pref("dom.storage.client_validation", true);
pref("dom.send_after_paint_to_content", false);
@ -1303,9 +1234,6 @@ pref("dom.experimental_forms", false);
// platforms which don't have a color picker implemented yet.
pref("dom.forms.color", true);
// Support for input type=date and type=time.
pref("dom.forms.datetime", true);
// Support for input type=month, type=week and type=datetime-local. By default,
// disabled.
pref("dom.forms.datetime.others", false);
@ -1324,9 +1252,6 @@ pref("dom.forms.select.customstyling", true);
#endif
pref("dom.select_popup_in_parent.enabled", false);
// Enable Directory API. By default, disabled.
pref("dom.input.dirpicker", false);
pref("dom.cycle_collector.incremental", true);
// Whether to shim a Components object on untrusted windows.
@ -3008,15 +2933,6 @@ pref("layout.css.dpi", -1);
// of a CSS "px". This is only used for windows on the screen, not for printing.
pref("layout.css.devPixelsPerPx", "-1.0");
// Is support for CSS initial-letter property enabled?
pref("layout.css.initial-letter.enabled", false);
// Is support for scrollbar-color property enabled?
pref("layout.css.scrollbar-color.enabled", true);
// Is support for scrollbar-width property enabled?
pref("layout.css.scrollbar-width.enabled", true);
// Set the threshold distance in CSS pixels below which scrolling will snap to
// an edge, when scroll snapping is set to "proximity".
pref("layout.css.scroll-snap.proximity-threshold", 200);
@ -3031,39 +2947,10 @@ pref("layout.css.scroll-snap.prediction-max-velocity", 2000);
// gestures.
pref("layout.css.scroll-snap.prediction-sensitivity", "0.750");
// Is support for GeometryUtils.convert*FromNode enabled?
#ifdef RELEASE_OR_BETA
pref("layout.css.convertFromNode.enabled", false);
#else
pref("layout.css.convertFromNode.enabled", true);
#endif
// Is support for CSS text-justify property enabled?
pref("layout.css.text-justify.enabled", true);
// Is the paint-order property supported for HTML text?
// (It is always supported for SVG.)
pref("layout.css.paint-order.enabled", true);
// Are sets of prefixed properties supported?
pref("layout.css.prefixes.border-image", true);
pref("layout.css.prefixes.transforms", true);
pref("layout.css.prefixes.transitions", true);
pref("layout.css.prefixes.animations", true);
pref("layout.css.prefixes.box-sizing", true);
pref("layout.css.prefixes.font-features", true);
// Is -moz-osx-font-smoothing enabled?
// Only supported in OSX builds
#ifdef XP_MACOSX
pref("layout.css.osx-font-smoothing.enabled", true);
#else
pref("layout.css.osx-font-smoothing.enabled", false);
#endif
// Is support for CSS overflow-clip-box enabled for non-UA sheets?
pref("layout.css.overflow-clip-box.enabled", false);
// Is layout of CSS outline-style:auto enabled?
pref("layout.css.outline-style-auto.enabled", false);
@ -3089,16 +2976,6 @@ pref("layout.css.scroll-behavior.damping-ratio", "1.0");
// Are inter-character ruby annotations enabled?
pref("layout.css.ruby.intercharacter.enabled", false);
// Is support for overscroll-behavior enabled?
pref("layout.css.overscroll-behavior.enabled", true);
// Is support for motion-path enabled?
#ifdef RELEASE_OR_BETA
pref("layout.css.motion-path.enabled", false);
#else
pref("layout.css.motion-path.enabled", true);
#endif
// pref for which side vertical scrollbars should be on
// 0 = end-side in UI direction
// 1 = end-side in document/content direction
@ -3367,8 +3244,6 @@ pref("svg.display-lists.painting.enabled", true);
// See https://svgwg.org/svg2-draft/single-page.html#types-SVGBoundingBoxOptions
pref("svg.new-getBBox.enabled", false);
pref("svg.transform-box.enabled", true);
# This pref controls whether the 'context-fill' and 'context-stroke' keywords
# can be used in SVG-as-an-image in the content processes to use the fill/
# stroke specified on the element that embeds the image. (These keywords are
@ -4906,8 +4781,6 @@ pref("webgl.perf.max-warnings", 0);
pref("webgl.perf.max-acceptable-fb-status-invals", 0);
pref("webgl.perf.spew-frame-allocs", true);
pref("webgl.enable-webgl2", true);
pref("webgl.enable-debug-renderer-info", true);
pref("webgl.renderer-string-override", "");
pref("webgl.vendor-string-override", "");
@ -5110,15 +4983,9 @@ pref("layers.shared-buffer-provider.enabled", true);
// Force all possible layers to be always active layers
pref("layers.force-active", false);
// Enable/Disable the geolocation API for content
pref("geo.enabled", true);
// Timeout for outbound network geolocation provider XHR
pref("geo.wifi.xhr.timeout", 60000);
// Enable/Disable the various sensor APIs for content
pref("device.sensors.enabled", true);
// Enable/Disable the device storage API for content
pref("device.storage.enabled", false);
@ -5245,9 +5112,6 @@ pref("dom.vibrator.enabled", true);
pref("dom.vibrator.max_vibrate_ms", 10000);
pref("dom.vibrator.max_vibrate_list_len", 128);
// Battery API
pref("dom.battery.enabled", true);
// Push
pref("dom.push.loglevel", "Error");
@ -5306,19 +5170,9 @@ pref("dom.w3c_pointer_events.dispatch_by_pointer_messages", false);
// W3C pointer events draft
pref("dom.w3c_pointer_events.implicit_capture", false);
// W3C MediaDevices devicechange event
pref("media.ondevicechange.enabled", true);
// W3C MediaDevices devicechange fake event
pref("media.ondevicechange.fakeDeviceChangeEvent.enabled", false);
// W3C touch-action css property (related to touch and pointer events)
// Note that we turn this on even on platforms/configurations where touch
// events are not supported (e.g. OS X, or Windows with e10s disabled). For
// those platforms we don't handle touch events anyway so it's conceptually
// a no-op.
pref("layout.css.touch_action.enabled", true);
// How long must we wait before declaring that a window is a "ghost" (i.e., a
// likely leak)? This should be longer than it usually takes for an eligible
// window to be collected via the GC/CC.
@ -5339,13 +5193,6 @@ pref("io.activity.enabled", false);
// to take effect.
pref("jsloader.shareGlobal", true);
// WebVR is enabled by default in beta and release for Windows and for all
// platforms in nightly and aurora.
#if defined(XP_WIN) || defined(XP_MACOSX) || !defined(RELEASE_OR_BETA)
pref("dom.vr.enabled", true);
#else
pref("dom.vr.enabled", false);
#endif
// It is often desirable to automatically start vr presentation when
// a user puts on the VR headset. This is done by emitting the
// Window.vrdisplayactivate event when the headset's sensors detect it
@ -5553,12 +5400,6 @@ pref("captivedetect.maxWaitingTime", 5000);
pref("captivedetect.pollingTime", 3000);
pref("captivedetect.maxRetryCount", 5);
#ifdef RELEASE_OR_BETA
pref("dom.forms.inputmode", false);
#else
pref("dom.forms.inputmode", true);
#endif
// Enable mapped array buffer by default.
pref("dom.mapped_arraybuffer.enabled", true);
@ -5691,8 +5532,6 @@ 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);
// Presentation Device
pref("dom.presentation.tcp_server.debug", false);
pref("dom.presentation.discovery.enabled", false);
@ -5714,9 +5553,6 @@ pref("intl.allow-insecure-text-input", false);
// Enable meta-viewport support in remote APZ-enabled frames.
pref("dom.meta-viewport.enabled", false);
// Disable Visual Viewport API
pref("dom.visualviewport.enabled", false);
// Search service settings
pref("browser.search.log", false);
pref("browser.search.update", true);
@ -5853,17 +5689,12 @@ pref("dom.input.fallbackUploadDir", "");
// Turn rewriting of youtube embeds on/off
pref("plugins.rewrite_youtube_embeds", true);
// Disable browser frames by default
pref("dom.mozBrowserFramesEnabled", false);
pref("dom.audiochannel.audioCompeting", false);
pref("dom.audiochannel.audioCompeting.allAgents", false);
// Default media volume
pref("media.default_volume", "1.0");
pref("media.seekToNextFrame.enabled", true);
// return the maximum number of cores that navigator.hardwareCurrency returns
pref("dom.maxHardwareConcurrency", 16);
@ -5872,10 +5703,6 @@ pref("dom.maxHardwareConcurrency", 16);
pref("osfile.reset_worker_delay", 30000);
#endif
#if !defined(MOZ_WIDGET_ANDROID)
pref("dom.webkitBlink.filesystem.enabled", true);
#endif
pref("media.block-autoplay-until-in-foreground", true);
// TODO: Bug 1324406: Treat 'data:' documents as unique, opaque origins
@ -5910,9 +5737,6 @@ pref("browser.sanitizer.loglevel", "Warn");
// To disable blocking of auth prompts, set the limit to -1.
pref("prompts.authentication_dialog_abuse_limit", 2);
// Whether module scripts (<script type="module">) are enabled for content.
pref("dom.moduleScripts.enabled", true);
// Maximum amount of time in milliseconds consecutive setTimeout()/setInterval()
// callback are allowed to run before yielding the event loop.
pref("dom.timeout.max_consecutive_callbacks_ms", 4);
@ -5992,10 +5816,6 @@ pref("dom.datatransfer.mozAtAPIs", false);
pref("dom.datatransfer.mozAtAPIs", true);
#endif
// External.AddSearchProvider is deprecated and it will be removed in the next
// cycles.
pref("dom.sidebar.enabled", true);
// Turn off fission frameloader swapping while regressions are being fixed.
// Should be turned back on to resolve bug 1551993.
pref("fission.rebuild_frameloaders_on_remoteness_change", false);

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

@ -85,6 +85,7 @@
#include "gfxConfig.h"
#include "nsView.h"
#include "nsViewManager.h"
#include "mozilla/StaticPrefs.h"
#ifdef DEBUG
# include "nsIObserver.h"
@ -898,7 +899,7 @@ void nsBaseWidget::ConfigureAPZCTreeManager() {
// have code that can deal with them properly. If APZ is not enabled, this
// function doesn't get called.
if (Preferences::GetInt("dom.w3c_touch_events.enabled", 0) ||
Preferences::GetBool("dom.w3c_pointer_events.enabled", false)) {
StaticPrefs::dom_w3c_pointer_events_enabled()) {
RegisterTouchWindow();
}
}
@ -976,7 +977,7 @@ nsEventStatus nsBaseWidget::ProcessUntransformedAPZEvent(
UniquePtr<DisplayportSetListener> postLayerization;
if (WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent()) {
if (touchEvent->mMessage == eTouchStart) {
if (StaticPrefs::TouchActionEnabled()) {
if (StaticPrefs::layout_css_touch_action_enabled()) {
APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(
this, GetDocument(), *(original->AsTouchEvent()), aInputBlockId,
mSetAllowedTouchBehaviorCallback);

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

@ -22,15 +22,12 @@ WinPointerEvents::GetPointerTypePtr WinPointerEvents::getPointerType = nullptr;
WinPointerEvents::GetPointerInfoPtr WinPointerEvents::getPointerInfo = nullptr;
WinPointerEvents::GetPointerPenInfoPtr WinPointerEvents::getPointerPenInfo =
nullptr;
bool WinPointerEvents::sPointerEventEnabled = true;
bool WinPointerEvents::sFirePointerEventsByWinPointerMessages = false;
WinPointerEvents::WinPointerEvents() {
InitLibrary();
static bool addedPointerEventEnabled = false;
if (!addedPointerEventEnabled) {
Preferences::AddBoolVarCache(&sPointerEventEnabled,
"dom.w3c_pointer_events.enabled", true);
Preferences::AddBoolVarCache(
&sFirePointerEventsByWinPointerMessages,
"dom.w3c_pointer_events.dispatch_by_pointer_messages", false);
@ -73,7 +70,7 @@ bool WinPointerEvents::ShouldHandleWinPointerMessages(UINT aMsg,
WPARAM aWParam) {
MOZ_ASSERT(aMsg == WM_POINTERDOWN || aMsg == WM_POINTERUP ||
aMsg == WM_POINTERUPDATE || aMsg == WM_POINTERLEAVE);
if (!sLibraryHandle || !sPointerEventEnabled) {
if (!sLibraryHandle || !StaticPrefs::dom_w3c_pointer_events_enabled()) {
return false;
}
@ -135,13 +132,13 @@ bool WinPointerEvents::ShouldRollupOnPointerEvent(UINT aMsg, WPARAM aWParam) {
}
bool WinPointerEvents::ShouldFirePointerEventByWinPointerMessages() {
MOZ_ASSERT(sLibraryHandle && sPointerEventEnabled);
MOZ_ASSERT(sLibraryHandle && StaticPrefs::dom_w3c_pointer_events_enabled());
return sFirePointerEventsByWinPointerMessages;
}
WinPointerInfo* WinPointerEvents::GetCachedPointerInfo(UINT aMsg,
WPARAM aWParam) {
if (!sLibraryHandle || !sPointerEventEnabled ||
if (!sLibraryHandle || !StaticPrefs::dom_w3c_pointer_events_enabled() ||
MOUSE_INPUT_SOURCE() != dom::MouseEvent_Binding::MOZ_SOURCE_PEN ||
ShouldFirePointerEventByWinPointerMessages()) {
return nullptr;

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

@ -162,7 +162,6 @@ class WinPointerEvents final {
static HMODULE sLibraryHandle;
static const wchar_t kPointerLibraryName[];
static bool sPointerEventEnabled;
static bool sFirePointerEventsByWinPointerMessages;
// Static function pointers
static GetPointerTypePtr getPointerType;