W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2005

[whatwg] Re: getElementsByClassName

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 5 Sep 2005 23:59:01 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0509052355440.25386@dhalsim.dreamhost.com>
On Tue, 6 Sep 2005, Lachlan Hunt wrote:
> > 
> > I envisage somehow making className implement the DOMTokenString 
> > interface:
> > 
> >    http://whatwg.org/specs/web-apps/current-work/#domtokenstring
> > 
> > ...so that you would have Element.className.add(), 
> > Element.className.has(), etc.
> 
> Cool, I'll see what I can do about implementing that.  I think I may be 
> able to extend the String() object quite easily for that, though I'll 
> have to think about it a little more.

Let me know how that goes. That interface hasn't really been looked at 
much yet.


> > What if an element is in the class "foo bar"?
> 
> So, you're saying that it's possible that some hypothetical langauge may 
> define a class attribute with any character as the delimiter, not just 
> white space?  So, for example, a language could use semi-colons like 
> this: foo:class="foo bar;baz" and thus, for that language, gEBCN("foo 
> bar") would match that?

Yeah. Theoretically. It's not exactly likely, but...


> In which case, would it be worth adding a note to the spec stating that 
> implementations should not assume that all languages will use white 
> space delimiters between class names?

Well, it's highly theoretical. It seems such a note might be more 
confusing than helpful. What do you think?

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 5 September 2005 16:59:01 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:24 UTC