- From: Ian Hickson <ian@hixie.ch>
- Date: Sun, 22 Aug 2004 12:03:19 +0000 (UTC)
On Tue, 3 Aug 2004, Brian Wilson wrote: > > I was operating under the assumption that .property for an attribute > would return to me the spec default value for that attribute if it was > not filled in for some of my test cases...I'm realizing that can't > really be accurate according to the letter of the spec, because all > these varying min/max/step defaults for different INPUT types can not be > enforced by the DTD since the INPUT element is so overloaded. The DTD > can not express this complexity adequately to allow for the varying > default values for these attributes. > > So - if I have > <input type="datetime"> > and request the field's .step property, is it ever possible to get "60" > legally as a default return value, or would UAs need to "hardcode" these > default values for each type? > > Am I just missing something here? What you're missing is that UAs (and the spec) are not constrained by what DTDs can do. The "step" DOM attribute is not the step="" content attribute (which you can get to by doing getAttribute("step"), incidentally). In the case given above, "input.step" would return "60" and "input.getAttribute('step')" would return null. -- Ian Hickson U+1047E )\._.,--....,'``. fL http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
Received on Sunday, 22 August 2004 05:03:19 UTC