[whatwg] DOMTokenList: mutation clarification

Ian Hickson ian at hixie.ch
Sat Aug 15 04:31:17 PDT 2009


On Mon, 10 Aug 2009, Sylvain Pasche wrote:
> >> 2) (using the class attribute for the discussion) What should happen 
> >> when you do a remove("foo") on an element which has no class 
> >> attribute?
> >>
> >> My understanding is that it shouldn't add a class attribute with an 
> >> empty string. That's because the remove() algorithm starts with an 
> >> empty string and doesn't change it, so the " when the object mutates 
> >> this empty string, " case shouldn't be true (and thus no attribute 
> >> modification should happen).
> >>
> >> However Simon's testcase [1] doesn't agree with this, and adds an 
> >> empty string. So maybe it's worth clarifying this situation?
> >
> > I think that the spec now implies that you set the attribute to the 
> > empty string. Do you agree?
> 
> I don't think it changes the interpretation of this border case and I 
> still think the spec implies that no attribute is added.

You are correct, I misinterpreted my own text! I've added an example so 
that this is crystal clear.

-- 
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