[whatwg] a few comments to Webforms 2.0 Call For Comments

Olav Junker Kjær olav at olav.dk
Fri Jul 30 02:09:47 PDT 2004


>> Oh right, so el.getAttribute('foo')  and el.foo would point to
>> different things in the DOM - what would el.foo='1' and
>> el.setAttribute('foo',1) do to the opposite one?
>>
>> Seems a little unusual, and directly against 1.6.1 of DOM Level 2.0,
>> but WTF, It might be a good idea, I've not really thought about it.Jim.

This is actually the case with the new "form" attribute. This 
property/attribute is a special case, since properties corresponding to 
attributes usually return simple values (string, number, boolean) 
corresponding to the attribute value. However, the "form" property is 
always a reference to a HTMLFormElement, while the attribute, if 
specified, is a string (specifying the ID of a form-element)

So the attribute might be null when the property is a HTMLFormElement 
(if no "form" attribute is specified in html, but the control is nested 
inside a form element), or reversely, the property might be null when 
the attribute is a string (if the string doesn't correspond to the id of 
a form element in the same document).

This might be against section 1.6.1
If this is a problem, maybe the form attribute should be renamed?

Olav Junker Kjær






More information about the whatwg mailing list