[whatwg] The type mismatch validity flag

On Wed, 8 Dec 2004, Brian Wilson wrote:
> 
> A while back I had created a number of WF2 test cases that checked the 
> type mismatch validity flag by setting initial values contrary to a 
> widget's type.
> 
> In section 2.18, the following is found: [...]

I added this to the DOM section:

--8<--

Setting a control's value DOM attribute dynamically in such a way that it 
makes the control invalid because the value doesn't conform to the syntax 
required by the type given in the type  attribute must set the control to 
the value that the control would have had if it had never been given an 
explicit value.

Setting a control's value DOM attribute dynamically in such a way that it 
makes the control invalid because the value doesn't conform to the 
attributes setting constraints on the value, however, must cause the 
control to be set to the new value, and the control becoming invalid. (For 
example setting the value of a text field to a string that is longer than 
the maxlength attribute specifies would set the control to that long 
value, but then prevent submission.) If the control cannot be set to that 
value (for example, a range control cannot represent values outside its 
range) then the value must be clamped to the nearest value that can be 
represented by the control.

--8<--

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Wednesday, 8 December 2004 20:02:00 UTC