[whatwg] Allowing authors to obtain a vertical <input type=range>

Mounir Lamouri mounir at lamouri.fr
Thu Apr 4 05:02:38 PDT 2013


On 29/03/13 17:27, Ian Hickson wrote:
> On Tue, 26 Mar 2013, Jonathan Watt wrote:
>>
>> The result of the discussion here:
>>
>> http://www.w3.org/mid/514A17D4.3070806@jwatt.org
>>
>> is that I've changed Firefox Nightly's handling of <input type=range> to 
>> allow it to render as a vertical slider if it has an orient="vertical" 
>> attribute on it. There was only one reply to my email to www-style, but 
>> the author suggested using an attribute which I'd also concluded was the 
>> best thing to do.
>>
>> I'd like to propose that this attribute be added to the HTML5 
>> specification.
> 
> It seems like a very medium-specific attribute.
> 
> Why wouldn't this be a CSS issue? That's the layer of the Web platform 
> where we put presentationa-specific things.

I'm not a big fan of adding presentation-specific things to the markup
but I do not see another solution here. If we set the orientation in
CSS, we can't select elements based on their orientation because the
properties associated with the rule might change their orientation, thus
ending in an infinite loop. After talking with Boris Zbarsky and David
Baron, they said that could be prevented by hacks to actually not go in
such loop but they were not very happy about it.

For <progress> and <meter>, Mozilla decided to set the orientation based
on a CSS property and not allow users to select elements based on their
orientation. It seems like developers would like to select elements
based on their orientation and in that case, using the markup to set the
orientation seems to be the only solution.

> But in this particular case, why do we need authors to explicitly say 
> anything about the direction? Why can't you just be vertical if you're 
> tall, and horizontal if you're wide? I don't understand why anyone would 
> ever want a tall horizontal slider.

The fact that Webkit, Trident and Gecko are not doing that on purpose
should be a good sign that this is not a good idea. Even jQuery changed
its behaviour. You can easily imagine a square element that wants to be
represented horizontal or vertical or a wide element that wants a
vertical representation (the wideness coming from labels on tickmarks
for example). There is an example in this old email from Sylvain Galineau:
http://lists.w3.org/Archives/Public/www-style/2011Apr/0386.html

--
Mounir



More information about the whatwg mailing list