[whatwg] Re: getElementsByClassName

Brad Neuberg bradneuberg at yahoo.com
Mon Sep 5 22:08:18 PDT 2005



--- Dean Edwards <dean at edwards.name> wrote:

> Ian Hickson wrote:
> > On Tue, 6 Sep 2005, Dean Edwards wrote:
> > 
> >>>>It would be better to define that class names
> should not contain 
> >>>>white space.
> >>>
> >>>Well, we can't really control that, I mean, other
> languages can invent 
> >>>whatever they want (and frequently do).
> >>
> >>I thought we were controlling that. Isn't that
> what we are doing?
> > 
> > 
> > We're defining what "class" means for HTML(5), and
> what the behaviour of 
> > getElemetsByClassName() in the DOM should be. But
> if someone invents 
> > FooBarML that has classes with spaces in it, CSS
> will match them (for 
> > example, ".a\ b"), and I don't see why
> getElementsByClassName should not 
> > be capable of matching them given that it falls
> simply out of the current 
> > definition.
> > 
> > However, this is all highly theoretical.
> > 
> 
> That's right. We are defining HTML5 and the DOM
> extensions to support 
> it. If other languages want to add different class
> name delimiters, let 
> them. My hunch is that they will follow suit. This
> is a good opportunity 
> to make it clear. HTML has always led the way. It
> also ensures 
> backward-compatibility.

Exactly; what exactly would some theoretical language
gain by allowing spaces in class values? Might as well
keep it simple and not allow them, following current
practice.

Brad

> 
> -dean
> 
> 




More information about the whatwg mailing list