ASSIGNED 163381
[WebIDL] Add support to bindings generator for half-open dictionaries
https://bugs.webkit.org/show_bug.cgi?id=163381
Summary [WebIDL] Add support to bindings generator for half-open dictionaries
Rawinder Singh
Reported 2016-10-12 23:07:19 PDT
This bug has superseded Bug #158509 ([WebIDL] Add support for sequence<Dictionary>). Add support to bindings generator for half-open dictionaries, e.g.: (see Bug #158509, comment #14 for further discussion of why this feature is being added) [ OpenPropertyType=DOMString ] dictionary OpenPropertyTypeDictionary1 { ... }; This will be used for the Web Animations API implementation (see Bug #158508). Further test cases for this feature will be added as part of the implementation of Bug #158508.
Attachments
Patch (25.62 KB, patch)
2016-10-12 23:20 PDT, Rawinder Singh
no flags
Patch (25.55 KB, patch)
2016-10-12 23:40 PDT, Rawinder Singh
no flags
Patch (24.15 KB, patch)
2016-10-19 17:12 PDT, Rawinder Singh
no flags
Patch (24.15 KB, patch)
2016-10-19 17:19 PDT, Rawinder Singh
no flags
Patch (25.43 KB, patch)
2016-10-19 19:33 PDT, Rawinder Singh
beidson: review-
Rawinder Singh
Comment 1 2016-10-12 23:20:40 PDT
Rawinder Singh
Comment 2 2016-10-12 23:24:03 PDT
*** Bug 158509 has been marked as a duplicate of this bug. ***
Anne van Kesteren
Comment 3 2016-10-12 23:39:47 PDT
Note the discussion in https://github.com/heycam/webidl/pull/180. You might want to align your syntax or give input with respect to the requirements.
Rawinder Singh
Comment 4 2016-10-12 23:40:38 PDT
Rawinder Singh
Comment 5 2016-10-12 23:55:26 PDT
(In reply to comment #3) > Note the discussion in https://github.com/heycam/webidl/pull/180. You might > want to align your syntax or give input with respect to the requirements. Okay, thanks for the link - I'll have a look and possibly update the patch. In the meanwhile, could Sam or Chris have a look at the general implementation and let me know if you have any comments (as this overlaps with changes you have both been making in the generators and converters recently).
Chris Dumez
Comment 6 2016-10-13 09:24:25 PDT
Comment on attachment 291458 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=291458&action=review > Source/WebCore/ChangeLog:9 > + WebKit IDL extended dictionary attribute "OpenPropertyType". Can you point me to the specification for this? I cannot find OpenPropertyType at https://heycam.github.io/webidl/
Chris Dumez
Comment 7 2016-10-13 09:32:58 PDT
Comment on attachment 291458 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=291458&action=review > Source/WebCore/bindings/js/JSDOMConvert.h:345 > + template<typename ReturnType, typename T> bool addResultIfValid(ReturnType &result, WTF::Optional<T> &value) & is on the wrong side. > Source/WebCore/bindings/js/JSDOMConvert.h:638 > +template<typename IDLType> HashMap<String, typename IDLType::ImplementationType> convertDictionaryProperties(JSC::ExecState& state, JSC::JSObject& object) I think there should be "Open" somewhere in the name. Maybe convertOpenDictionary? or convertOpenDictionaryType? > Source/WebCore/bindings/js/JSDOMConvert.h:648 > + result.add(propertyName.string(), value); WTFMove(value) ? > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1154 > + # 6. Process WebKit extended IDL attribute (OpenPropertyType) for half-open dictionary: The steps numbering currently match the specification. However, I cannot find this new step in the spec? > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:1155 > + my $idlOpenPropertyType = $dictionary->extendedAttributes->{"OpenPropertyType"}; quotes are not needed.
Chris Dumez
Comment 8 2016-10-13 09:34:51 PDT
Comment on attachment 291458 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=291458&action=review >> Source/WebCore/ChangeLog:9 >> + WebKit IDL extended dictionary attribute "OpenPropertyType". > > Can you point me to the specification for this? I cannot find OpenPropertyType at https://heycam.github.io/webidl/ Ok, I found https://github.com/heycam/webidl/pull/180 in the comments. Should we wait until people agree upon a given syntax before we land this patch? It seems the latest proposals look pretty different from what's implemented here.
Rawinder Singh
Comment 9 2016-10-18 17:56:23 PDT
(In reply to comment #8) > Comment on attachment 291458 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=291458&action=review > > >> Source/WebCore/ChangeLog:9 > >> + WebKit IDL extended dictionary attribute "OpenPropertyType". > > > > Can you point me to the specification for this? I cannot find OpenPropertyType at https://heycam.github.io/webidl/ > > Ok, I found https://github.com/heycam/webidl/pull/180 in the comments. > Should we wait until people agree upon a given syntax before we land this > patch? It seems the latest proposals look pretty different from what's > implemented here. "OpenPropertyType" is equivalent to the syntax that Sam described in Bug #158509, comment #14 (in his suggested syntax it was called "HalfOpenType") - it is the specialised WebKit IDL extended attribute for dictionaries that was discussed. According to Bug #158509, comment #5, the Web IDL syntax for open dictionaries is still being discussed and will not become stable for a while. I am worried that this will stall the Web Animations API implementation - I would like to put this in temporarily (maybe with a FIXME) and update the implementation when the Web IDL syntax does finally become stable - what do you think?
Rawinder Singh
Comment 10 2016-10-19 17:12:18 PDT
Rawinder Singh
Comment 11 2016-10-19 17:19:31 PDT
Rawinder Singh
Comment 12 2016-10-19 19:33:09 PDT
Brady Eidson
Comment 13 2018-02-14 10:34:32 PST
Comment on attachment 292142 [details] Patch Patches that have been up for review since 2016 are almost certainly too stale to be relevant to trunk in their current form. If this patch is still important please rebase it and post it for review again.
Note You need to log in before you can comment on or make changes to this bug.