[whatwg] OUTPUT tag: clarify purpose in spec?

Jukka K. Korpela jkorpela at cs.tut.fi
Thu Sep 26 13:00:16 PDT 2013


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




More information about the whatwg mailing list