[Webkit-unassigned] [Bug 38688] Support control attribute of HTMLLabelElement

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 11 10:30:45 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=38688





--- Comment #18 from Darin Adler <darin at apple.com>  2010-05-11 10:30:43 PST ---
(In reply to comment #17)
> (In reply to comment #16)
> > (From update of attachment 55650 [details] [details])
> > > -HTMLElement* HTMLLabelElement::correspondingControl()
> > > +HTMLElement* HTMLLabelElement::control()
> > 
> > Why isn't the return type of this HTMLFormControlElement*? There are a lot of places in this patch that use HTMLElement* but instead should use HTMLFormControlElement.
> I was going to do that for correspondingControl(), but since control() is defined by the HTML5 spec to be of type HTMLElement, I thought that I cannot do that.

We can do it.

There are three angles on this:

    1) The DOM implementation itself can always use a more-specific return type. The binding mechanism supports that. And this gives us more type checking and in some cases can even lead to better code in the DOM implementation, so is probably worth doing.

    2) The JavaScript binding can't see the return type of a function, so it also doesn't matter exactly what object type is specified in the IDL file. So we probably could get away with using this type in the IDL file too.

    3) The reason HTML5 doesn't specify this is that HTMLFormControlElement is an implementation detail of WebKit and generally should not be exposed. It's an abstract base class. I do think, however, that it may be something you can see by looking at the prototype chains of form control elements. This has nothing to do with the return type of the function, though.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list