Re: [dom3core] getAttribute

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 UTC