Bug 1517895 - Only allow APZ to clobber the visual viewport offset if it can clobber the layout viewport offset. r=kats
authorBotond Ballo <botond@mozilla.com>
Wed, 13 Mar 2019 16:00:09 +0000
changeset 521799 056391cf2e01
parent 521798 aee83b1af5f1
child 521800 2382b92cba1e
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1517895
milestone67.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 1517895 - Only allow APZ to clobber the visual viewport offset if it can clobber the layout viewport offset. r=kats This gets frame-reconstruction-scroll-clamping.html passing again. Differential Revision: https://phabricator.services.mozilla.com/D20032
gfx/layers/apz/test/reftest/reftest.list
gfx/layers/apz/util/APZCCallbackHelper.cpp
--- a/gfx/layers/apz/test/reftest/reftest.list
+++ b/gfx/layers/apz/test/reftest/reftest.list
@@ -16,18 +16,17 @@ fuzzy-if(Android,0-45,0-27) skip-if(!And
 # Test scrollbars working properly with pinch-zooming, i.e. different document resolutions.
 # As above, the end of the scrollthumb won't match perfectly, but the bulk of the scrollbar should be present and identical.
 fuzzy-if(Android,0-54,0-14) skip-if(!Android) pref(apz.allow_zooming,true) == scrollbar-zoom-resolution-1.html scrollbar-zoom-resolution-1-ref.html
 fuzzy-if(Android,0-51,0-22) skip-if(!Android) pref(apz.allow_zooming,true) == scrollbar-zoom-resolution-2.html scrollbar-zoom-resolution-2-ref.html
 
 # Meta-viewport tag support
 skip-if(!Android) pref(apz.allow_zooming,true) == initial-scale-1.html initial-scale-1-ref.html
 
-# Bug 1520320 is tracking the effort to make this test pass again.
-skip-if(!asyncPan) random-if(Android) == frame-reconstruction-scroll-clamping.html frame-reconstruction-scroll-clamping-ref.html
+skip-if(!asyncPan) == frame-reconstruction-scroll-clamping.html frame-reconstruction-scroll-clamping-ref.html
 
 # Test that position:fixed and position:sticky elements are attached to the
 # layout viewport.
 #
 # We skip these tests on Desktop platforms since they require container
 # scrolling, which is enabled by default on Android, but behind a "Once" pref
 # and cannot be enabled for individual reftests.
 skip-if(!Android) pref(apz.allow_zooming,true) == pinch-zoom-position-fixed.html pinch-zoom-position-fixed-ref.html
--- a/gfx/layers/apz/util/APZCCallbackHelper.cpp
+++ b/gfx/layers/apz/util/APZCCallbackHelper.cpp
@@ -168,21 +168,23 @@ static ScreenMargin ScrollFrame(nsIConte
                                 const RepaintRequest& aRequest) {
   // Scroll the window to the desired spot
   nsIScrollableFrame* sf =
       nsLayoutUtils::FindScrollableFrameFor(aRequest.GetScrollId());
   if (sf) {
     sf->ResetScrollInfoIfGeneration(aRequest.GetScrollGeneration());
     sf->SetScrollableByAPZ(!aRequest.IsScrollInfoLayer());
     if (sf->IsRootScrollFrameOfDocument()) {
-      if (nsCOMPtr<nsIPresShell> shell = GetPresShell(aContent)) {
-        if (shell->SetVisualViewportOffset(
-                CSSPoint::ToAppUnits(aRequest.GetScrollOffset()),
-                shell->GetLayoutViewportOffset())) {
-          sf->MarkEverScrolled();
+      if (!APZCCallbackHelper::IsScrollInProgress(sf)) {
+        if (nsCOMPtr<nsIPresShell> shell = GetPresShell(aContent)) {
+          if (shell->SetVisualViewportOffset(
+                  CSSPoint::ToAppUnits(aRequest.GetScrollOffset()),
+                  shell->GetLayoutViewportOffset())) {
+            sf->MarkEverScrolled();
+          }
         }
       }
     }
   }
   bool scrollUpdated = false;
   ScreenMargin displayPortMargins = aRequest.GetDisplayPortMargins();
   CSSPoint apzScrollOffset = aRequest.GetScrollOffset();
   CSSPoint actualScrollOffset = ScrollFrameTo(sf, aRequest, scrollUpdated);