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

Olli Pettay Olli.Pettay at helsinki.fi
Thu Apr 8 07:07:39 PDT 2010


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



More information about the whatwg mailing list