[csswg-drafts] [major-scroll-direction] Add the property to resolve the problem of inconvinent horizontal scrolling in vertical writing elements

Zhang-Junzhi has just created a new issue for https://github.com/w3c/csswg-drafts:

== [major-scroll-direction] Add the property to resolve the problem of inconvinent horizontal scrolling in vertical writing elements ==
## **Background**(You can read the proposal below by skipping it if you are only interested in the proposal part itself)

A year ago, David Baron [mentioned](https://bugzilla.mozilla.org/show_bug.cgi?id=1358017) that at a discussion in the CSS WG someone raised the issue that people are hesitant to use vertical writing-mode at the top level of the page(and I think all the horizontally scrollable contents also suffer, regardless of whether it's vertical writing and whether it's at the top level) as most of the users only have only direction wheel in their pointing device.

This is a realistic problem we are facing, more than ten years have passed since the first standardized [writing-mode](https://www.w3.org/TR/css-writing-modes-3/#block-flow) came out, but in practical it's still very hard for us to see ANY SINGLE website which uses vertical [writing-mode](https://www.w3.org/TR/css-writing-modes-3/#block-flow) at the its pages' top level. Why? I don't think we can conclude that people aren't interested in vertical writing pages(Think about it: there are about a quarter of the population in the world whose native languages are traditionally vertical writing), I think it's the incovinent horizontal scrolling UX in almost of all browsers which makes the reality.

Unfortunately there is difficulty to solve this kind of issue by browsers themselves without no any standard involving:

Earlier on, I implemented an experimental feature called auto-dir scrolling in Gecko, it's mostly used to horizontalize a vertical wheel scroll to a horizontal scroll when the hovering target only has a horizontal scrollbar but no vertical scrollbar. But the opinions on the feature turned out to vary from person to person, there are people favouring the feature, and there are also people finding it erratic. So, the solution overall doesn't seem to be any better. Part of the reason of the varied thoughts is personal preference, and the more important reason I think is that the necessities of convinent horizontal scrolling are different in different senarios: there are overflowed horizontal contents which are not important and don't need to be read carefully, and there are also overflowed horizontal contents which are very important to be read without which people are unable to comprehend the whole content. For example, the classcial former senario could be some Latin text with lots of lines, and just very few long lines of the text overflowed in the horizontal direction; the classcial latter senario could be some lengthy vertical writing CJK text, and several paragraphs are completely overflowed in the horizontal direction. So it's hard for browsers to distinguish complicated senarios, a standard needs to come out so that the responsibility can handed off to the web developers, so with code, developers would be able to tell the browser the important the convinent horizontal scrolling would be for an element.

----------------------------

## **Proposal**

Given the above background, I propose to add **`major-scroll-direction`** property in CSS.

The property has the following values:

`none`
`both`
`vertical`
`horizontal`
`auto`

The values have the following meanings:

**`none`**: No sepcial treatment for scroll input. This value typically indicates the traditional way just as we already have in all browsers. Take a mouse wheel for example, if the default action of the wheel event is a scroll event, then a vertical wheel is treated as a vertical scroll event, and a horizontal wheel is treated as a horizontal scroll event.

**`both`**: The user agent should always try its best to provide convenience for the scrolling in either direction. Take a mouse wheel for example, if the default action of the wheel event is a scroll event, and the element is only scrollable in one direction, this typically means treating any wheel scroll(no matter it's vertical or horizontal) as the scroll event in that direction. If the element is scrollable or unscrollable in both directions, the behaviour is the same as the value **`none`**. The auto-dir feature mentioned in the background is pretty much the implementation of this value.

**`vertical`**: The user agent should consider vertical scrolling more important to the element than the horizontal scrolling. Take a mouse wheel for example, if the default action of the wheel event is a scroll event, and the elment is vertically scrollable and horizontally unscrollable, this typically means treating any wheel scroll(no matter it's vertical or horizontal) as the scroll event in vertical direction.

**`horizontal`**: The user agent should consider horizontal scrolling more important to the element than the vertical scrolling. Take a mouse wheel for example, if the default action of the wheel event is a scroll event, and the elment is horizontally scrollable and vertically unscrollable, this typically means treating any wheel scroll(no matter it's vertical or horizontal) as the scroll event in horizontal direction.

**`auto`**: If the element is in vertical [writing mode](https://www.w3.org/TR/css-writing-modes-3/#block-flow)(I.e. `vertical-rl`, `vertical-lr`, `sideways-rl`, `sideways-lr`), it's computed to **`horizontal`**; if the element is in horizontal [writing mode](https://www.w3.org/TR/css-writing-modes-3/#block-flow)(I.e. `horizontal-tb`), it's computed to **`vertical`**.

**`major-scroll-direction`** is an inherited property, and its initial value is **`none`**.

----------------------------

I am expecting to hearing from your opinions on this proposal.

Thank you.


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2602 using your GitHub account

Received on Saturday, 21 April 2018 10:54:22 UTC