Re: [whatwg] Typed numeric 'input'

Jukka K. Korpela <jkorpela@cs.tut.fi>:
> 2014-08-04 20:06, Christoph Päper wrote:
> 
>> Imagine a text layout GUI made with HTML.
>> It would probably feature a font size selection control.
>> There are different ways to do such a thing:
> 
> There are, and they are preferred in different ways by different people, as programmers or as end users. This is why any solution, in addition to introducing considerable complexity into HTML, would be used for a small fraction of potential use cases only.

You do realize that font size control was just an example? A combined widget for number and unit would be useful in many places. Although most of us use metric units exclusively for almost all applications, there are still a lot of scenarios where two or more units are commonly used – even with the SI some may prefer centimetres over millimetres sometimes (or vice versa). Not to mention US localisation.

> An addition to the ways mentioned, the font size control could be simply two buttons, one for increasing and one for decreasing the size, (…)

This seems like a special cased ‘numeric’ or ‘range’ widget and is agnostic of units.

> The designer needs to decide the internal representation of the font size and to map the alternatives in the UI to that. I don’t see how additions to HTML would significantly help here, even if they happened to match the approach that is selected by the designer.

The point is that some such approaches are possible already, but not all. The simple possible solutions are rather clumsy and not very user-friendly.

Every author could, of course, just parse all free user input from a ‘text’ input server-side, but why shouldn’t browsers sanitize such input like they do for other form controls?

Received on Tuesday, 5 August 2014 07:15:10 UTC