W3C home > Mailing lists > Public > public-html@w3.org > July 2007

Re: DOMTokenList.add() when the underlying string is empty (detailed review of the DOM)

From: Simon Pieters <simonp@opera.com>
Date: Tue, 17 Jul 2007 16:44:56 +0200
To: public-html <public-html@w3.org>
Message-ID: <op.tvl5w61kidj3kv@hp-a0a83fcd39d2>

On Tue, 17 Jul 2007 16:37:20 +0200, Simon Pieters <simonp@opera.com> wrote:

> The spec says about DOMTokenList.add():
>
>    4. Otherwise, if the last character of the DOMTokenList object's
>       underlying string is not a space character, then append a U+0020
>       SPACE character to the end of that string.
>
> When the underlying string is empty, the last character is not a space  
> character, and so a space will be appended, resulting in the string " x"  
> if "x" was used as parameter. Is this intentional? I wouldn't expect a  
> space to be appended when the underlying string is empty.

This also applies to DOMTokenList.toggle(), step 4.

-- 
Simon Pieters
Opera Software
Received on Tuesday, 17 July 2007 14:45:07 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:47 UTC