Re: [whatwg] WebIDL and HTML5

Garrett Smith wrote:
> Well, I'm not so sure. I corresponded with Jonas who indicated that he
> though null should convert to "".

Jonas was saying that the default behavior for a DOM method passed a 
null DOMString should be the same as the behavior if passed "".  That's 
not the same as saying that null is "".

> Now Maciej seems to be confused about textContent = null.

I didn't see any confusion there (well, except on your part).

> And we can see that the implementation of textContent = null "feature"
> was not per spec in Firefox or Webkit, so it is apparently quite
> confusing.

Er... how so, exactly?

> I have created a demo which expects that setting textContent to null
> will have no effect, as per DOM Core 3.

Except that's not what DOM Core 3 says.  Please do read what it says. 
Carefully:

   On setting, any possible children this node may have are removed
   and, if it the new string is not empty or null, replaced by a
   single Text node containing the string this attribute is set to.

So.  On setting all children are removed.  If the string is not empty or 
null, they are then replaced by a single Text node, etc.  If it's empty 
or null, the kids are removed and that's it.  It would perhaps help to 
write this out as a step-by-step list instead of having a moderately 
complex grammatical structure with a subordinate clause, but the meaning 
is still the same.

As for your test, sounds to me like Firefox and Webkit implement what 
the spec says, and Opera is just buggy here.

-Boris

Received on Wednesday, 27 August 2008 03:20:59 UTC