diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 7bfbf938f5b..aa395381009 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -1435,7 +1435,6 @@ nsIDocument::nsIDocument() mPostedFlushUserFontSet(false), mPartID(0), mDidFireDOMContentLoaded(true), - mHasScrollLinkedEffect(false), mUserHasInteracted(false) { SetInDocument(); @@ -1556,8 +1555,6 @@ nsDocument::~nsDocument() mixedContentLevel = MIXED_DISPLAY_CONTENT; } Accumulate(Telemetry::MIXED_CONTENT_PAGE_LOAD, mixedContentLevel); - - Accumulate(Telemetry::SCROLL_LINKED_EFFECT_FOUND, mHasScrollLinkedEffect); } } @@ -13289,17 +13286,3 @@ nsIDocument::Fonts() } return mFontFaceSet; } - -void -nsIDocument::ReportHasScrollLinkedEffect() -{ - if (mHasScrollLinkedEffect) { - // We already did this once for this document, don't do it again. - return; - } - mHasScrollLinkedEffect = true; - nsContentUtils::ReportToConsole(nsIScriptError::warningFlag, - NS_LITERAL_CSTRING("Async Pan/Zoom"), - this, nsContentUtils::eLAYOUT_PROPERTIES, - "ScrollLinkedEffectFound"); -} diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h index b9f928c124a..87794b0dfcd 100644 --- a/dom/base/nsIDocument.h +++ b/dom/base/nsIDocument.h @@ -155,8 +155,8 @@ typedef CallbackObjectHolder NodeFilterHolder; } // namespace mozilla #define NS_IDOCUMENT_IID \ -{ 0xce1f7627, 0x7109, 0x4977, \ - { 0xba, 0x77, 0x49, 0x0f, 0xfd, 0xe0, 0x7a, 0xaa } } +{ 0x13011a82, 0x46cd, 0x4c33, \ + { 0x9d, 0x4e, 0x31, 0x41, 0xbb, 0x3f, 0x18, 0xe9 } } // Enum for requesting a particular type of document when creating a doc enum DocumentFlavor { @@ -2652,8 +2652,6 @@ public: return mUserHasInteracted; } - void ReportHasScrollLinkedEffect(); - protected: bool GetUseCounter(mozilla::UseCounter aUseCounter) { @@ -3054,8 +3052,6 @@ protected: uint32_t mBlockDOMContentLoaded; bool mDidFireDOMContentLoaded:1; - bool mHasScrollLinkedEffect:1; - // Our live MediaQueryLists PRCList mDOMMediaQueryLists; diff --git a/dom/locales/en-US/chrome/layout/layout_errors.properties b/dom/locales/en-US/chrome/layout/layout_errors.properties index b276ea27a7f..b1ca72171d0 100644 --- a/dom/locales/en-US/chrome/layout/layout_errors.properties +++ b/dom/locales/en-US/chrome/layout/layout_errors.properties @@ -9,4 +9,3 @@ ImageMapPolyWrongNumberOfCoords=The "coords" attribute of the tag is missing the last "y" coordinate (the correct format is "x1,y1,x2,y2 …"). TablePartRelPosWarning=Relative positioning of table rows and row groups is now supported. This site may need to be updated because it may depend on this feature having no effect. -ScrollLinkedEffectFound=This site appears to use a scroll-linked positioning effect. This may not work well with asynchronous panning; see https://developers.mozilla.org/docs/Mozilla/Performance/ScrollLinkedEffects for further details and to join the discussion on related tools and features! diff --git a/gfx/layers/apz/util/ScrollLinkedEffectDetector.cpp b/gfx/layers/apz/util/ScrollLinkedEffectDetector.cpp deleted file mode 100644 index 56b593f300d..00000000000 --- a/gfx/layers/apz/util/ScrollLinkedEffectDetector.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "ScrollLinkedEffectDetector.h" - -#include "nsIDocument.h" - -namespace mozilla { -namespace layers { - -uint32_t ScrollLinkedEffectDetector::sDepth = 0; -bool ScrollLinkedEffectDetector::sFoundScrollLinkedEffect = false; - -/* static */ void -ScrollLinkedEffectDetector::PositioningPropertyMutated() -{ - MOZ_ASSERT(NS_IsMainThread()); - - if (sDepth > 0) { - // We are inside a scroll event dispatch - sFoundScrollLinkedEffect = true; - } -} - -ScrollLinkedEffectDetector::ScrollLinkedEffectDetector(nsIDocument* aDoc) - : mDocument(aDoc) -{ - MOZ_ASSERT(NS_IsMainThread()); - sDepth++; -} - -ScrollLinkedEffectDetector::~ScrollLinkedEffectDetector() -{ - sDepth--; - if (sDepth == 0) { - // We have exited all (possibly-nested) scroll event dispatches, - // record whether or not we found an effect, and reset state - if (sFoundScrollLinkedEffect) { - mDocument->ReportHasScrollLinkedEffect(); - sFoundScrollLinkedEffect = false; - } - } -} - -} // namespace layers -} // namespace mozilla diff --git a/gfx/layers/apz/util/ScrollLinkedEffectDetector.h b/gfx/layers/apz/util/ScrollLinkedEffectDetector.h deleted file mode 100644 index f792586cfad..00000000000 --- a/gfx/layers/apz/util/ScrollLinkedEffectDetector.h +++ /dev/null @@ -1,43 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef mozilla_layers_ScrollLinkedEffectDetector_h -#define mozilla_layers_ScrollLinkedEffectDetector_h - -#include "mozilla/RefPtr.h" - -class nsIDocument; - -namespace mozilla { -namespace layers { - -// ScrollLinkedEffectDetector is used to detect the existence of a scroll-linked -// effect on a webpage. Generally speaking, a scroll-linked effect is something -// on the page that animates or changes with respect to the scroll position. -// Content authors usually rely on running some JS in response to the scroll -// event in order to implement such effects, and therefore it tends to be laggy -// or work improperly with APZ enabled. This class helps us detect such an -// effect so that we can warn the author and/or take other preventative -// measures. -class MOZ_STACK_CLASS ScrollLinkedEffectDetector -{ -private: - static uint32_t sDepth; - static bool sFoundScrollLinkedEffect; - -public: - static void PositioningPropertyMutated(); - - explicit ScrollLinkedEffectDetector(nsIDocument* aDoc); - ~ScrollLinkedEffectDetector(); - -private: - RefPtr mDocument; -}; - -} // namespace layers -} // namespace mozilla - -#endif /* mozilla_layers_ScrollLinkedEffectDetector_h */ diff --git a/gfx/layers/client/SingleTiledContentClient.h b/gfx/layers/client/SingleTiledContentClient.h index e2869976af5..6bd663be579 100644 --- a/gfx/layers/client/SingleTiledContentClient.h +++ b/gfx/layers/client/SingleTiledContentClient.h @@ -118,7 +118,7 @@ protected: } public: - static bool ClientSupportsLayerSize(const gfx::IntSize& aSize, ClientLayerManager* aManager); + static bool ClientSupportsLayerSize(const IntSize& aSize, ClientLayerManager* aManager); virtual void ClearCachedResources() override; @@ -127,7 +127,7 @@ public: virtual ClientTiledLayerBuffer* GetTiledBuffer() override { return mTiledBuffer; } virtual ClientTiledLayerBuffer* GetLowPrecisionTiledBuffer() override { return nullptr; } - virtual bool SupportsLayerSize(const gfx::IntSize& aSize, ClientLayerManager* aManager) const override; + virtual bool SupportsLayerSize(const IntSize& aSize, ClientLayerManager* aManager) const override; private: RefPtr mTiledBuffer; diff --git a/gfx/layers/moz.build b/gfx/layers/moz.build index 6918275ee0d..82e9248cd5c 100644 --- a/gfx/layers/moz.build +++ b/gfx/layers/moz.build @@ -109,7 +109,6 @@ EXPORTS.mozilla.layers += [ 'apz/util/ChromeProcessController.h', 'apz/util/DoubleTapToZoom.h', 'apz/util/InputAPZContext.h', - 'apz/util/ScrollLinkedEffectDetector.h', 'AsyncCanvasRenderer.h', 'AtomicRefCountedWithFinalize.h', 'AxisPhysicsModel.h', @@ -261,7 +260,6 @@ UNIFIED_SOURCES += [ 'apz/util/ChromeProcessController.cpp', 'apz/util/DoubleTapToZoom.cpp', 'apz/util/InputAPZContext.cpp', - 'apz/util/ScrollLinkedEffectDetector.cpp', 'AsyncCanvasRenderer.cpp', 'AxisPhysicsModel.cpp', 'AxisPhysicsMSDModel.cpp', diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index af6fb975cfd..a2ece470769 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -61,7 +61,6 @@ #include "nsPluginFrame.h" #include #include -#include "mozilla/layers/ScrollLinkedEffectDetector.h" #include "mozilla/unused.h" #include #include // for std::abs(int/long) @@ -4228,7 +4227,6 @@ ScrollFrameHelper::FireScrollEvent() nsPresContext* prescontext = mOuter->PresContext(); // Fire viewport scroll events at the document (where they // will bubble to the window) - mozilla::layers::ScrollLinkedEffectDetector detector(content->GetComposedDoc()); if (mIsRoot) { nsIDocument* doc = content->GetCurrentDoc(); if (doc) { diff --git a/layout/style/nsDOMCSSDeclaration.cpp b/layout/style/nsDOMCSSDeclaration.cpp index a8ab190c19b..c06654b481c 100644 --- a/layout/style/nsDOMCSSDeclaration.cpp +++ b/layout/style/nsDOMCSSDeclaration.cpp @@ -19,7 +19,6 @@ #include "mozilla/dom/BindingUtils.h" #include "nsContentUtils.h" #include "nsQueryObject.h" -#include "mozilla/layers/ScrollLinkedEffectDetector.h" using namespace mozilla; @@ -78,23 +77,6 @@ NS_IMETHODIMP nsDOMCSSDeclaration::SetPropertyValue(const nsCSSProperty aPropID, const nsAString& aValue) { - switch (aPropID) { - case eCSSProperty_background_position: - case eCSSProperty_transform: - case eCSSProperty_top: - case eCSSProperty_left: - case eCSSProperty_bottom: - case eCSSProperty_right: - case eCSSProperty_margin_top: - case eCSSProperty_margin_left: - case eCSSProperty_margin_bottom: - case eCSSProperty_margin_right: - mozilla::layers::ScrollLinkedEffectDetector::PositioningPropertyMutated(); - break; - default: - break; - } - if (aValue.IsEmpty()) { // If the new value of the property is an empty string we remove the // property. diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index da041667ac6..d860fe4937a 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -10086,13 +10086,6 @@ "releaseChannelCollection": "opt-out", "description": "Counts number of times a certain plugin has been activated." }, - "SCROLL_LINKED_EFFECT_FOUND": { - "alert_emails": ["kgupta@mozilla.com"], - "bug_numbers": [1229052], - "expires_in_version": "50", - "kind": "boolean", - "description": "Attempt to determine prevalence of scroll-linked effects on the web." - }, "WEB_NOTIFICATION_CLICKED": { "alert_emails": ["firefox-dev@mozilla.org"], "bug_numbers": [1225336],