diff --git a/dom/canvas/WebGL2Context.cpp b/dom/canvas/WebGL2Context.cpp index 5aabad31f021..67409cee6ed8 100644 --- a/dom/canvas/WebGL2Context.cpp +++ b/dom/canvas/WebGL2Context.cpp @@ -31,7 +31,7 @@ UniquePtr WebGL2Context::CreateFormatUsage( } /*static*/ -bool WebGL2Context::IsSupported() { return StaticPrefs::WebGL2Enabled(); } +bool WebGL2Context::IsSupported() { return StaticPrefs::webgl_enable_webgl2(); } /*static*/ WebGL2Context* WebGL2Context::Create() { return new WebGL2Context(); } diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index bc7168d47e6e..731930060ab4 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -369,7 +369,7 @@ APZCTreeManager::UpdateHitTestingTreeImpl(LayersId aRootLayerTreeId, // For testing purposes, we log some data to the APZTestData associated with // the layers id that originated this update. APZTestData* testData = nullptr; - if (StaticPrefs::APZTestLoggingEnabled()) { + if (StaticPrefs::apz_test_logging_enabled()) { MutexAutoLock lock(mTestDataLock); UniquePtr ptr = MakeUnique(); auto result = mTestData.insert( @@ -1306,7 +1306,7 @@ nsEventStatus APZCTreeManager::ReceiveInputEvent( } if (apzc) { - if (StaticPrefs::APZTestLoggingEnabled() && + if (StaticPrefs::apz_test_logging_enabled() && mouseInput.mType == MouseInput::MOUSE_HITTEST) { ScrollableLayerGuid guid = apzc->GetGuid(); diff --git a/gfx/layers/apz/testutil/APZTestData.h b/gfx/layers/apz/testutil/APZTestData.h index 67cfde3ccac1..0985e3f989ab 100644 --- a/gfx/layers/apz/testutil/APZTestData.h +++ b/gfx/layers/apz/testutil/APZTestData.h @@ -130,7 +130,7 @@ class APZPaintLogHelper { public: APZPaintLogHelper(APZTestData* aTestData, SequenceNumber aPaintSequenceNumber) : mTestData(aTestData), mPaintSequenceNumber(aPaintSequenceNumber) { - MOZ_ASSERT(!aTestData || StaticPrefs::APZTestLoggingEnabled(), + MOZ_ASSERT(!aTestData || StaticPrefs::apz_test_logging_enabled(), "don't call me"); } diff --git a/gfx/layers/apz/util/APZEventState.cpp b/gfx/layers/apz/util/APZEventState.cpp index 2ef5273d3088..7309445bb2a0 100644 --- a/gfx/layers/apz/util/APZEventState.cpp +++ b/gfx/layers/apz/util/APZEventState.cpp @@ -396,7 +396,7 @@ void APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent, if (sentContentResponse && !isTouchPrevented && aApzResponse == nsEventStatus_eConsumeDoDefault && - StaticPrefs::PointerEventsEnabled()) { + StaticPrefs::dom_w3c_pointer_events_enabled()) { WidgetTouchEvent cancelEvent(aEvent); cancelEvent.mMessage = eTouchPointerCancel; cancelEvent.mFlags.mCancelable = false; // mMessage != eTouchCancel; diff --git a/gfx/layers/client/ClientLayerManager.cpp b/gfx/layers/client/ClientLayerManager.cpp index b415d409f79d..8bfae39cf9ae 100644 --- a/gfx/layers/client/ClientLayerManager.cpp +++ b/gfx/layers/client/ClientLayerManager.cpp @@ -244,7 +244,7 @@ bool ClientLayerManager::BeginTransactionWithTarget(gfxContext* aTarget, // enabled in this process; it may be enabled in the parent process, // and the parent process expects unique sequence numbers. ++mPaintSequenceNumber; - if (StaticPrefs::APZTestLoggingEnabled()) { + if (StaticPrefs::apz_test_logging_enabled()) { mApzTestData.StartNewPaint(mPaintSequenceNumber); } } @@ -545,7 +545,7 @@ float ClientLayerManager::RequestProperty(const nsAString& aProperty) { void ClientLayerManager::StartNewRepaintRequest( SequenceNumber aSequenceNumber) { - if (StaticPrefs::APZTestLoggingEnabled()) { + if (StaticPrefs::apz_test_logging_enabled()) { mApzTestData.StartNewRepaintRequest(aSequenceNumber); } } diff --git a/gfx/layers/client/ClientLayerManager.h b/gfx/layers/client/ClientLayerManager.h index 393a96992a49..f1154c3a52e2 100644 --- a/gfx/layers/client/ClientLayerManager.h +++ b/gfx/layers/client/ClientLayerManager.h @@ -202,7 +202,7 @@ class ClientLayerManager final : public LayerManager, void LogTestDataForCurrentPaint(ScrollableLayerGuid::ViewID aScrollId, const std::string& aKey, const std::string& aValue) { - MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me"); + MOZ_ASSERT(StaticPrefs::apz_test_logging_enabled(), "don't call me"); mApzTestData.LogTestDataForPaint(mPaintSequenceNumber, aScrollId, aKey, aValue); } @@ -215,18 +215,18 @@ class ClientLayerManager final : public LayerManager, // TODO(botond): When we start using this and write a wrapper similar to // nsLayoutUtils::LogTestDataForPaint(), make sure that wrapper checks - // StaticPrefs::APZTestLoggingEnabled(). + // StaticPrefs::apz_test_logging_enabled(). void LogTestDataForRepaintRequest(SequenceNumber aSequenceNumber, ScrollableLayerGuid::ViewID aScrollId, const std::string& aKey, const std::string& aValue) { - MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me"); + MOZ_ASSERT(StaticPrefs::apz_test_logging_enabled(), "don't call me"); mApzTestData.LogTestDataForRepaintRequest(aSequenceNumber, aScrollId, aKey, aValue); } void LogAdditionalTestData(const std::string& aKey, const std::string& aValue) { - MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me"); + MOZ_ASSERT(StaticPrefs::apz_test_logging_enabled(), "don't call me"); mApzTestData.RecordAdditionalData(aKey, aValue); } diff --git a/gfx/layers/wr/WebRenderLayerManager.cpp b/gfx/layers/wr/WebRenderLayerManager.cpp index cea0d3a3013c..24cfc06cc3cf 100644 --- a/gfx/layers/wr/WebRenderLayerManager.cpp +++ b/gfx/layers/wr/WebRenderLayerManager.cpp @@ -182,7 +182,7 @@ bool WebRenderLayerManager::BeginTransaction(const nsCString& aURL) { // enabled in this process; it may be enabled in the parent process, // and the parent process expects unique sequence numbers. ++mPaintSequenceNumber; - if (StaticPrefs::APZTestLoggingEnabled()) { + if (StaticPrefs::apz_test_logging_enabled()) { mApzTestData.StartNewPaint(mPaintSequenceNumber); } return true; diff --git a/gfx/layers/wr/WebRenderLayerManager.h b/gfx/layers/wr/WebRenderLayerManager.h index f544b9c3710b..d84f8a049228 100644 --- a/gfx/layers/wr/WebRenderLayerManager.h +++ b/gfx/layers/wr/WebRenderLayerManager.h @@ -154,13 +154,13 @@ class WebRenderLayerManager final : public LayerManager { void LogTestDataForCurrentPaint(ScrollableLayerGuid::ViewID aScrollId, const std::string& aKey, const std::string& aValue) { - MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me"); + MOZ_ASSERT(StaticPrefs::apz_test_logging_enabled(), "don't call me"); mApzTestData.LogTestDataForPaint(mPaintSequenceNumber, aScrollId, aKey, aValue); } void LogAdditionalTestData(const std::string& aKey, const std::string& aValue) { - MOZ_ASSERT(StaticPrefs::APZTestLoggingEnabled(), "don't call me"); + MOZ_ASSERT(StaticPrefs::apz_test_logging_enabled(), "don't call me"); mApzTestData.RecordAdditionalData(aKey, aValue); } diff --git a/gfx/vr/VRManager.cpp b/gfx/vr/VRManager.cpp index be11406c5f3a..899604ffe9b2 100644 --- a/gfx/vr/VRManager.cpp +++ b/gfx/vr/VRManager.cpp @@ -100,7 +100,7 @@ VRManager::VRManager() // Enable gamepad extensions while VR is enabled. // Preference only can be set at the Parent process. - if (XRE_IsParentProcess() && StaticPrefs::VREnabled()) { + if (XRE_IsParentProcess() && StaticPrefs::dom_vr_enabled()) { Preferences::SetBool("dom.gamepad.extensions.enabled", true); } } diff --git a/gfx/vr/gfxVRExternal.cpp b/gfx/vr/gfxVRExternal.cpp index d895973224bb..513743aab716 100644 --- a/gfx/vr/gfxVRExternal.cpp +++ b/gfx/vr/gfxVRExternal.cpp @@ -635,7 +635,7 @@ already_AddRefed VRSystemManagerExternal::Create( VRExternalShmem* aAPIShmem /* = nullptr*/) { MOZ_ASSERT(NS_IsMainThread()); - if (!StaticPrefs::VREnabled()) { + if (!StaticPrefs::dom_vr_enabled()) { return nullptr; } diff --git a/gfx/vr/gfxVRPuppet.cpp b/gfx/vr/gfxVRPuppet.cpp index a2b776f33117..5dba98d94b16 100644 --- a/gfx/vr/gfxVRPuppet.cpp +++ b/gfx/vr/gfxVRPuppet.cpp @@ -640,7 +640,7 @@ VRSystemManagerPuppet::VRSystemManagerPuppet() /*static*/ already_AddRefed VRSystemManagerPuppet::Create() { - if (!StaticPrefs::VREnabled() || !StaticPrefs::VRPuppetEnabled()) { + if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::VRPuppetEnabled()) { return nullptr; } diff --git a/gfx/vr/service/OSVRSession.cpp b/gfx/vr/service/OSVRSession.cpp index bb125966dec3..df481ad9ea99 100644 --- a/gfx/vr/service/OSVRSession.cpp +++ b/gfx/vr/service/OSVRSession.cpp @@ -209,7 +209,7 @@ OSVRSession::OSVRSession() OSVRSession::~OSVRSession() { Shutdown(); } bool OSVRSession::Initialize(mozilla::gfx::VRSystemState& aSystemState) { - if (!StaticPrefs::VREnabled() || !StaticPrefs::VROSVREnabled()) { + if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::VROSVREnabled()) { return false; } if (mOSVRInitialized) { @@ -494,4 +494,4 @@ void OSVRSession::VibrateHaptic(uint32_t aControllerIdx, uint32_t aHapticIndex, void OSVRSession::StopVibrateHaptic(uint32_t aControllerIdx) {} -void OSVRSession::StopAllHaptics() {} \ No newline at end of file +void OSVRSession::StopAllHaptics() {} diff --git a/gfx/vr/service/OculusSession.cpp b/gfx/vr/service/OculusSession.cpp index 7da345e96936..0845d863d16f 100644 --- a/gfx/vr/service/OculusSession.cpp +++ b/gfx/vr/service/OculusSession.cpp @@ -206,7 +206,7 @@ OculusSession::OculusSession() OculusSession::~OculusSession() { Shutdown(); } bool OculusSession::Initialize(mozilla::gfx::VRSystemState& aSystemState) { - if (!StaticPrefs::VREnabled() || !StaticPrefs::VROculusEnabled()) { + if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::VROculusEnabled()) { return false; } diff --git a/gfx/vr/service/OpenVRSession.cpp b/gfx/vr/service/OpenVRSession.cpp index 688afb8d3550..5cdca255fba0 100644 --- a/gfx/vr/service/OpenVRSession.cpp +++ b/gfx/vr/service/OpenVRSession.cpp @@ -250,7 +250,7 @@ OpenVRSession::~OpenVRSession() { } bool OpenVRSession::Initialize(mozilla::gfx::VRSystemState& aSystemState) { - if (!StaticPrefs::VREnabled() || !StaticPrefs::VROpenVREnabled()) { + if (!StaticPrefs::dom_vr_enabled() || !StaticPrefs::VROpenVREnabled()) { return false; } if (mVRSystem != nullptr) { diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 3c0f3ca7ea43..f79106e60a9c 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -8602,7 +8602,7 @@ void nsLayoutUtils::LogAdditionalTestData(nsDisplayListBuilder* aBuilder, /* static */ bool nsLayoutUtils::IsAPZTestLoggingEnabled() { - return StaticPrefs::APZTestLoggingEnabled(); + return StaticPrefs::apz_test_logging_enabled(); } //////////////////////////////////////// @@ -9140,7 +9140,7 @@ ScrollMetadata nsLayoutUtils::ComputeScrollMetadata( aScrollFrame ? aScrollFrame : aForFrame, isRootContentDocRootScrollFrame, metrics)); - if (StaticPrefs::APZPrintTree() || StaticPrefs::APZTestLoggingEnabled()) { + if (StaticPrefs::APZPrintTree() || StaticPrefs::apz_test_logging_enabled()) { if (nsIContent* content = frameForCompositionBoundsCalculation->GetContent()) { nsAutoString contentDescription; diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index 40ac22d2123f..44878041c0d6 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -1101,7 +1101,7 @@ nsRect nsDisplayListBuilder::OutOfFlowDisplayData::ComputeVisibleRectForFrame( } } visible = dirtyRectRelativeToDirtyFrame; - if (StaticPrefs::APZTestLoggingEnabled() && + if (StaticPrefs::apz_test_logging_enabled() && presShell->GetDocument()->IsContentDocument()) { nsLayoutUtils::LogAdditionalTestData( aBuilder, "fixedPosDisplayport", diff --git a/modules/libpref/init/StaticPrefList.h b/modules/libpref/init/StaticPrefList.h index 8dcf1b3eab91..2f3bf3388a98 100644 --- a/modules/libpref/init/StaticPrefList.h +++ b/modules/libpref/init/StaticPrefList.h @@ -560,7 +560,7 @@ VARCACHE_PREF( VARCACHE_PREF( Live, "apz.test.logging_enabled", - APZTestLoggingEnabled, + apz_test_logging_enabled, RelaxedAtomicBool, false ) @@ -1690,7 +1690,7 @@ VARCACHE_PREF( VARCACHE_PREF( Once, "dom.vr.enabled", - VREnabled, + dom_vr_enabled, bool, false ) @@ -1862,12 +1862,19 @@ VARCACHE_PREF( bool, true ) +// W3C draft pointer events +#ifdef ANDROID +# define PREF_VALUE false +#else +# define PREF_VALUE true +#endif VARCACHE_PREF( Live, "dom.w3c_pointer_events.enabled", - PointerEventsEnabled, - RelaxedAtomicBool, false + dom_w3c_pointer_events_enabled, + RelaxedAtomicBool, PREF_VALUE ) +#undef PREF_VALUE // In case Touch API is enabled, this pref controls whether to support // ontouch* event handlers, document.createTouch, document.createTouchList and @@ -6167,7 +6174,7 @@ VARCACHE_PREF( VARCACHE_PREF( Live, "webgl.enable-webgl2", - WebGL2Enabled, + webgl_enable_webgl2, RelaxedAtomicBool, true ) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index c5df9603b236..59b73a6c115e 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -5327,13 +5327,6 @@ pref("dom.w3c_touch_events.enabled", 0); pref("dom.w3c_touch_events.enabled", 2); #endif -// W3C draft pointer events -#if !defined(ANDROID) -pref("dom.w3c_pointer_events.enabled", true); -#else -pref("dom.w3c_pointer_events.enabled", false); -#endif - // Control firing WidgetMouseEvent by handling Windows pointer messages or mouse // messages. #if defined(XP_WIN) diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index f2521cc0e26c..3b14e7b09706 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -4195,7 +4195,8 @@ bool nsWindow::DispatchMouseEvent(EventMessage aEventMessage, WPARAM wParam, // Messages should be only at topLevel window. && nsWindowType::eWindowType_toplevel == mWindowType // Currently this scheme is used only when pointer events is enabled. - && StaticPrefs::PointerEventsEnabled() && InkCollector::sInkCollector) { + && StaticPrefs::dom_w3c_pointer_events_enabled() && + InkCollector::sInkCollector) { InkCollector::sInkCollector->SetTarget(mWnd); InkCollector::sInkCollector->SetPointerId(pointerId); }