W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2019

Re: [csswg-drafts] scroll-policy: ease horizontal scrolling by wheel in vertical writing mode (#4380)

From: 張俊芝 via GitHub <sysbot+gh@w3.org>
Date: Tue, 08 Oct 2019 08:06:40 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-539400074-1570521999-sysbot+gh@w3.org>
> Is there a reason why we don't just make the property more explicit? e.g.
> ```
> scroll-policy : auto(default) | writing-mode
> auto: Current behavior
> writing-mode: Determine primary scroll axis based on writing mode
> ```

I have no issue replacing the keyword `auto` with `writing-mode` instead, but I prefer `auto`. one reason I used `auto` is because the keyword has already been used in the CSS, the other reason is that it just tells browsers to maximise easing the content scrolling, no matter in what way they like, everything is implicit(browser-dependent), even though CSS spec can explictly suggest browser to make vertical wheel scroll's default action as content's horizontal scrolling when vertical writing content only overflows in horizontal direction.

> Question: what happens to the values in the wheel event? Do the deltaX|Y get flipped or do we continue to report the delta in deltaY regardless of writing-mode?

Delta values won't be changed, only the default behaviour of the wheel event will be changed.

I think it makes sense to not change delta, all raw input from the user should be respected, so that script programmers are still able to receive intact input info from wheel. Remember that according to the HTML spec, a wheel event doesn't event necessarily lead to scroll event, the default action is implementation-defined, even though almost all browsers do the same(setting the default action of wheel scroll as content scroll).

> Is supporting multiple writing modes in sub-scrollers a common/important use case or could we just look at and use the documentElement's writing mode?

I would like to suggest the property be an inheritable property(as writing-mode is), and the effect is based on the current element, not based on the root element. Using multiple writing modes is not very necessary in most cases, let alone erratic multiple writing modes, If erratic multiple writing modes are applied on an page, then the the developer can simply avoid using `scroll-policy`(letting it be `none`), so it doesn't do any harm.

> > if an element is in vertical-rl mode, and overflows in only the horizontal direction,
> I'm unconvinced this should depend on the state of overflow. I think this could be somewhat unintuitive in some edge-cases.

If the developer uses the writing-mode property in the correct way(I.E. really for writing mode), then it's perfect. If the developer uses the writing-mode property in the wrong way(E.G. for layout), then it may be some erratic cases(some old code may make layout in this wrong way), so that's why this property is proposed, we do not make an one-size-fits-all approach, we should let the `scroll-policy` default to `none`, in order to keep the compatibility of the existing WEB world, but we also need to ease horizontal scrolling of further pages in vertical writing mode.

GitHub Notification of comment by Zhang-Junzhi
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4380#issuecomment-539400074 using your GitHub account
Received on Tuesday, 8 October 2019 08:06:41 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:54 UTC