Bug 148449

Summary: A WebIDL callback interface is allowed to have constants
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: BindingsAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, commit-queue, darin, ggaren, rniwa, sam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 148434    
Bug Blocks: 148415    
Attachments:
Description Flags
Patch none

Description Chris Dumez 2015-08-25 15:44:28 PDT
A WebIDL callback interface is allowed to have constants. Currently, our bindings generator does not support that.

Spec for constants:
https://heycam.github.io/webidl/#dfn-constant

Part about constants and callback interfaces:
https://heycam.github.io/webidl/#es-user-objects
"The [NoInterfaceObject] extended attribute must not be specified on a callback interface unless it has a constant declared on it. This is because callback interfaces without constants never have interface objects."

The callback interface should also have a corresponding property on the global object if they are constants:
https://heycam.github.io/webidl/#es-interfaces
Comment 1 Chris Dumez 2015-08-27 14:05:02 PDT
Created attachment 260085 [details]
Patch
Comment 2 WebKit Commit Bot 2015-08-27 14:06:28 PDT
Attachment 260085 [details] did not pass style-queue:


ERROR: Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallback.h:37:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
ERROR: Source/WebCore/bindings/scripts/test/ObjC/DOMTestCallback.h:38:  enum members should use InterCaps with an initial capital letter.  [readability/enum_casing] [4]
Total errors found: 2 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Geoffrey Garen 2015-08-27 14:45:59 PDT
Comment on attachment 260085 [details]
Patch

r=me
Comment 4 WebKit Commit Bot 2015-08-27 15:36:04 PDT
Comment on attachment 260085 [details]
Patch

Clearing flags on attachment: 260085

Committed r189063: <http://trac.webkit.org/changeset/189063>
Comment 5 WebKit Commit Bot 2015-08-27 15:36:10 PDT
All reviewed patches have been landed.  Closing bug.