On Wed, 2 May 2012, Rick Waldron wrote:
On Wed, May 2, 2012 at 7:17 PM, Ian Hickson i...@hixie.ch wrote:
On Wed, 2 May 2012, Rick Waldron wrote:
JS APIs like this should always return the object (constructed
instance or not) and therefore chain implicitly.
Let me rephrase, I simply
Sidetracking whether chaining is a useful API design or not isn't useful.
Choosing some mechanism to add multiple classes at once is useful, whether
that's making add have an arbitary arity, allow it to take an array, allow
it to take a space seperated string or allowing add calls to be chained.
On Fri, 28 Oct 2011, David H�s�ther wrote:
It would be more useful if the DOMTokenList methods (contains, add,
remove, toggle) would take a space separated list of tokens. This is the
behavior most DOM libraries have when dealing with class names.
So, when setting two classes, instead of
On Wed, May 2, 2012 at 6:13 PM, Ian Hickson i...@hixie.ch wrote:
On Fri, 28 Oct 2011, David Håsäther wrote:
It would be more useful if the DOMTokenList methods (contains, add,
remove, toggle) would take a space separated list of tokens. This is the
behavior most DOM libraries have when
On Wed, 2 May 2012, Rick Waldron wrote:
On Wed, May 2, 2012 at 6:13 PM, Ian Hickson i...@hixie.ch wrote:
On Fri, 28 Oct 2011, David H�s�ther wrote:
It would be more useful if the DOMTokenList methods (contains, add,
remove, toggle) would take a space separated list of tokens. This is
On Wed, 02 May 2012 15:41:07 -0700, Ian Hickson i...@hixie.ch wrote:
On Wed, 2 May 2012, Rick Waldron wrote:
Adding 1 class at a time is a _very_ common pattern in real world web
development.
As mentioned above, this API has now moved to DOM Core. If you still want
this I recommend filing a
On Wednesday, May 2, 2012 at 6:41 PM, Ian Hickson wrote:
On Wed, 2 May 2012, Rick Waldron wrote:
On Wed, May 2, 2012 at 6:13 PM, Ian Hickson i...@hixie.ch wrote:
On Fri, 28 Oct 2011, David Håsäther wrote:
It would be more useful if the DOMTokenList methods (contains, add,
On Wed, 2 May 2012, Rick Waldron wrote:
JS APIs like this should always return the object (constructed instance
or not) and therefore chain implicitly.
I understand that this is mostly a matter of taste in API design, but IMHO
that's an anti-pattern. It encourages poor style; it discourages
On Wed, May 2, 2012 at 7:17 PM, Ian Hickson i...@hixie.ch wrote:
On Wed, 2 May 2012, Rick Waldron wrote:
JS APIs like this should always return the object (constructed instance
or not) and therefore chain implicitly.
Let me rephrase, I simply expect modern DOM APIs to return something
It would be more useful if the DOMTokenList methods (contains, add,
remove, toggle) would take a space separated list of tokens. This is
the behavior most DOM libraries have when dealing with class names.
So, when setting two classes, instead of
ele.classList.add(hey);
ele.classList.add(ho);
On Fri, 28 Oct 2011 12:58:01 +0200, David Håsäther hasat...@gmail.com
wrote:
It would be more useful if the DOMTokenList methods (contains, add,
remove, toggle) would take a space separated list of tokens. This is
the behavior most DOM libraries have when dealing with class names.
So, when
On Fri, Oct 28, 2011 at 11:52 AM, Philip Jägenstedt phil...@opera.comwrote:
On Fri, 28 Oct 2011 12:58:01 +0200, David Håsäther hasat...@gmail.com
wrote:
It would be more useful if the DOMTokenList methods (contains, add,
remove, toggle) would take a space separated list of tokens. This is
On Fri, Oct 28, 2011 at 12:07 PM, Mike Taylor
michaelaarontay...@gmail.com wrote:
I would prefer if it returned the DOMTokenList, to enable chaining like:
foo.toggle('bar baz').remove('bat');
Same for the rest of the DOMTokenList methods, as well.
foo.add('bar').remove('baz');
See
On Fri, Oct 28, 2011 at 9:42 AM, Aryeh Gregor a...@aryeh.name wrote:
On Fri, Oct 28, 2011 at 12:07 PM, Mike Taylor
michaelaarontay...@gmail.com wrote:
I would prefer if it returned the DOMTokenList, to enable chaining like:
foo.toggle('bar baz').remove('bat');
Same for the rest of the
On Fri, Oct 28, 2011 at 1:23 PM, Jonas Sicking jo...@sicking.cc wrote:
On Fri, Oct 28, 2011 at 9:42 AM, Aryeh Gregor a...@aryeh.name wrote:
On Fri, Oct 28, 2011 at 12:07 PM, Mike Taylor
michaelaarontay...@gmail.com wrote:
I would prefer if it returned the DOMTokenList, to enable chaining
On Fri, Oct 28, 2011 at 1:55 PM, Ojan Vafai o...@chromium.org wrote:
I agree in general. Changing add/remove is definitely worth doing. In the
case of toggle, WebKit already returns a boolean. Returning the DOMTokenList
is clearly preferable IMO. It's a new enough API that maybe the web doesn't
On Fri, Oct 28, 2011 at 2:03 PM, Glenn Maynard gl...@zewt.org wrote:
On Fri, Oct 28, 2011 at 4:55 PM, Ojan Vafai o...@chromium.org wrote:
I agree in general. Changing add/remove is definitely worth doing. In
the
case of toggle, WebKit already returns a boolean. Returning the
DOMTokenList
On Fri, Oct 28, 2011 at 4:55 PM, Ojan Vafai o...@chromium.org wrote:
I agree in general. Changing add/remove is definitely worth doing. In the
case of toggle, WebKit already returns a boolean. Returning the
DOMTokenList
is clearly preferable IMO. It's a new enough API that maybe the web
On 10/28/11 4:55 PM, Ojan Vafai wrote:
I agree in general. Changing add/remove is definitely worth doing. In the
case of toggle, WebKit already returns a boolean
Gecko likewise.
-Boris
19 matches
Mail list logo