Bug 154038

Summary: [Web IDL] interface objects should be Function objects
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: BindingsAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: arv, barraclough, buildbot, commit-queue, darin, ggaren, joepeck, mark.toller, rniwa, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar, WebExposed
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: http://heycam.github.io/webidl/#interface-object
Bug Depends on: 153920    
Bug Blocks:    
Attachments:
Description Flags
WIP Patch
buildbot: commit-queue-
Archive of layout-test-results from ews101 for mac-yosemite
none
Archive of layout-test-results from ews104 for mac-yosemite-wk2
none
Archive of layout-test-results from ews116 for mac-yosemite
none
WIP patch
none
Archive of layout-test-results from ews106 for mac-yosemite-wk2
none
Archive of layout-test-results from ews112 for mac-yosemite
none
Archive of layout-test-results from ews102 for mac-yosemite
none
Patch
none
Patch
none
Patch none

Description Chris Dumez 2016-02-09 09:57:19 PST
interface objects should be Function objects as per Web IDL:
- http://heycam.github.io/webidl/#interface-object
- http://heycam.github.io/webidl/#es-interfaces

So window.Event should be a Function object for e.g. but in WebKit it is a regular EventConstructor JSObject.
Firefox and Chrome match the specification.
Comment 1 Radar WebKit Bug Importer 2016-02-09 09:58:12 PST
<rdar://problem/24569358>
Comment 2 Radar WebKit Bug Importer 2016-02-09 09:58:48 PST
<rdar://problem/24569376>
Comment 3 Chris Dumez 2016-02-09 10:00:53 PST
This should also impact the "constructor" properties on prototype objects (e.g. Event.prototype.constructor) as their value in a reference to the interface object:
- http://heycam.github.io/webidl/#interface-prototype-object
Comment 4 Chris Dumez 2016-02-09 22:19:59 PST
Created attachment 270976 [details]
WIP Patch
Comment 5 WebKit Commit Bot 2016-02-09 22:21:25 PST
Attachment 270976 [details] did not pass style-queue:


ERROR: Source/WebCore/bindings/js/JSDOMConstructor.h:37:  The parameter name "globalObject" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/bindings/js/JSDOMConstructor.h:69:  The parameter name "globalObject" adds no information, so it should be removed.  [readability/parameter_name] [5]
ERROR: Source/WebCore/bindings/js/JSDOMConstructor.h:92:  The parameter name "globalObject" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 3 in 55 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 Build Bot 2016-02-09 23:06:38 PST
Comment on attachment 270976 [details]
WIP Patch

Attachment 270976 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/807987

Number of test failures exceeded the failure limit.
Comment 7 Build Bot 2016-02-09 23:06:42 PST
Created attachment 270978 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 8 Build Bot 2016-02-09 23:10:29 PST
Comment on attachment 270976 [details]
WIP Patch

Attachment 270976 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/807994

Number of test failures exceeded the failure limit.
Comment 9 Build Bot 2016-02-09 23:10:33 PST
Created attachment 270979 [details]
Archive of layout-test-results from ews104 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 10 Build Bot 2016-02-09 23:17:35 PST
Comment on attachment 270976 [details]
WIP Patch

Attachment 270976 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/807992

Number of test failures exceeded the failure limit.
Comment 11 Build Bot 2016-02-09 23:17:39 PST
Created attachment 270980 [details]
Archive of layout-test-results from ews116 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 12 Darin Adler 2016-02-10 09:02:26 PST
Comment on attachment 270976 [details]
WIP Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=270976&action=review

> Source/WebCore/bindings/js/JSDOMConstructor.h:37
> +    static JSC::JSValue prototypeForStructure(JSC::VM&, const JSDOMGlobalObject& globalObject);

The style checker is correct that there’s no need for the argument name “global object” here.

> Source/WebCore/bindings/js/JSDOMConstructor.h:69
> +    static JSC::JSValue prototypeForStructure(JSC::VM&, const JSDOMGlobalObject& globalObject);

