mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1692708 - Add scrollTo and scrollTop test cases in helper_relative_scroll_smoothness.html. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D129595
This commit is contained in:
parent
b11e8dcd33
commit
7243be3f7a
@ -45,7 +45,20 @@ window.addEventListener("scroll", () => {
|
||||
document.documentElement.style.backgroundPosition = `0px ${offset}px`;
|
||||
document.body.style.height = `${initialBodyHeight + offset}px`;
|
||||
|
||||
window.scrollBy(0, 10);
|
||||
switch (searchParams.get("scroll-method")) {
|
||||
case "scrollBy":
|
||||
window.scrollBy(0, 10);
|
||||
break;
|
||||
case "scrollTop":
|
||||
document.scrollingElement.scrollTop += 10;
|
||||
break;
|
||||
case "scrollTo":
|
||||
window.scrollTo(0, window.scrollY + 10);
|
||||
break;
|
||||
default:
|
||||
ok(false, "Unsupported scroll method: " + searchParams.get("scroll-method"));
|
||||
break;
|
||||
}
|
||||
|
||||
// Simulate some jank.
|
||||
var freezeDurationInMilliseconds = 100;
|
||||
|
@ -26,8 +26,14 @@ var subtests = [
|
||||
{"file": "helper_key_scroll.html", prefs: [["apz.test.logging_enabled", true],
|
||||
["test.events.async.enabled", true]]},
|
||||
{"file": "helper_bug1674935.html", prefs: []},
|
||||
{"file": "helper_relative_scroll_smoothness.html?input-type=key", prefs: smoothness_prefs },
|
||||
{"file": "helper_relative_scroll_smoothness.html?input-type=native-key", prefs: smoothness_prefs },
|
||||
{"file": "helper_relative_scroll_smoothness.html?input-type=key&scroll-method=scrollBy",
|
||||
prefs: smoothness_prefs },
|
||||
{"file": "helper_relative_scroll_smoothness.html?input-type=native-key&scroll-method=scrollBy",
|
||||
prefs: smoothness_prefs },
|
||||
{"file": "helper_relative_scroll_smoothness.html?input-type=native-key&scroll-method=scrollTo",
|
||||
prefs: smoothness_prefs },
|
||||
{"file": "helper_relative_scroll_smoothness.html?input-type=native-key&scroll-method=scrollTop",
|
||||
prefs: smoothness_prefs }
|
||||
];
|
||||
|
||||
if (isKeyApzEnabled()) {
|
||||
|
@ -55,7 +55,9 @@ var subtests = [
|
||||
{"file": "helper_scroll_tables_perspective.html", "prefs": prefs},
|
||||
{"file": "helper_wheelevents_handoff_on_iframe.html", "prefs": prefs},
|
||||
{"file": "helper_wheelevents_handoff_on_non_scrollable_iframe.html", "prefs": prefs},
|
||||
{"file": "helper_relative_scroll_smoothness.html?input-type=wheel", prefs: smoothness_prefs },
|
||||
{"file": "helper_relative_scroll_smoothness.html?input-type=wheel&scroll-method=scrollBy", prefs: smoothness_prefs },
|
||||
{"file": "helper_relative_scroll_smoothness.html?input-type=wheel&scroll-method=scrollTo", prefs: smoothness_prefs },
|
||||
{"file": "helper_relative_scroll_smoothness.html?input-type=wheel&scroll-method=scrollTop", prefs: smoothness_prefs },
|
||||
];
|
||||
|
||||
// Only Windows has the test api implemented for this test.
|
||||
|
Loading…
Reference in New Issue
Block a user