W3C home > Mailing lists > Public > www-svg@w3.org > May 2012

Re: classList should perhaps move from HTMLElement to Element

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 2 May 2012 22:09:09 +0000 (UTC)
To: Boris Zbarsky <bzbarsky@MIT.EDU>, Chris Lilley <chris@w3.org>, Cameron McCormack <cam@mcc.id.au>, Anne van Kesteren <annevk@opera.com>, Jonas Sicking <jonas@sicking.cc>, "Tab Atkins Jr." <jackalmage@gmail.com>
cc: whatwg <whatwg@lists.whatwg.org>, www-svg <www-svg@w3.org>
Message-ID: <Pine.LNX.4.64.1205022158160.1631@ps20323.dreamhostps.com>
On Fri, 19 Nov 2010, Boris Zbarsky wrote:
>
> Given that SVG also has classes, it would make some sense to move 
> classList from HTMLElement to Element.  That way SVG, and any other 
> languages that define classes (XUL comes to mind, actually) can benefit 
> from it as well.
> 
> Note that Gecko's current classList implementation lives on Element.

How do you handle the difference between SVG and HTML's className? I think 
it would be confusing to have classList work the same on both but not 
className.

(Currently, DOM Core and HTML both define classList; the former on Element 
and the latter on HTMLElement, because Anne and I disagree on what should 
happen here.)

For the spec's purposes my plan is to follow whatever implementations 
converge on. Currently WebKit does what the HTML/SVG specs say (.className 
is a string in HTML, an object in SVG, and .classList is HTML-specific), 
Gecko does a mixture of DOM Core and HTML/SVG say (.className is a string 
in HTML, an object in SVG, and .classList is on both but returns null in 
unknown namespaces), and Opera does a different mixture (.className is a 
string in HTML, an object in SVG, and .classList is on SVG and HTML nodes 
but not on nodes from unknown namespaces). (Didn't have other browsers 
available to test on this machine.)

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 2 May 2012 22:09:41 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:51 GMT