From dd188e11f24fdf0f62577cb5a45b7f82b37a6860 Mon Sep 17 00:00:00 2001 From: Csoregi Natalia Date: Thu, 23 Feb 2023 04:23:40 +0200 Subject: [PATCH] Backed out changeset 05981db2f726 (bug 1743045) for causing failures on test_group_scrollend.html. CLOSED TREE --- .../helper_programmatic_scroll_behavior.html | 81 --------------- gfx/layers/apz/test/mochitest/mochitest.ini | 99 +++++++++---------- ...st_group_programmatic_scroll_behavior.html | 38 ------- layout/base/PresShell.cpp | 15 +-- layout/generic/nsGfxScrollFrame.cpp | 9 -- layout/generic/nsGfxScrollFrame.h | 2 +- 6 files changed, 54 insertions(+), 190 deletions(-) delete mode 100644 gfx/layers/apz/test/mochitest/helper_programmatic_scroll_behavior.html delete mode 100644 gfx/layers/apz/test/mochitest/test_group_programmatic_scroll_behavior.html diff --git a/gfx/layers/apz/test/mochitest/helper_programmatic_scroll_behavior.html b/gfx/layers/apz/test/mochitest/helper_programmatic_scroll_behavior.html deleted file mode 100644 index 721ce7e53814..000000000000 --- a/gfx/layers/apz/test/mochitest/helper_programmatic_scroll_behavior.html +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - -
-
-
-
- - - diff --git a/gfx/layers/apz/test/mochitest/mochitest.ini b/gfx/layers/apz/test/mochitest/mochitest.ini index 611a2544ca36..e8ad67033031 100644 --- a/gfx/layers/apz/test/mochitest/mochitest.ini +++ b/gfx/layers/apz/test/mochitest/mochitest.ini @@ -8,6 +8,7 @@ helper_*.* tags = apz [test_abort_smooth_scroll_by_instant_scroll.html] +[test_group_scrollframe_activation.html] [test_bug1151667.html] skip-if = os == 'android' # wheel events not supported on mobile @@ -17,70 +18,38 @@ [test_bug1277814.html] skip-if = os == 'android' # wheel events not supported on mobile -[test_bug1304689-2.html] [test_bug1304689.html] +[test_bug1304689-2.html] [test_frame_reconstruction.html] -[test_group_bug1534549.html] -[test_group_checkerboarding.html] -[test_group_double_tap_zoom-2.html] - run-if = ((os == 'android') || (os == 'mac')) # FIXME: enable on more desktop platforms (see bug 1608506 comment 4) -[test_group_double_tap_zoom.html] - run-if = ((os == 'android') || (os == 'mac')) # FIXME: enable on more desktop platforms (see bug 1608506 comment 4) [test_group_fullscreen.html] run-if = (os == 'android') -[test_group_hittest-1.html] - skip-if = - toolkit == 'android' # mouse events not supported on mobile -[test_group_hittest-2.html] - skip-if = - toolkit == 'android' # mouse events not supported on mobile - os == 'win' # Bug 1776972 - os == 'linux' && !debug # stack is not large enough for the test, Bug 1776972 - apple_catalina && debug # Bug 1776972 -[test_group_hittest-overscroll.html] - skip-if = - toolkit == 'android' # mouse events not supported on mobile -[test_group_keyboard-2.html] -[test_group_keyboard.html] [test_group_mainthread.html] [test_group_minimum_scale_size.html] run-if = (os == 'android') [test_group_mouseevents.html] skip-if = toolkit == 'android' # mouse events not supported on mobile -[test_group_overrides.html] - skip-if = - toolkit == 'android' # wheel events not supported on mobile -[test_group_overscroll.html] - skip-if = - toolkit == 'android' # wheel events not supported on mobile -[test_group_overscroll_handoff.html] - skip-if = - toolkit == 'android' # wheel events not supported on mobile [test_group_pointerevents.html] skip-if = (os == 'win' && os_version == '10.0') # Bug 1404836 -[test_group_programmatic_scroll_behavior.html] -[test_group_scroll_linked_effect.html] - skip-if = (toolkit == 'android') # wheel events not supported on mobile -[test_group_scroll_snap.html] - skip-if = (os == 'android') # wheel events not supported on mobile -[test_group_scrollend.html] - skip-if = (toolkit == 'android') # wheel events not supported on mobile -[test_group_scrollframe_activation.html] +[test_group_touchevents.html] [test_group_touchevents-2.html] [test_group_touchevents-3.html] [test_group_touchevents-4.html] [test_group_touchevents-5.html] -[test_group_touchevents.html] [test_group_wheelevents.html] skip-if = (toolkit == 'android') # wheel events not supported on mobile -[test_group_zoom-2.html] - skip-if = (os == 'win') # see bug 1495580 for Windows [test_group_zoom.html] skip-if = os == 'win' # see bug 1495580 for Windows -[test_group_zoomToFocusedInput.html] +[test_group_zoom-2.html] + skip-if = (os == 'win') # see bug 1495580 for Windows +[test_group_double_tap_zoom.html] + run-if = ((os == 'android') || (os == 'mac')) # FIXME: enable on more desktop platforms (see bug 1608506 comment 4) +[test_group_double_tap_zoom-2.html] + run-if = ((os == 'android') || (os == 'mac')) # FIXME: enable on more desktop platforms (see bug 1608506 comment 4) [test_interrupted_reflow.html] +[test_group_keyboard.html] +[test_group_keyboard-2.html] [test_layerization.html] skip-if = os == 'android' # wheel events not supported on mobile @@ -94,14 +63,6 @@ skip-if = (os == 'android') # wheel events not supported on mobile [test_scroll_subframe_scrollbar.html] skip-if = (os == 'android') # wheel events not supported on mobile -[test_smoothness.html] - # hardware vsync only on win/mac - # Frame Uniformity recording is not implemented for webrender - skip-if = - debug - (os != 'mac' && os != 'win') - verify - true # Don't run in CI yet, see bug 1657477 [test_touch_listeners_impacting_wheel.html] skip-if = toolkit == 'android' # wheel events not supported on mobile @@ -112,3 +73,41 @@ [test_wheel_transactions.html] skip-if = toolkit == 'android' # wheel events not supported on mobile +[test_group_overrides.html] + skip-if = + toolkit == 'android' # wheel events not supported on mobile +[test_group_overscroll.html] + skip-if = + toolkit == 'android' # wheel events not supported on mobile +[test_group_overscroll_handoff.html] + skip-if = + toolkit == 'android' # wheel events not supported on mobile +[test_group_hittest-1.html] + skip-if = + toolkit == 'android' # mouse events not supported on mobile +[test_group_hittest-2.html] + skip-if = + toolkit == 'android' # mouse events not supported on mobile + os == 'win' # Bug 1776972 + os == 'linux' && !debug # stack is not large enough for the test, Bug 1776972 + apple_catalina && debug # Bug 1776972 +[test_group_hittest-overscroll.html] + skip-if = + toolkit == 'android' # mouse events not supported on mobile +[test_group_zoomToFocusedInput.html] +[test_group_scroll_snap.html] + skip-if = (os == 'android') # wheel events not supported on mobile +[test_group_checkerboarding.html] +[test_smoothness.html] + # hardware vsync only on win/mac + # Frame Uniformity recording is not implemented for webrender + skip-if = + debug + (os != 'mac' && os != 'win') + verify + true # Don't run in CI yet, see bug 1657477 +[test_group_bug1534549.html] +[test_group_scroll_linked_effect.html] + skip-if = (toolkit == 'android') # wheel events not supported on mobile +[test_group_scrollend.html] + skip-if = (toolkit == 'android') # wheel events not supported on mobile diff --git a/gfx/layers/apz/test/mochitest/test_group_programmatic_scroll_behavior.html b/gfx/layers/apz/test/mochitest/test_group_programmatic_scroll_behavior.html deleted file mode 100644 index 13bdb4efc41f..000000000000 --- a/gfx/layers/apz/test/mochitest/test_group_programmatic_scroll_behavior.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Various programmatic scroll tests that spawn in new windows - - - - - - - - - diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 4b16430f9d71..7a9d4e326207 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -3517,17 +3517,10 @@ static void ScrollToShowRect(nsIScrollableFrame* aFrameAsScrollable, } ScrollMode scrollMode = ScrollMode::Instant; - // Default to an instant scroll, but if the scroll behavior given is "auto" - // or "smooth", use that as the specified behavior. If the user has disabled - // smooth scrolls, a given mode of "auto" or "smooth" should not result in - // a smooth scroll. - ScrollBehavior behavior = ScrollBehavior::Instant; - if (aScrollFlags & ScrollFlags::ScrollSmooth) { - behavior = ScrollBehavior::Smooth; - } else if (aScrollFlags & ScrollFlags::ScrollSmoothAuto) { - behavior = ScrollBehavior::Auto; - } - bool smoothScroll = aFrameAsScrollable->IsSmoothScroll(behavior); + bool autoBehaviorIsSmooth = aFrameAsScrollable->IsSmoothScroll(); + bool smoothScroll = + (aScrollFlags & ScrollFlags::ScrollSmooth) || + ((aScrollFlags & ScrollFlags::ScrollSmoothAuto) && autoBehaviorIsSmooth); if (smoothScroll) { scrollMode = ScrollMode::SmoothMsd; } diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index cebbf2d5649f..0dc66470b0bd 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -2341,7 +2341,6 @@ void ScrollFrameHelper::AsyncScroll::InitSmoothScroll( mAnimationPhysics->Update(aTime, aDestination, aCurrentVelocity); } -/* static */ bool ScrollFrameHelper::IsSmoothScrollingEnabled() { return StaticPrefs::general_smoothScroll(); } @@ -8430,14 +8429,6 @@ bool ScrollFrameHelper::SmoothScrollVisual( } bool ScrollFrameHelper::IsSmoothScroll(dom::ScrollBehavior aBehavior) const { - // The user smooth scrolling preference should be honored for any requested - // smooth scrolls. A requested smooth scroll when smooth scrolling is - // disabled should be equivalent to an instant scroll. - if (aBehavior == dom::ScrollBehavior::Instant || - !ScrollFrameHelper::IsSmoothScrollingEnabled()) { - return false; - } - if (aBehavior == dom::ScrollBehavior::Smooth) { return true; } diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index c23ea490b806..153625f9afaf 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -150,7 +150,7 @@ class ScrollFrameHelper : public nsIReflowCallback { void PostScrolledAreaEvent(); MOZ_CAN_RUN_SCRIPT void FireScrolledAreaEvent(); - static bool IsSmoothScrollingEnabled(); + bool IsSmoothScrollingEnabled(); /** * @note This method might destroy the frame, pres shell and other objects.