Backed out changeset 05981db2f726 (bug 1743045) for causing failures on test_group_scrollend.html. CLOSED TREE

This commit is contained in:
Csoregi Natalia 2023-02-23 04:23:40 +02:00
Родитель 2a13a1e8b3
Коммит dd188e11f2
6 изменённых файлов: 54 добавлений и 190 удалений

Просмотреть файл

@ -1,81 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="apz_test_utils.js"></script>
<script src="apz_test_native_event_utils.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script src="/tests/SimpleTest/paint_listener.js"></script>
<style>
html, body { margin: 0; }
#big {
height: 250vh;
width: 100%;
}
#target {
height: 500px;
width: 100%;
background: red;
}
</style>
</head>
<body>
<div id="big">
</div>
<div id="target">
</div>
</body>
<script>
const searchParams = new URLSearchParams(location.search);
async function test() {
// Count the number of scroll events that occur. Instant scrolls should only
// trigger one scroll event, so a scroll event count of 1 indicates that a
// instant scroll was conducted.
let scrollCount = 0;
window.addEventListener("scroll", (e) => {
scrollCount += 1;
});
let scrollendPromise = promiseScrollend();
// Call the given programmatic scroll with behavior: smooth.
switch (searchParams.get("action")) {
case "scrollIntoView":
target.scrollIntoView({behavior: "smooth"});
break;
case "scrollBy":
document.scrollingElement.scrollBy({top: 500, behavior: "smooth"});
break;
case "scrollTo":
document.scrollingElement.scrollTo({top: 500, behavior: "smooth"});
break;
case "scroll":
document.scrollingElement.scroll({top: 500, behavior: "smooth"});
break;
default:
ok(false, "Unsupported action: " + searchParams.get("action"));
break;
}
await scrollendPromise;
// If general.smoothScroll is set, the behavior of the scroll should be
// "smooth". If general.smoothScroll is disabled, we should respect it and
// the scrolls should instant regardless of the specified behavior.
if (SpecialPowers.getBoolPref("general.smoothScroll")) {
info("final enabled scroll count: " + scrollCount);
ok(scrollCount > 1, "The programmatic scroll should create more than one scroll event");
} else {
info("final disabled scroll count: " + scrollCount);
ok(scrollCount == 1, "The programmatic scroll should be instant with one scroll event");
}
}
waitUntilApzStable()
.then(test)
.then(subtestDone, subtestFailed);
</script>
</html>

Просмотреть файл

@ -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

Просмотреть файл

@ -1,38 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Various programmatic scroll tests that spawn in new windows</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript" src="apz_test_utils.js"></script>
<script type="application/javascript" src="apz_test_native_event_utils.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript">
let smoothScrollEnabled = [["general.smoothScroll", true]];
let smoothScrollDisabled = [["general.smoothScroll", false]];
var subtests = [
{"file": "helper_programmatic_scroll_behavior.html?action=scrollIntoView", "prefs": smoothScrollEnabled},
{"file": "helper_programmatic_scroll_behavior.html?action=scrollIntoView", "prefs": smoothScrollDisabled},
{"file": "helper_programmatic_scroll_behavior.html?action=scrollBy", "prefs": smoothScrollEnabled},
{"file": "helper_programmatic_scroll_behavior.html?action=scrollBy", "prefs": smoothScrollDisabled},
{"file": "helper_programmatic_scroll_behavior.html?action=scrollTo", "prefs": smoothScrollEnabled},
{"file": "helper_programmatic_scroll_behavior.html?action=scrollTo", "prefs": smoothScrollDisabled},
{"file": "helper_programmatic_scroll_behavior.html?action=scroll", "prefs": smoothScrollEnabled},
{"file": "helper_programmatic_scroll_behavior.html?action=scroll", "prefs": smoothScrollDisabled},
];
if (isApzEnabled()) {
SimpleTest.waitForExplicitFinish();
window.onload = function() {
runSubtestsSeriallyInFreshWindows(subtests)
.then(SimpleTest.finish, SimpleTest.finishWithFailure);
};
}
</script>
</head>
<body>
</body>
</html>

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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.