Ditto.

> Source/WebCore/bindings/js/JSDOMConstructor.h:115
> +    static JSC::JSValue prototypeForStructure(JSC::VM&, const JSDOMGlobalObject&);

Ditto.
Comment 13 Chris Dumez 2016-02-10 09:03:22 PST
(In reply to comment #12)
> Comment on attachment 270976 [details]
> WIP Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=270976&action=review
> 
> > Source/WebCore/bindings/js/JSDOMConstructor.h:37
> > +    static JSC::JSValue prototypeForStructure(JSC::VM&, const JSDOMGlobalObject& globalObject);
> 
> The style checker is correct that there’s no need for the argument name
> “global object” here.
> 
> > Source/WebCore/bindings/js/JSDOMConstructor.h:69
> > +    static JSC::JSValue prototypeForStructure(JSC::VM&, const JSDOMGlobalObject& globalObject);
> 
> Ditto.
> 
> > Source/WebCore/bindings/js/JSDOMConstructor.h:115
> > +    static JSC::JSValue prototypeForStructure(JSC::VM&, const JSDOMGlobalObject&);
> 
> Ditto.

Yes yes, this was just a "Work In Progress" patch that I will polish because marking as r?
Comment 14 Darin Adler 2016-02-10 09:13:12 PST
No problem. Sometimes I review those by accident, sometimes intentionally. And sometimes people review mine. Sorry to waste your time replying to say something you were already planning to do!
Comment 15 Chris Dumez 2016-02-10 10:25:08 PST
Created attachment 271003 [details]
WIP patch
Comment 16 Build Bot 2016-02-10 11:23:18 PST
Comment on attachment 271003 [details]
WIP patch

Attachment 271003 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/810257

New failing tests:
js/dom/global-constructors-attributes.html
Comment 17 Build Bot 2016-02-10 11:23:22 PST
Created attachment 271009 [details]
Archive of layout-test-results from ews106 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 18 Build Bot 2016-02-10 11:23:53 PST
Comment on attachment 271003 [details]
WIP patch

Attachment 271003 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/810231

New failing tests:
http/tests/security/cross-frame-access-put.html
js/dom/global-constructors-attributes.html
Comment 19 Build Bot 2016-02-10 11:23:56 PST
Created attachment 271010 [details]
Archive of layout-test-results from ews112 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 20 Build Bot 2016-02-10 11:25:49 PST
Comment on attachment 271003 [details]
WIP patch

Attachment 271003 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/810283

New failing tests:
http/tests/security/cross-frame-access-put.html
js/dom/global-constructors-attributes.html
Comment 21 Build Bot 2016-02-10 11:25:53 PST
Created attachment 271011 [details]
Archive of layout-test-results from ews102 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 22 Chris Dumez 2016-02-10 11:32:22 PST
Created attachment 271013 [details]
Patch
Comment 23 Chris Dumez 2016-02-10 11:38:01 PST
Created attachment 271015 [details]
Patch
Comment 24 Chris Dumez 2016-02-10 11:53:00 PST
Created attachment 271017 [details]
Patch
Comment 25 Geoffrey Garen 2016-02-10 13:36:04 PST
Comment on attachment 271017 [details]
Patch

r=me
Comment 26 Chris Dumez 2016-02-10 13:51:20 PST
Comment on attachment 271017 [details]
Patch

Clearing flags on attachment: 271017

Committed r196392: <http://trac.webkit.org/changeset/196392>
Comment 27 Chris Dumez 2016-02-10 13:51:25 PST
All reviewed patches have been landed.  Closing bug.
Comment 28 Chris Dumez 2016-03-10 08:48:01 PST
*** Bug 155293 has been marked as a duplicate of this bug. ***
Comment 29 Chris Dumez 2016-04-10 08:47:38 PDT
*** Bug 74193 has been marked as a duplicate of this bug. ***