Bug 1527182 - With WR enabled, we can async scroll even inside SVG filters. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 27 Mar 2019 16:22:15 +0000
changeset 525222 c3931d5145ef8da1ba8d8bf4e27d3912994bb1b6
parent 525221 c1e32495cfa21fd094896d0c12201c06a33120a8
child 525223 cc4ed5c152c0db45084cdf0c692bb2398c9145bd
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1527182
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1527182 - With WR enabled, we can async scroll even inside SVG filters. r=botond Differential Revision: https://phabricator.services.mozilla.com/D24877
layout/xul/nsSliderFrame.cpp
--- a/layout/xul/nsSliderFrame.cpp
+++ b/layout/xul/nsSliderFrame.cpp
@@ -38,16 +38,17 @@
 #include "nsRefreshDriver.h"  // for nsAPostRefreshObserver
 #include "nsSVGIntegrationUtils.h"
 #include "mozilla/Assertions.h"  // for MOZ_ASSERT
 #include "mozilla/Preferences.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/dom/Event.h"
+#include "mozilla/gfx/gfxVars.h"
 #include "mozilla/layers/APZCCallbackHelper.h"
 #include "mozilla/layers/AsyncDragMetrics.h"
 #include "mozilla/layers/InputAPZContext.h"
 #include <algorithm>
 
 using namespace mozilla;
 using mozilla::dom::Event;
 using mozilla::layers::APZCCallbackHelper;
@@ -928,16 +929,21 @@ class AsyncScrollbarDragStarter final : 
 };
 
 static bool UsesSVGEffects(nsIFrame* aFrame) {
   return aFrame->StyleEffects()->HasFilters() ||
          nsSVGIntegrationUtils::UsingMaskOrClipPathForFrame(aFrame);
 }
 
 static bool ScrollFrameWillBuildScrollInfoLayer(nsIFrame* aScrollFrame) {
+  if (gfx::gfxVars::UseWebRender()) {
+    // If WebRender is enabled, even scrollframes enclosed in SVG effects can
+    // be drag-scrolled by APZ.
+    return false;
+  }
   nsIFrame* current = aScrollFrame;
   while (current) {
     if (UsesSVGEffects(current)) {
       return true;
     }
     current = nsLayoutUtils::GetParentOrPlaceholderForCrossDoc(current);
   }
   return false;