Bug 21886 - window.HTMLOptionElement == "[object HTMLElementConstructor]" instead of HTMLOptionElementConstructor
Summary: window.HTMLOptionElement == "[object HTMLElementConstructor]" instead of HTML...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on: 21842
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-25 08:24 PDT by Eric Seidel (no email)
Modified: 2008-10-27 01:49 PDT (History)
1 user (show)

See Also:


Attachments
test case (198 bytes, text/html)
2008-10-26 04:51 PDT, Alexey Proskuryakov
no flags Details
proposed fix (29.63 KB, patch)
2008-10-26 14:47 PDT, Alexey Proskuryakov
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2008-10-25 08:24:07 PDT
window.HTMLOptionElement == "[object HTMLElementConstructor]" instead of HTMLOptionElementConstructor

I filed this as bug 21842 originally, but that was decided invalid.  I'm not sure what the functionality of "new HTMLOptionElement" needs to be, but it seems that window.HTMLOptionElement should be a specifically-named constructor like all the rest of the HTMLElement "subclasses" instead of being just an HTMLElementConstructor.

See bug 21842 for more background.

To fix this will probably require using a new idl flag "CustomConstructor" to have the JSHTMLOptionElement generated class generate a getConstructor function with the appropriate types.
Comment 1 Alexey Proskuryakov 2008-10-26 04:51:21 PDT
Created attachment 24682 [details]
test case

This is a real bug that affects extending HTMLOptionElement prototype, not just a problem with its constructor name.
Comment 2 Alexey Proskuryakov 2008-10-26 05:41:46 PDT
I have a fix (window.Option and window.HTMLOptionElement are two different constructors, we need to provide both).
Comment 3 Alexey Proskuryakov 2008-10-26 14:47:18 PDT
Created attachment 24684 [details]
proposed fix
Comment 4 Alexey Proskuryakov 2008-10-27 01:00:11 PDT
Committed revision 37895.