[whatwg] LABEL and radio/checkbox onclick

Matthew Thomas mpt at myrealbox.com
Sun Jul 18 16:19:37 PDT 2004

On 19 Jul, 2004, at 9:49 AM, Matthew Raymond wrote:
> Matthew Thomas wrote:
> ...
>> The W3C is frequently wrong about UI details. Here, for example, 
>> firstly they failed to recognize that in native applications on any 
>> platform, clicking the label for a listbox (aka <select multiple>) or 
>> text field will not focus the field.
>    Are you suggesting we change HTML spec behavior here? If so, can 
> you explain why this specific behavior is undesirable beyond the fact 
> that it's not a standard Mac behavior?

Read what I said. I did not say the specced behavior was faulty just on 
the Mac platform. I said the specced behavior was wrong "on any 
platform". Therefore, given that the What-WG is interested in making 
Web applications more like native applications, it would be a good idea 
for the WG to correct this error in the spec.

> ...
>    Web pages are a special GUI case where behavior needs to be as 
> consistent as possible across all platforms.

That is incorrect. The principle of device independence "does not say 
that the user experience will be the same on every device" 
<http://www.w3.org/TR/di-princ/#DIP-1>. On the contrary, the WAI User 
Agent Accessibility Guidelines say that user agents should "[o]bserve 
operating environment conventions for the user agent user interface, 
documentation, input configurations, and installation" 

For example, one of the browser vendors whose staff are contributing to 
this working group (Opera) specializes in producing browsers for mobile 
phones. It would be inappropriate for forms to behave exactly the same 
on mobile phones as they do on desktop computers, since the latter are 
likely to have much more convenient pointing devices.

> Web authors need to know that the way their page behaves on their own 
> platform is going to be the the same on all other platforms.

It's far too late for that. For example, since the beginning of the 
Web, almost all graphical browsers have allowed people to turn off 
images. As another example, Internet Explorer and Netscape 4 do not add 
the value of any particular submit button to a GET URI if the Enter key 
is pressed, but Opera and Gecko browsers arbitrarily choose the first 
submit button in the form.

> If you start changing the rules for each platform, it only encourages 
> webmasters to target specific platforms like Windows. (BTW, although 
> I'd love to have a Mac, I am not in possession of one, so can someone 
> let me know if any Mac OS X browsers don't follow HTML spec behavior 
> for label focus.)

One of the browser vendors whose staff are contributing to this working 
group (Apple) produces a browser (Safari) that, in its latest release 
version, does support <label> at all.

> ...
>    Besides, this kind of workaround is pretty silly just to avoid 
> focus on controls when a label is clicked.

That's why I said: "having to do that to work around a bug in the spec 
would be pretty annoying".

> Was there some other behavior you wanted to happen when they click the 
> label?
> ...

Yes: nothing at all. Users frequently click on (what they assume to be) 
non-functional parts of a GUI or a Web page as a form of doodling, 
while they're reading or thinking of what to write. Such clicks 
unexpectedly changing focus could produce undesirable results. For 
example, clicking on the label for a single-line text field (which 
would be non-functional if it was a native app) shortly before typing 
Enter would accidentally submit the form.

Matthew Thomas

More information about the whatwg mailing list