Re: SVGT 1.2: no way to tell through uDOM if an attribute is present

On Jan 4, 2006, at 1:09 AM, Cyril Concolato wrote:

> Hi,
>
> Maciej Stachowiak a écrit :
>> Since getAttributeNS returns empty string for both an absent   
>> attribute and an attribute that is present but with an empty  
>> value,  there is no way to determine through the uDOM whether an  
>> attribute is  absent. This seems like a significant hole in the  
>> API and the  implementation load from adding hasAttributeNS seems  
>> small.
> I understand the concern about compatibility between uDOM and DOM  
> on getAttributeNS, but I don't think testing if an attribute is  
> absent is relevant in SVG T1.2. In SVG T 1.2, the intent is that  
> unspecified attributes default to a value, so whether it's absent  
> or specified with the default value is the same. Could you explain  
> why you would test if an attribute is absent?

For foreign attributes it would make a difference. You may also wish  
to know so you can do your own serialization of an element. I can't  
say it is the most useful thing in the world, but it is not useless  
either, and I think adding it would not be a large burden on  
implementors.

Regards,
Maciej

Received on Tuesday, 31 January 2006 07:59:44 UTC