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

On 26/03/2013 14:55, Simon Pieters wrote:
> On Tue, 26 Mar 2013 15:07:55 +0100, Jonathan Watt <jwatt@jwatt.org> 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.
>
> I don't have strong opinions on this topic, however, if we are going to
> add an attribute, it would be less verbose to use a boolean attribute:
>
>      <input type=range vertical>

My original approach for supporting vertical range was to have Mozilla's 
-moz-orient CSS property apply to <input type=range>, but the initial value of 
this property was 'horizontal'. That prevented the auto-orientation hinted at in 
the HTML5 spec (and implemented by Opera) where the orientation of the range is 
based on the width-to-height ratio of the input, unless explicitly specified by 
the author. To fix that I added an 'auto' value for -moz-orient and made that 
the initial value. Then I realized that authors will want to style the component 
parts of a range differently based on whether it is vertical or horizontal, 
which is incompatible with using a CSS property to specify the orientation. 
That's how I arrived at using an attribute, and it's to leave open the future 
possibility of auto-orientation that I made a direct conversion to an 'orient' 
attribute rather than a 'vertical' attribute.

Jonathan

Received on Tuesday, 26 March 2013 15:06:28 UTC