W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2002

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

From: Johnny Stenback <jst@netscape.com>
Date: Fri, 21 Jun 2002 09:12:19 -0700
Message-ID: <3D135063.6000105@netscape.com>
To: Curt Arnold <carnold@houston.rr.com>
CC: www-dom@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:56 GMT