Contact emails:
ara...@microsoft.com, gerc...@microsoft.com
Summary:
This feature changes mouse and keyboard-initiated scrolls to be interpreted as a percentage of the size of the intended scroller, instead of being translated directly into pixels as they are in Chromium today.
Motivation:
As it stands today, when the scroller viewport is only a few hundred pixels tall, each scroll tick will scroll the viewport by a large fraction of the visible content. This is often annoying, as it is more difficult to read or keep track of the material being scrolled. By instead translating each tick into a percentage of the visible bounds, the scroll distance for each tick is appropriate regardless of the size of the scroller.
Intent-to-implement:
https://groups.google.com/a/chromium.org/g/blink-dev/c/U3kH6_98BuY/m/uiaeS3D2AwAJ
Design doc:
https://docs.google.com/document/d/1LqxCR9xxy962B3Rl1MRmeWTUsMVgY4CtmZSm5plSLwk/edit?usp=sharing
Will it be supported on all platforms?
Windows and Linux yes. Mac no. Reason: Mousewheel ticks on Mac don’t animate yet. We’ll revisit this once smooth scrolling for mousewheels on Mac gets enabled.
Demo:
Thanks,
Rahul
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CH2PR00MB081277C3919B63862E9B9998A6AC9%40CH2PR00MB0812.namprd00.prod.outlook.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAMGbLiEuzh2xxJBWz4aCaOXSiVBWGCM410jeEB0yNc9usAaU0A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAAjAU%3DaOj2J6sQUqZSz-Mu3sfrQnRzUqovFJCo0K%2Bv8U1%3Dj77g%40mail.gmail.com.
>> It looks like the deltaY in the wheel event is unmodified
@Robert Flack: Just making sure we’re on the same page here. When I tested using a Surface mouse on Windows 10, I saw event.deltaY being reported differently. One tick of the mousewheel reported 150 when the feature was off (i.e the current state) and 100 when it was turned on. Test page: https://jsfiddle.net/cg7vp46n/show
(This corresponds to what I see on Google Maps as well. With the feature off, one mousewheel tick zooms slightly more compared to if the feature was on).
PS: Can someone please update the Chrome status as well? I don’t think I have the privileges to do that. Matt, Daniel and Clay are no longer working on scrolling. Please add Me, Olga, Sam and Ben as the owners.
Thanks,
Rahul
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJh39TMFK2KexKaue_NZUaTkZS97prszeFHvKnA1JiVjgu%3DVWA%40mail.gmail.com.
Thanks for testing that and confirming the new behavior, Rahul! It makes sense for deltaY to report the actual size of the scroll increment.Rob, do you mean that it's important that deltaY keeps returning the same values as before, because sites might have hardcoded them? Using a different deltaMode and reporting percentage values by default seems riskier still, since naive code would interpret it as 5 pixels. Is there a way we can estimate the risk of breakage related to this?It seems to me that perfectly preserving the behavior of non-scrolling wheel handlers is only possible if we keep reporting the same deltaY and deltaMode and add something new entirely with the true information. That's an option, but one I think we should take only if there's no other way to navigate the web compat problem here.
P.S. I see that the chromestatus.com entry was updated by someone, but I also poked https://github.com/GoogleChrome/chromium-dashboard/issues/1144 about requesting edit access.On Fri, Jan 15, 2021 at 9:29 AM Rahul Arakeri <ara...@microsoft.com> wrote:>> It looks like the deltaY in the wheel event is unmodified
@Robert Flack: Just making sure we’re on the same page here. When I tested using a Surface mouse on Windows 10, I saw event.deltaY being reported differently. One tick of the mousewheel reported 150 when the feature was off (i.e the current state) and 100 when it was turned on. Test page: https://jsfiddle.net/cg7vp46n/show
(This corresponds to what I see on Google Maps as well. With the feature off, one mousewheel tick zooms slightly more compared to if the feature was on).
>> I'm not sure if this is justification to not modify the deltaY (since it already does not match the scroll amount) or to expose a raw deltaY.
Rob, just making sure I understand this correctly. Are you suggesting that deltaY should also be a function of the scroller length for percent based scrolling? (i.e, when using DOM_DELTA_PIXEL, should scrollTop == deltaY).
I came across something in the spec that says “the value MUST be the measurement along the y-axis (in pixels, lines, or pages)” but doesn’t give a definitive answer for the relationship between the amount scrolled and deltaY.
Misc:
Just summarizing how deltaY is currently represented per tick on Windows:
|
When the OS scroll setting is “Multiple lines at a time” |
When the OS scroll setting is “One screen at a time” |
Chrome |
DOM_DELTA_PIXEL (i.e 33.3 * 3 lines) |
DOM_DELTA_PAGE |
Edge |
DOM_DELTA_PIXEL (i.e 33.3 * 3 lines) |
DOM_DELTA_PAGE |
Firefox |
DOM_DELTA_LINE (i.e 3) |
DOM_DELTA_PAGE |
--
To unsubscribe from this group and stop receiving emails from it, send an email to input-dev+...@chromium.org.
>> I'm confused why using percentage based scrolling should change wheel event deltaY from its prior values if the value it changes it to is neither the amount scrolled nor proportional to the amount scrolled. Changing the deltaY arbitrarily has the potential to break existing sites.
I recently found out some additional information about this that may help to clarify things. It looks like event deltaY is affected by DSF currently (when the feature is off). For eg, on my Surface Laptop, I get event deltaY of 150 per mouse tick at scale 150% and event deltaY of 100 per mouse tick at scale 100%. This apparently is an old bug. With “Percent based scrolling” turned on, event deltaY is not affected by DSF i.e I get event deltaY of 100 (at 150% and 100%) and amount scrolled depends on the scroller length. (See the “Risks” section from Matt’s i2i for more info). I debugged this a bit more and found that this piece of code is responsible for scaling. Also, bokan@ had previously recommended modifying the spec to allow scrolling an amount that is different than what's reported in the wheel event. WDYT?
>> My preference would be that the delta reported is simply how much the wheel has scrolled such that sites using this for zoom are unaffected.
I assume you’re talking about the wheel event delta?. For eg: A Surface mouse tick wheel event delta should be 100 (even though the scrollTop is dependent on the scroller length). Did I understand this correctly? If yes, the feature already does that. If I’ve misunderstood, please give me an example to better understand.
>> Will parallax scrolling effects behave nicely with this change?
Microsoft Edge stable has had this feature enabled by default for a while now and we haven’t heard any negative feedback around parallax. Visually it looks just fine. If there’s a numerical way to determine that, please let me know.
Please let me know if anything is unclear. I’ll be happy to discuss further.
Thanks,
Rahul
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABc02_K2T53Z77gFH4B8AV2g-Sz5rDW4HxTn9UbQZPg1Gjweng%40mail.gmail.com.
When surveying Edge Legacy users on scrolling distance, we found a preference for Edge Legacy’s (percent based) scrolling behavior 75% of the time. Additionally, when this functionality has been broken occasionally in Edge’s Canary builds, users were quick to file negative feedback on it which is an indication that they notice it. Also, since we're proposing to leave the event delta value as-is, this change wouldn't regress any existing sites that use deltaX/Y (and event delta is inconsistent across different DSF anyway). Having said that, we do realize that this largely comes down to user preference as PhistucK@ points out. So please let us know what kind of data would be useful in moving this discussion ahead. We'd be happy to try get that 😊
I played with Edge a bit in the last few weeks and I find its scroll pace uncomfortable, to be honest, but maybe I am a vocal minority.
My preference would be that the delta reported is simply how much the wheel has scrolled such that sites using this for zoom are unaffected.
I played with Edge a bit in the last few weeks and I find its scroll pace uncomfortable, to be honest, but maybe I am a vocal minority.As a counterpoint, I had the opposite experience; Edge felt more snappy and responsive to me. Whether that's percent-based scrolling or the other "personality"-related work like impulse animations I don't know. That said, blink-dev@ is probably best suited to debate the web-compat/interop impact and not the best place to evaluate the UI trade-offs. What's the most appropriate way to get UX owners to weigh in?My preference would be that the delta reported is simply how much the wheel has scrolled such that sites using this for zoom are unaffected.I'd +1 this - it means we wouldn't have a compat effect on existing custom wheel event handlers so the risk should be low. That is, the amount of deltaY reported in a wheel event should be unchanged from what is currently reported. I think this technically violates the spec text if we scroll by a different number of pixels but it looks like that already happens commonly (e.g. when using HighDPI device or Ctrl+/- zooming) so maybe just updating the spec would be sufficient?However, I do have one observation: percent-based scrolling doesn't cause the scroller size to affect the deltaY reported in the wheel event but (at least on Linux) it changes the deltaY from 53 to 100 (according to Rob's demo). Is this intentional? As Rob mentions, it'd be good for this not to affect the reported delta.
Hi David/Rob,
Based on my conversation on Slack today with Rob, I’ve prepared a changelist that makes event delta remain unchanged from what is reported currently. This is the current state of things:
So in Rob’s test page, when the feature is turned ON, “Cumulative deltaY” will have the same value as it did when the feature was off and “Cumulative scroll” will be dependent on the scroller length. Please let me know if you have any questions 😊
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJh39TNzxKHYC85nti4CaA-x%3DYT3_%3Dg2R9yA17RzyvSqXM95rw%40mail.gmail.com.
Hi Philip,
By “eventual scroll distance”, I assume you meant the “Cumulative scroll” in this test page?
If my assumption is correct then yes you’re right, once the feature is enabled, the eventual scroll distance will almost never match the accumulated deltaY. Given that deltaY (as of today) already doesn’t match the scroll distance (at DSF > 1), I think it does indeed make sense to update the spec and say “event delta should be interpreted as a signed constant”. I’d be happy to do that if we can get consensus on this thread about it.
Thanks,
Rahul
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CH2PR00MB0812D101907DE764955C6778A6B69%40CH2PR00MB0812.namprd00.prod.outlook.com.
This is just me thinking out loud, but does it make sense for the delta values to be determined by scroller size?
tl;dr I think the spec change should set delta values to be a unit-less passthrough from the platform event itself rather than set either by scroll distance calculation or a fixed value based on platform. It would remove the confusion about how that value relates to scroll distance and the numbers would be relatively close to what they are now for backwards compatibility.
Here are some things to consider:
Perhaps the updated language of the spec should change the units that the deltas are measured in. Instead of pixels, the value is unit-less and is a passthrough of the event parameter from the platform and a new constant exposed to contain the platform value for “one increment”. Here’s how that might look on Windows:
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/c5a2de59-64c1-4420-860e-5f3a25e37de5n%40chromium.org.
Hi Mike,
Apologies for the late response. I got sidetracked with another project. By “web-facing” I assume you meant to ask if this feature would affect websites that rely on DOM properties like scrollTop? If I’ve understood your question correctly, yes, this feature does indeed affect such websites since scrollTop (and the visual scroll distance) would be based on the scroller length once the feature is turned ON. For sites like Google Maps which I believe use the scrollwheel event.deltaY to zoom in/out, there would be no difference since event delta would be unaffected.
This feature is currently behind a flag named “Percent based scrolling” which should be available via about:flags so please feel free to try it out on this test page. Please let me know if I’ve misunderstood anything.
Thanks,
Rahul
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2BN6QZs66dOURmSaxpFrtv1twxf9ZN0twhCm5uNpUvzwBKKycQ%40mail.gmail.com.
LGTM3
/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAL5BFfVa_go0b7LmYSLr87vLb1MeO12%2BLSFUVqBHCho0%3Dgymeg%40mail.gmail.com.