W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2013

Re: [whatwg] OUTPUT tag: clarify purpose in spec?

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Thu, 26 Sep 2013 23:00:16 +0300
Message-ID: <52449250.9080609@cs.tut.fi>
To: whatwg@lists.whatwg.org
2013-09-26 21:41, Ian Hickson wrote:

> There's a lot of <output> examples in the spec; do they help at all?

There are indeed several examples, but they are scattered around; the 
section that specifically deals with the <output> element, 4.10.15, has 
only one example.

It is a simple calculator that shows the calculated result in an 
<output> element. And it is a form with no action attribute and with 
onsubmit="return false", so it is clearly meant to work in the browser 
only. That is, the value of the output element is not submitted.

The question then arises why <output> is used, instead of just showing 
the result in a <span> or <div> element as usual. In fact, none of the 
examples about <output> have no apparent association with any submission 
to server-side processing.

Yet, the from the properties defined for <output>, whole point seems to 
be that the <output> element has a special purpose: it is a control, 
with a value that may be included in form data upon submission, but its 
value is not meant to be changed by the user directly, only via actions 
that may indirectly modify it. Simultaneously, it is normally visible to 
the user.

As I see it, the difference between <output> and a readonly <input> is 
that the latter is not meant to be changed by the user *at all*, whereas 
<output> is not be changed *directly*.

If this interpretation is correct, I think some of it should be somehow 
expressed in the spec, and there should be at least one example where 
<output> is seemingly participating in form data submission.

It's of course too late to change the name "output" now, but it is 
really misleading, since it suggests that the element is just for output 
(possibly even suggesting that it's really a duplicate of <samp>!). Yet 
it seems that it primarily computed data (in a broad sense for 
"computed") to be submitted, though it can, like <input>, be used 
without submission too. So <computed> or <input type=computed> might 
have been better. I mention this because this name problem emphasizes 
the need for explaining what the element is really for.

I still don't quite see *why* <output> has been introduced. I can 
understand it as a purely logical creation, but what is the practical 
gain expected to be?

Yucca
Received on Thursday, 26 September 2013 20:00:47 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 17:00:09 UTC