W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2008

Re: [whatwg] WebIDL and HTML5

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 26 Aug 2008 23:20:16 -0400
Message-ID: <48B4C7F0.6050304@mit.edu>
To: Garrett Smith <dhtmlkitchen@gmail.com>
CC: Web Applications Working Group WG <public-webapps@w3.org>

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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:27 GMT