W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2010

[whatwg] Why [PutForwards=value] for htmlFor output element attribute ?

From: Olli Pettay <Olli.Pettay@helsinki.fi>
Date: Thu, 08 Apr 2010 17:07:39 +0300
Message-ID: <4BBDE32B.7010107@helsinki.fi>
On 4/5/10 3:21 PM, Mounir Lamouri wrote:
> Hi,
>
> I'm wondering why the [PutForwards=value] extended attribute is needed
> for the htmlFor output element attribute ?
> It is making things pretty ugly for a need I do not really get.
>
> Thanks,
> --
> Mounir
>

I agree. In general PutForwards makes APIs strange, IMO
Location is a good example of a pretty awkward API.
In the case of output element,
element.htmlFor.value = "Something" isn't really
more difficult than element.htmlFor = "something";

Though, .htmlFor accept setting a string value in other
interfacase, but in those cases the type of the attribute
is DOMString.
It is a bit ugly that one .htmlFor is DOMSettableTokenList,
but other .htmlFors are DOMStrings

Would be at least great to know some good reasoning for
using PutForwards.

Btw why doesn't .classList have PutForwards
(in which case it could use DOMSettableTokenList)


-Olli
Received on Thursday, 8 April 2010 07:07:39 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:22 UTC