W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2005

Re: [dom3core] getAttribute

From: Ray Whitmer <ray@personallegal.net>
Date: Wed, 7 Dec 2005 07:49:51 -0700
Message-Id: <4332D2E6-8E89-4E03-9F5F-D04F0D1AE40F@personallegal.net>
Cc: Brendan Eich <brendan@meer.net>, www-dom@w3.org
To: Maciej Stachowiak <mjs@apple.com>


On Dec 6, 2005, at 12:16 PM, Maciej Stachowiak wrote:

> The problem is that your mode (3) is impossible. getAttribute can  
> return either empty string or null. How could you have a mode where  
> it complies with the standard by returning empty string, yet  
> ensures that the JS code will still work in a browser that returns  
> null? Proving that reduces to solving the halting problem.

Mode 3 is for compliance testing with standards that also work in IE.

So we wish to discourage use of getAttribute to check whether the  
attribute exists (fail if they do it).

Therefore, calling getAttribute on a non-existant attribute in mode 3  
would ideally throw an exception, so that any script that called  
getAttribute without knowing whether an attribute existed first would  
get an exception in this mode, because due to the ambiguity / tension  
between the specification and the status quo, there is no predicting  
what happens.

Ray Whitmer
Received on Wednesday, 7 December 2005 14:50:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:58 GMT