-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify value direction for elements "progress" and "meter" with vertical writing mode #8413
Comments
The That said, HTML should indeed probably specify the native (and primitive) appearance of |
I'm curious to know why you think this is not good practice (especially given that Blink, Gecko, and WebKit browsers all currently apply the RTL directionality for the progress bar). Do you have information from RTL script users indicating a preference for it to be otherwise? (Btw, we shouldn't be referring to the CSS |
It looked like the OP was about changing the direction of progress/meter bars in absence of any internationalization need for it, just as a styling change. That's what I was objecting to. If that's not what was meant, my bad. |
Yes, for the scenario you describe the use of the direction property doesn't seem semantically correct, though if there really is a use case for changing the reading directions independently of the surrounding text, then perhaps that would point to the need for some other CSS property(?) The case for the vertical text is interesting. The links above point to questions i have asked of the experts in our various language fora. The query for the arabic script folks has a short thread already. I also put out feelers about the vertical text expectations to Chinese, Japanese, and Mongolian folks. |
I think the progress & meter should fill up in the inline flow direction for consistency with horizontal mode and how webpage flow works generally, so:
|
Same question applies to |
We have been getting feedback from the expert communities, as follows. There appears to be consensus that horizontally inline controls should grow in the reading direction – ie. left to right for english, right to left for arabic, hebrew, etc. w3c/hlreq#32 w3c/alreq#259 For vertical text we have an interesting situation: |
Since the Japanese folks ideally want the direction to be controllable by CSS, it probably makes sense to follow the inline direction, even if it makes the default less ideal? This way someone can just use I think a default direction of bottom to top isn't really ideal for vertical WM, even if flippable with |
This CL allows <input type=range> element to have writing-mode vertical for both the default native appearance and when appearance is set to none. This change is under multiple flags: * FormControlsVerticalWritingModeSupport: to enable vertical direction when CSS `writing-mode: vertical-rl` or `writing-mode: vertical-lr` is set. * FormControlsVerticalWritingModeDirectionSupport: to enable reading left-to-right as default. This feature is disabled by default as the spec isn't clear. [1] * RemoveNonStandardAppearanceValueSliderVertical: to deprecate using CSS `-webkit-appearance: slider-vertical` to enable vertical writing mode for <input type=range>. [1] whatwg/html#8413 Change-Id: I08ce156b5cad555080f4c9acb79bccfe010e8f47 Bug: 681917 Bug: 1432009 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4316949 Reviewed-by: Stefan Zager <szager@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: Di Zhang <dizhangg@chromium.org> Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com> Reviewed-by: Thomas Lukaszewicz <tluk@chromium.org> Cr-Commit-Position: refs/heads/main@{#1131472}
An update on the blink implementation (will ship soon): We are following what is suggested above by nt1m. |
The top-to-bottom on the input range in Firefox when using This is because Firefox also supports <input type="range" value="80" orient="vertical">
<input type="range" value="80" orient="vertical" style="writing-mode: vertical-lr">
<progress value="70" min="0" max="100" style="writing-mode: vertical-lr"> 70% </progress> @emilio Can you provide more information? |
orient=vertical "wins" somewhat intentionally afaict: https://bugzilla.mozilla.org/show_bug.cgi?id=1157142 @jfkthame can probably provide more context. |
ntim's proposal makes intuitive sense to me as an implementor, but I worry that it's a bit ergonomically awkward for authors... The proposal seems to force authors to use two different pieces of horizontal left/right terminology in order to get a vertical (bottom-to-top) meter/progress-bar. In particular, to get a vertical progress bar that fills from bottom-to-top (like a volume indicator, say): Both of these feel pretty weird because nothing about the control has a left/right relevancy. (With my implementor hat on, this all makes sense in terms of logical axes, just as ntim said. But I'm not sure authors have that same mental model or are going to intuitively understand the reasoning here.) Having said that, I'm not objecting; just wanted to be sure this author-facing rough edge has been considered. |
There's w3c/csswg-drafts#9832 that might make things more intuitive for authors, but I think until that's resolved, making the form controls follow the text flow makes sense to me. |
Currently, elements "progress" and "meter" don't have well defined behavior when they have the style
writing-mode: vertical-lr
orwriting-mode: vertical-rl
. For example, Firefox is the only vendor to support vertical writing-mode for these elements. Here is what a progress bar looks like:Question 1: Should the value part (blue color) of the element be rendered from top down (as reading is normally done from top to bottom) or should it be rendered bottom to top (so it looks like a glassware that gets filled up)?
Further, currently for the horizontal mode, we are able to change the direction of the progress bar from left-to-right to right-to-left.
However, there are no direction for ttb
top-to-bottom
or bttbottom-to-top
(not that I am aware of at least).Question 2:
Should there be a way to allow changing direction for the vertical writing modes?
Spec link:
https://html.spec.whatwg.org/#the-progress-element
https://html.spec.whatwg.org/#the-meter-element
https://drafts.csswg.org/css-writing-modes-4/#block-flow
https://drafts.csswg.org/css-writing-modes/#direction
(ps: was told that this question is better fit for whatwg/html instead of csswg w3c/csswg-drafts#7929)
The text was updated successfully, but these errors were encountered: