RESOLVED FIXED 117403
Support latest Web IDL named property getters
https://bugs.webkit.org/show_bug.cgi?id=117403
Summary Support latest Web IDL named property getters
Chris Dumez
Reported 2013-06-10 03:52:37 PDT
We should support the latest Web IDL named property getters and stop using the outdated [NamedGetter] IDL extended attribute. This change was already done in Blink: https://chromiumcodereview.appspot.com/14044026
Attachments
Patch (22.82 KB, patch)
2013-06-11 03:27 PDT, Chris Dumez
no flags
Patch (22.89 KB, patch)
2013-06-11 03:31 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2013-06-11 03:27:52 PDT
Chris Dumez
Comment 2 2013-06-11 03:31:14 PDT
Comment on attachment 204333 [details] Patch Sorry, changelog issue.
Chris Dumez
Comment 3 2013-06-11 03:31:58 PDT
Kentaro Hara
Comment 4 2013-06-11 03:36:16 PDT
Comment on attachment 204333 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=204333&action=review > Source/WebCore/dom/DOMStringMap.idl:33 > + getter DOMString (DOMString name); Just to confirm: Is it OK to omit the method name? I'm not sure of how it is supported in JSC. > Source/WebCore/dom/NodeList.idl:28 > + getter (Node or unsigned long) (DOMString name); How does this work? I thought IDL union is not yet supported in JSC. > Source/WebCore/html/HTMLAllCollection.idl:34 > + [Custom] getter Node namedItem(DOMString name); What's the difference between '[Custom] getter' and [CustomNamedGetter] ?
Chris Dumez
Comment 5 2013-06-11 05:06:41 PDT
Comment on attachment 204333 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=204333&action=review >> Source/WebCore/dom/DOMStringMap.idl:33 >> + getter DOMString (DOMString name); > > Just to confirm: Is it OK to omit the method name? I'm not sure of how it is supported in JSC. I store anonymous functions such as this one in Interface->anonymousFunctions instead of Interface->functions so that no code is generated for those. interface->anonymousFunctions is currently used by GetSpecialAccessorFunctionForType() only to find specials. Therefore, the generated code is identical, this is covered by TestEventTarget.idl bindings test above. >> Source/WebCore/dom/NodeList.idl:28 >> + getter (Node or unsigned long) (DOMString name); > > How does this work? I thought IDL union is not yet supported in JSC. This is purely informative at this point. The JSC bindings generator does not currently generate everything. The following methods are (need to be) defined in JSNodeListCustom.cpp: bool JSNodeList::canGetItemsForName(ExecState*, NodeList* impl, PropertyName propertyName); JSValue JSNodeList::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName); Having [NamedGetter] only makes sure this custom code gets called. >> Source/WebCore/html/HTMLAllCollection.idl:34 >> + [Custom] getter Node namedItem(DOMString name); > > What's the difference between '[Custom] getter' and [CustomNamedGetter] ? There is currently a subtle difference: 1. If you use [CustomNamedGetter] and don't define the namedItem operation. - No "namedItem" method will be exposed on the object 2. If you use [CustomNamedGetter] and define the namedItem operation. - The namedItem operation will be exposed on the object but it will call the implementation code directly (no custom code) 3. If you use [Custom] getter namedItem(DOMString name) - the namedItem operation will be exposed on the object and will call its custom implementation.
Kentaro Hara
Comment 6 2013-06-11 05:12:19 PDT
Comment on attachment 204334 [details] Patch Thanks for the clarification. The confusions comes from the fact that JSC's support for named getters isn't mature, but in summary, this patch improves the situation of current IDL files. LGTM. Finally, we want to remove [CustomNamedGetter] and leave 'getter' and '[Custom] getter'.
WebKit Commit Bot
Comment 7 2013-06-11 06:04:17 PDT
Comment on attachment 204334 [details] Patch Clearing flags on attachment: 204334 Committed r151434: <http://trac.webkit.org/changeset/151434>
WebKit Commit Bot
Comment 8 2013-06-11 06:04:21 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.