[whatwg] DOMTokenList methods would be more useful with a space separated token list
ojan at chromium.org
Fri Oct 28 14:11:26 PDT 2011
On Fri, Oct 28, 2011 at 2:03 PM, Glenn Maynard <glenn at zewt.org> wrote:
> On Fri, Oct 28, 2011 at 4:55 PM, Ojan Vafai <ojan at chromium.org> wrote:
>> I agree in general. Changing add/remove is definitely worth doing. In
>> case of toggle, WebKit already returns a boolean. Returning the
>> is clearly preferable IMO. It's a new enough API that maybe the web
>> yet depend on the return value of toggle?
> The return value of toggle() seems more useful than chaining.
> alert("now purple");
> alert("no longer purple");
> This is preferable to me over the following, because the token ("purple")
> doesn't have to be duplicated:
The counterargument is that it's possibly more confusing to have some of
these methods allow chaining and some return a boolean. It's not clear to me
which is better in this case. I don't feel strongly about it either way.
Leaving toggle alone would have the benefit of avoiding any web compat
More information about the whatwg