You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
css-scroll-snap allows creating popular UX paradigms for paged or itemized content, and is essential for taking advantage of the browser's accelerated scrolling mechanisms and not having to reimplement fling physics to make these experiences as smooth and seamless as possible.
Existing tests which demonstrate RTL issues or significant feature deltas
Tests to be written
Arrow keys should smooth scroll to next snap target
Mouse wheel click should immediately scroll to next target
When snap area is larger than viewport it should snap to nearest edge (currently jumps to initial snap position), see related csswg issue.
Rationale
Major UX experiences (e.g. carousels, paginated content, etc) are enabled by this feature but lack of polish prevents widespread use. While we tackled and greatly improved the interop in 2021, there are still a few significant gaps. The 2021 scroll survey confirms carousels are important but not yet easy to manage.
The existing tests here might be a bit misleading, because a lot of issues are fixed in upstream WebKit already. You can see the delta is a bit smaller if you add the experimental version of WebKitGTK to the list of browsers.
A proposed list of tests has been labeled with interop-2022-scrolling. It would be great if someone from each browser engine team can look over this list and comment if there are any issues.
Looks like we're missing css/css-scroll-snap/input/mouse-wheel.html which is one of the newly added tests. Note that in adding these tests we discovered some issues with the test driver event injection, see crbug.com/1285411
A bunch of scrolling tests came up in my analysis in #48. It spans this issue and #21, but I'll past the whole comment since the root cause seems shared across the two in one case:
There are 3 tests that use new test_driver.Actions().scroll(...) and either ERROR or TIMEOUT in Firefox/Safari:
/css/css-scroll-snap/input/keyboard.html is TIMEOUT in Firefox and Safari, but the first test runs and fails in Firefox. I don't think this is due to a missing testdriver.js API, but it needs investigation.
Started looking at the tests involving new test_driver.Actions().scroll(...) . Wheel scrolls do not appear to be supported in test_driver on Firefox or Safari.
This minified test is triggering an ERROR instead of a Fail on Firefox (don't have a Mac for testing on Safari). Thus, I don't believe that a test.step will address the harness error. Having said that, overscroll-behavior.html is mixing test.step with promise chains and would likely benefit from being changed to a series of promise tests: one for each of the 4 conditions being tested.
Started looking at the tests involving new test_driver.Actions().scroll(...) . Wheel scrolls do not appear to be supported in test_driver on Firefox or Safari.
Keyboard.html is Timing out if not seeing the expected scroll in response to a keypress. Since the first test works, it would suggest that Firefox supports test_driver.send_keys(). If 'arrowup' in the second test is replaced with 'pageup' then we reach the desired snap point. If waitForScrollEnd(target_position) is replaced with waitForAnimationEnd(get_position_callback) then we see that the page doesn't switch snap points in response to arrow up. Though waitForAnimationEnd would change a Timeout to a Fail, it was the disadvantage of being potentially flaky since it depends on waiting for nothing to happen for a number of animation frames to infer that scrolling has stopped. Ultimately waitForScrollEnd results in faster test execution when everything is scrolling properly since we don't have the extra rAF wait time.
/css/cssom-view/scroll-behavior-smooth.html seems to be passing everywhere. Perhaps the linked bugs are stale. Perhaps the test was written before the feature was fully supported across browsers.
Keyboard.html is Timing out if not seeing the expected scroll in response to a keypress. Since the first test works, it would suggest that Firefox supports test_driver.send_keys(). If 'arrowup' in the second test is replaced with 'pageup' then we reach the desired snap point.
There are a couple more issues with this particular test as well:
Thanks for digging into the failures, @kevers-google and @mrobinson! For the tests that error instead of fail, does someone have the time to try fixing those to properly fail instead?
Activity
mrobinson commentedon Nov 12, 2021
The existing tests here might be a bit misleading, because a lot of issues are fixed in upstream WebKit already. You can see the delta is a bit smaller if you add the experimental version of WebKitGTK to the list of browsers.
flackr commentedon Nov 25, 2021
@kevers-google is adding the extra few tests.
foolip commentedon Jan 10, 2022
A proposed list of tests has been labeled with
interop-2022-scrolling. It would be great if someone from each browser engine team can look over this list and comment if there are any issues.flackr commentedon Jan 18, 2022
Looks like we're missing css/css-scroll-snap/input/mouse-wheel.html which is one of the newly added tests. Note that in adding these tests we discovered some issues with the test driver event injection, see crbug.com/1285411
foolip commentedon Jan 20, 2022
A bunch of scrolling tests came up in my analysis in #48. It spans this issue and #21, but I'll past the whole comment since the root cause seems shared across the two in one case:
flackr commentedon Mar 3, 2022
@kevers-google, could you look into some of these failures?
kevers-google commentedon Mar 3, 2022
Will do
kevers-google commentedon Mar 14, 2022
Started looking at the tests involving new test_driver.Actions().scroll(...) . Wheel scrolls do not appear to be supported in test_driver on Firefox or Safari.
Based on https://web-platform-tests.org/writing-tests/testdriver.html#test_driver.action_sequence, Actions.send() should reject the
promise if any of the actions fail, so the following example should pass or fail based on whether a wheel scroll was successfully dispatched:
promise_test(t => {
return new test_driver.Actions().scroll(200, 500, 0, -200).send();
}, 'Simple test');
This minified test is triggering an ERROR instead of a Fail on Firefox (don't have a Mac for testing on Safari). Thus, I don't believe that a test.step will address the harness error. Having said that, overscroll-behavior.html is mixing test.step with promise chains and would likely benefit from being changed to a series of promise tests: one for each of the 4 conditions being tested.
Will review the other tests shortly.
karlcow commentedon Mar 14, 2022
For Firefox, there's a in-progress patch from @jgraham
https://phabricator.services.mozilla.com/D139123
kevers-google commentedon Mar 15, 2022
Keyboard.html is Timing out if not seeing the expected scroll in response to a keypress. Since the first test works, it would suggest that Firefox supports test_driver.send_keys(). If 'arrowup' in the second test is replaced with 'pageup' then we reach the desired snap point. If waitForScrollEnd(target_position) is replaced with waitForAnimationEnd(get_position_callback) then we see that the page doesn't switch snap points in response to arrow up. Though waitForAnimationEnd would change a Timeout to a Fail, it was the disadvantage of being potentially flaky since it depends on waiting for nothing to happen for a number of animation frames to infer that scrolling has stopped. Ultimately waitForScrollEnd results in faster test execution when everything is scrolling properly since we don't have the extra rAF wait time.
kevers-google commentedon Mar 15, 2022
/css/cssom-view/scroll-behavior-smooth.html seems to be passing everywhere. Perhaps the linked bugs are stale. Perhaps the test was written before the feature was fully supported across browsers.
mrobinson commentedon Mar 15, 2022
There are a couple more issues with this particular test as well:
It assumes that a non-focusable element can receive keys, but I don't think this follows the WebDriver specification. From https://www.w3.org/TR/webdriver/#element-send-keys:
I have a fix for this here: WebKit export of https://bugs.webkit.org/show_bug.cgi?id=237589 wpt#33151
It assumes that scrolls will use smooth scrolling. This isn't currently the case with WebKit on Mac, so this test fails even with the fix above.
foolip commentedon Mar 18, 2022
Thanks for digging into the failures, @kevers-google and @mrobinson! For the tests that error instead of fail, does someone have the time to try fixing those to properly fail instead?