- From: Philippe Le Hegaret <plh@w3.org>
- Date: 25 Sep 2002 18:19:10 -0400
- To: Curt Arnold <carnold@houston.rr.com>
- Cc: WWW DOM <www-dom@w3.org>
On Fri, 2002-06-21 at 10:08, 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;
> }
The DOM HTML is not widely used in Java, so we only considered the
improvement from a DOM ECMAScript perspective. The proposed change does
not add in fact a valuable improvement for ECMAScript users and could
introduce binary incompatibility in other bindings. Based on that, we
choose to leave the current proposal as it stands.
Philippe
[1] http://www.w3.org/2002/06/DOM-Level-2-HTML-CR-issues/all.html#curt1
Received on Wednesday, 25 September 2002 18:21:09 UTC