Re: HTML L2: Add HTMLFormControl interface as ancestor to form controls

DOM HTML Level 2 is already a candidate recommendation and making a 
change of this nature this late in the process is IMO not a good idea. 
So that means that a change like this would be pushed to Level 3 of the 
DOM HTML specification and even then this change would cause yet more 
binary incompatibilities with older versions of the specification so we 
would need really good reasons for making such a change in the 
specification. I do agree with you that what you're proposing is a 
cleaner design of those API's, but I don't think that making a change 
like this now is a good idea, had this been thought of when the original 
DOM HTML API's were designed then I would've been all for this.

Curt Arnold wrote:
> 
> I believe it would be beneficial to add a HTMLFormControl interface to 
> be used as a common ancestor interface for the form control interfaces. 
> This should have no end-user detectable affect from scripting languages 
> since the existing interfaces share identically named attributes. 
> However, it would allow strongly-typed languages to operate on the 
> common attributes of form controls without resorting to reflection.
> 
> For example, in JavaScript you could do:
> 
> var controls = form.elements();
> for(var i = 0; i < controls.length; i++) {
>    controls.item(i).disabled = true;
> }
> 
> But you could not readily do the equivalent in Java.
> 
> The interface could look something like:
> 
> interface HTMLFormControl : HTMLElement {
>    readonly attribute HTMLFormElement form;
>    attribute DOMString name;
>    attribute DOMString value;
>   attribute boolean disabled;
>    //
>    //   these attributes are not currently in all form control interfaces
>    //      attribute DOMString defaultValue;
>   attribute DOMString accessKey;
>   attribute long tabIndex;
> }
> 
> 
> 
> 

-- 
jst

Received on Friday, 21 June 2002 12:12:24 UTC