[whatwg] Re: getElementsByClassName

Ian Hickson ian at hixie.ch
Mon Sep 5 16:59:01 PDT 2005

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.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list