[whatwg] Some questions to WF2

Ian Hickson ian at hixie.ch
Fri Dec 10 17:24:20 PST 2004


On Fri, 10 Dec 2004, Maniac wrote:
> Olav Junker Kjær wrote:
> 
> > Okay, but then the output element should also support the validation 
> > interface. I think it is confusing that elements which dont support 
> > validation exposes e.g. the setCustomValidity() method. I would prefer 
> > a flag isValidateable or something like that, which could be checked 
> > before accessing the validation interface.
> 
> May be then just specify new collection like 'form.validatedElements'? 
> It may be walked through without additional checking and allows not to 
> introduce confusing methods to other elements.

The problem is that then you can't just use the one array to cycle through 
the controls that won't be submitted, and if you do anything to the 
controls while looping through them to make them be submitted or not, the 
array will change length, which can lead to some strange bugs that are a 
pain to debug.

It just seems simpler all round to have the one array and a common 
interface.


> And for the DOM, I beleive, some pre-defined TreeWalker may do the 
> job...

Using the interfaces provided, it's certainly possible to create a tree 
walker which is pretty simple and does this. Without a common interface, 
though, you'd probably have to get a native implementation to do it 
sanely. I'd hate to see what it would look like written in JS! :-)

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


More information about the whatwg mailing list