Re: [csswg-drafts] Setting the primary scrolling direction for a scroll container (#10060)

The CSS Working Group just discussed `Setting the primary scrolling direction for a scroll container`, and agreed to the following:

* `RESOLVED: A scrolling device with a primary direction should scroll the root scroller in the block flow axis of the principal writing mode`

<details><summary>The full IRC log of that discussion</summary>
&lt;emeyer> fantasai: There's an issue about vertical-text document means your primary scroll direction is horizontal and that's not hooked to the scroll wheel<br>
&lt;emeyer> …So deves are having to capture elements and code around that<br>
&lt;emeyer> …The obvious thing to me is if your principal writing mode is horizontal, then if you have a 1D scrolling device it should scroll in that direction<br>
&lt;emeyer> …Do others agree? Should we clarify?<br>
&lt;flackr> q+<br>
&lt;emeyer> astearns: Is the person who raised it asking for a switch?<br>
&lt;emeyer> fantasai: Yes, but I think it would be better to change the default and then we can add a switch if one is needed<br>
&lt;astearns> ack flackr<br>
&lt;iank_> q+<br>
&lt;emeyer> flackr: I was going to ask if we know the cases where we have a 1-axis device?<br>
&lt;emeyer> …I think it would be bad to change a touchpad where it's easy to scroll both horizontally and vertically<br>
&lt;emeyer> …I'm worried that we'll get into cases where we do this on devices where it doesn't make sense to do this<br>
&lt;astearns> there are mice with 2d scroll wheels, too<br>
&lt;bramus> Plugging in a regular mouse with a scrollwheel on macos has this 1-axis limitation<br>
&lt;emeyer> …Alternate idea: if your primary physical axis is not scrollable, we change it to a logical axis<br>
&lt;emeyer> fantasai: I think that will work in some cases but not others<br>
&lt;emeyer> …I run into sites that scroll both directions, but one direction only a little bit<br>
&lt;emeyer> …It would be awkward if when you resize the window, the scroll wheel starts or stops working<br>
&lt;dbaron> https://bugzilla.mozilla.org/show_bug.cgi?id=1358017#c0<br>
&lt;astearns> ack dbaron<br>
&lt;TabAtkins> I think this needs to only apply to 1-d scroll affordances<br>
&lt;emeyer> dbaron: If you dig through the comments, there's a link to a Bugzilla issue that this started with a meeting we had with JP publishers in 2017<br>
&lt;TabAtkins> q+<br>
&lt;emeyer> …They said they were reluctant to publish with vertical text because mouse scroll wheels weren't working as expected<br>
&lt;emeyer> …I agree with Rob that we need to be careful about assuming what an implementation knows<br>
&lt;emeyer> …The fact that you have vertical scroll events doesn't tell you if a user can handle horiztonal scrolls<br>
&lt;emeyer> …We should avoid an implementation that assumes you know that<br>
&lt;emeyer> flackr: I wonder if we should fix this in the OS<br>
&lt;emeyer> fantasai: At some point the browser has to be involved because the OS doesn<br>
&lt;florian> q+<br>
&lt;emeyer> s/doesn/doesn't know the scroll direction/<br>
&lt;florian> q-<br>
&lt;emeyer> flackr: Yeah, if it's a 1D scroll wheel<br>
&lt;fantasai> s/scroll direction/writing mode/<br>
&lt;astearns> ack iank_<br>
&lt;emeyer> iank_: Alison, did Edge have an -ms-scroll property at one point?<br>
&lt;emeyer> alisonmaher: Not familiar, can look into it<br>
&lt;astearns> ack TabAtkins<br>
&lt;emeyer> TabAtkins: This ties into David's points: in terms of events we get, we can tell if something is a scroll wheel, right?<br>
&lt;fantasai> s/can/can't/<br>
&lt;emeyer> …But if you have a 2D scroll wheel, we can't tell that<br>
&lt;emeyer> flackr: I think touchpads get sent at scroll events with distance in each direction<br>
&lt;emeyer> …There is a difference between precise and non-precise scrolls and that's usually where the differentiation happens<br>
&lt;iank_> https://learn.microsoft.com/en-us/previous-versions/hh973361(v=vs.85)<br>
&lt;emeyer> TabAtkins: This does annoy me; if there's a reasonable expectation in the common scroll wheel case, even if we can't quite tell when a wheel is 2D, we should spend config space on this as we do for asking users which way they want their 1D wheels to move<br>
&lt;kizu> q+<br>
&lt;astearns> ack kizu<br>
&lt;emeyer> …With vertical text, if we get imprecise events, we should stick with block direction<br>
&lt;emeyer> kizu: I can imagine a case where we reach the default axis, we want to switch<br>
&lt;emeyer> q+<br>
&lt;emeyer> …With a switch property, you could switch directions<br>
&lt;emeyer> …mid-page<br>
&lt;astearns> ack fantasai<br>
&lt;Zakim> fantasai, you wanted to reply<br>
&lt;emeyer> fantasai: I don't think that would make sense<br>
&lt;emeyer> …Say you load a page with an image slightly too wide, do you expect to scroll over in the image and then scroll down in the whitespace after that?<br>
&lt;emeyer> kizu: [missed[<br>
&lt;kbabbitt> re: -ms-scroll-* events mentioned by iank_ - those were related to scroll snap points / touch overscroll features<br>
&lt;emeyer> fantasai: We know the main axis, but we might not know whether we have a scroll wheel that works in two different axes<br>
&lt;bramus> Sidenote: You can (ab)use scroll-driven animations for the behavior kizu wants: https://scroll-driven-animations.style/demos/horizontal-section/css/<br>
&lt;emeyer> …If you have a 2D wheel, use it, but if you have a 1D wheel, then that's the one that should go in the main direction of the document<br>
&lt;flackr> q+<br>
&lt;astearns> ack emeyer<br>
&lt;iank_> kbabbitt: what about the "-ms-scroll-translation" property?<br>
&lt;fantasai> emeyer: Literally today, I visited this page<br>
&lt;emeyer> https://www.propublica.org/article/microsoft-solarwinds-golden-saml-data-breach-russian-hackers<br>
&lt;khush> q+<br>
&lt;fantasai> emeyer: you get partly down the page and then there's a horizontal bit that scrolls<br>
&lt;TabAtkins> kbabbitt, I think we should standardize that *as well*, separately from this conversation.<br>
&lt;fantasai> emeyer: this is exactly this use case, scrolling down the main axis<br>
&lt;fantasai> emeyer: and it switched directions<br>
&lt;fantasai> emeyer: I had no problem understanding what was happening<br>
&lt;fantasai> emeyer: This is a thing that's done, would be nice ot address via CSS rather than using JS<br>
&lt;TabAtkins> that way `scroll-translation` can be used by a page *on purpose* to do the thing Eric is talking about<br>
&lt;bramus> https://scroll-driven-animations.style/demos/horizontal-section/css/<br>
&lt;fantasai> bramus: do that with scroll-driven animations<br>
&lt;florian> q+<br>
&lt;kbabbitt> iank_, oh I missed that one - would need to dig into it<br>
&lt;fantasai> bramus: it's a hack...<br>
&lt;astearns> ack flackr<br>
&lt;emeyer> flackr: Scrolling the primary axis and then the secondary axis does not give you access to everything<br>
&lt;florian> q-<br>
&lt;emeyer> …This isn't a universal solution<br>
&lt;emeyer> …We do offer a shift key modifier<br>
&lt;emeyer> …We could look at the writing mode of a scroller to change direction for subscrollers, but I'm not a fan of the mode-switching<br>
&lt;TabAtkins> q+<br>
&lt;astearns> ack khush<br>
&lt;bramus> +1<br>
&lt;bramus> q+<br>
&lt;emeyer> khush: Was going to ask if there's any reason this would be l;imited to the root scroller instead of it changing when you're focused on a subscroller<br>
&lt;emeyer> …Using writing mode seems an intuitive solution, but examples show you might want to switch based on writing mode<br>
&lt;emeyer> s/based on/based on things other than/<br>
&lt;fserb> welcome back :)<br>
&lt;emeyer> fantasai: That's what I would want, but can't find where I did<br>
&lt;emeyer> …I started with the writing mode of the principal document, since that seemed to make sense<br>
&lt;astearns> ack TabAtkins<br>
&lt;fserb> pasting the pre-split comments:<br>
&lt;fserb> fantasai: I can't find where I wrote the thing that the viewport should be based on principal writing mode of document, and the scroller should be based on the writing mode of the scroller<br>
&lt;fserb> …If you can only scroll in one axis, then you attach to the scrollable axis<br>
&lt;fserb> done.<br>
&lt;fantasai> s/in one axis/in one axis due to overflow-x vs overflow-y /<br>
&lt;emeyer> TabAtkins: Kevin mentioned some ms- prefixed things about scroll wheel events turn into vertical or horizontal scroll<br>
&lt;emeyer> …We could scope the automatic one to the root document based on the writing mode<br>
&lt;TabAtkins> -ms-scroll-translation<br>
&lt;emeyer> iank_: It would be interesting to know how -ms-scroll-translation actually behaved<br>
&lt;florian> q+<br>
&lt;fantasai>       /me q?<br>
&lt;astearns> ack bramus<br>
&lt;emeyer> kbabbitt: Will need to research<br>
&lt;fantasai> s|       /me q?||<br>
&lt;emeyer> bramus: I liked what Elika suggested to attach to the scrollable axis<br>
&lt;florian> q-<br>
&lt;emeyer> …Seems like a good idea<br>
&lt;iank_> kbabbitt: specifically would be curious what got plumbed through from the OS to handle that case.<br>
&lt;flackr> q+<br>
&lt;bramus> s/to attach to the/to eventually attach to the<br>
&lt;emeyer> astearns: Are we arriving at yes, we want to see if we can detect scrolling and attach to the main document?<br>
&lt;TabAtkins> (sorry, scribe is not on a mic so i couldn't hear him asking for an interrupt)<br>
&lt;emeyer> dholbert: What if you have two mice and one is 1D and one is 2D?<br>
&lt;emeyer> …And both are connected, and both are giving scroll events?<br>
&lt;emeyer> TabAtkins: I don't think we can tell that even if you're only using one mouse at a time, so we'd have to treat as: the 2D mouse scrolled vertically would give you horizontally<br>
&lt;emeyer> flackr: This is going to me common because every laptop user has a touchpad and many have a mouse attached<br>
&lt;florian> q+<br>
&lt;astearns> ack flackr<br>
&lt;emeyer> TabAtkins: If you're doing something physical, it's terrible to make that change direction<br>
&lt;astearns> ack florian<br>
&lt;emeyer> flackr: Responding to Elika's 1D scroll suggestion, there's a risk of scrolling down a long vertical page, landing on a horizontal scroll without knowing, and preventing further vertical scroll<br>
&lt;bramus> Good remark.<br>
&lt;emeyer> florian: Didn't catch this was concluded, but if we are facing horizontal scroller, presumably it's not really flipping, you scroll as possible<br>
&lt;khush> q+<br>
&lt;emeyer> …What I mean is, the H scrolwheel of a mouse should always get you H scrolling even if you remap it<br>
&lt;astearns> ack khush<br>
&lt;emeyer> khush: Rob has a good point that if you try to do this automatically, you can start mapping scroll behavior by mistake<br>
&lt;emeyer> …IN the ProPublica case linked, the author does want you to do that, and it's why a switch might be a good thing here<br>
&lt;TabAtkins> That's why I was suggesting the default only apply to the root scroller, fwiw<br>
&lt;emeyer> …Letting the author having a say in that is good<br>
&lt;emeyer> flackr: I think flipping a 1D is uncontentious<br>
&lt;astearns> ack dbaron<br>
&lt;emeyer> astearns: For more, we probably need a proeprty<br>
&lt;emeyer> dbaron: Worried we're getting too far into specifying UI instead of web tech<br>
&lt;emeyer> …Or at least, speccing how UAs handle particular input devices<br>
&lt;emeyer> …I'm not sure how much of this discussion is specificable<br>
&lt;emeyer> TabAtkins: We have a lot of stuff about how to handle scrolling on a page, like scroll snapping<br>
&lt;emeyer> …I feel like this is in the same wheelhouse<br>
&lt;emeyer> dbaron: I think distinguishing between precise and wheel scroll might be an interesting idea but I don't think it can go in CSS<br>
&lt;emeyer> fantasai: I think it would need to be more abstract<br>
&lt;astearns> ack fantasai<br>
&lt;emeyer> TabAtkins: Agreed, though with a note describing how to tell devices apart<br>
&lt;flackr> +1<br>
&lt;emeyer> fantasai: +1 to Tab in IRC, it's why I raised this in the first place<br>
&lt;emeyer> …With small blocks, there is a concern<br>
&lt;emeyer> …If the author put a vertical carousel in there, it would be a problem to deal with<br>
&lt;emeyer> …We should explore, but we'll need to add advice to scroll in the document's primary direction<br>
&lt;emeyer> …As to a separate property, if we can avoid making people use it most of the time, that would be better<br>
&lt;emeyer> …Hopefully it wouldn't be necessary most of the time<br>
&lt;emeyer> astearns: Can you summarize a resolution just for the primary writing direction?<br>
&lt;flackr> suggestion? The UA should map known 1D scroll events to the document's writing mode block direction<br>
&lt;fantasai> PROPOSED: A scrolling device with a primary direction should scrol the root scroller in the block flow axis of the principal writing mod.<br>
&lt;fantasai> s/mod/mode/<br>
&lt;fantasai> s/scrol/scroll/<br>
&lt;emeyer> astearns: Any objections?<br>
&lt;fantasai> s/primary direction/primary axis/<br>
&lt;emeyer> khush: Should we add the clarification about precise and imprecise scroll?<br>
&lt;emeyer> flackr: No<br>
&lt;emeyer> fantasai: No, that needs to be left up to implementation<br>
&lt;flackr> having a "primary direction" is intentionally vague about how you tell that<br>
&lt;emeyer> …We can give direction, but need to leave it up to UAs<br>
&lt;emeyer> RESOLVED: A scrolling device with a primary direction should scroll the root scroller in the block flow axis of the principal writing mode<br>
&lt;dbaron> bramus: non-root scrollers still an open issue?<br>
&lt;dbaron> ?: yes<br>
&lt;bramus> s/?: yes/fantasai and astearns: yes<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10060#issuecomment-2165994109 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 13 June 2024 15:22:34 UTC