[WebIDL] Replace serializers with toJSON and [Default] extended attribute
Reported by
tobie.la...@gmail.com,
Jun 23 2017
|
|||
Issue description
We just removed serializers[1] from WebIDL and allowed editors to specify toJSON operations[2] directly instead (WebIDL treated toJSON as a reserved identifier up until now).
To deal with common cases, we added a new [Default] extended attribute[3] which triggers the default toJSON operation[4] that behaves similarly to how serializers={attributes} or serializers={attributes, inherit} used to.
All serializer-related productions were removed from the WebIDL grammar. In particular the following non-terminals:
* Serializer
* Serializer was also removed from the rhs expression of InterfaceMember.
* SerializerRest
* OperationRest
* SerializationPattern
* SerializationPatternMap
* SerializationPatternList
and the following terminals:
* "serializer" in ArgumentNameKeyword.
As usual, please feel free to reach out if anything needs clarification or if you have questions.
Thanks!
[1]: https://github.com/heycam/webidl/pull/323
[2]: https://heycam.github.io/webidl/#idl-tojson-operation
[3]: https://heycam.github.io/webidl/#Default
[4]]: https://heycam.github.io/webidl/#es-default-tojson
,
Aug 23 2017
This may become important as IDL tests start to fail as a result of not having this. Eg. See https://chromium-review.googlesource.com/c/chromium/src/+/601649/4/third_party/WebKit/LayoutTests/external/wpt/payment-request/interfaces.https-expected.txt#33
,
Aug 23 2017
Note that there's an issue with the idl harness test: https://github.com/w3c/web-platform-tests/issues/6974 I don't know if that's causing the failure here, though.
,
Sep 12 2017
idlharness issue fixed.
,
Oct 24 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/239dad8253c57d692200f9918f3b3af9772a977a commit 239dad8253c57d692200f9918f3b3af9772a977a Author: Hitoshi Yoshida <peria@chromium.org> Date: Tue Oct 24 02:29:47 2017 bindings: Update serializers in IDL file for bindings test Serializer is taken down in spec, and we still have some serializers in our code base because of historical reason. And their styles are either of - serializer; - serializer = { attribute }; - serializer = { inherit, attribute }; We don't have to support other styles, and it has no meaning to keep unused styles only in tests. Bug: 736332 Change-Id: I396dabd6e62d0b6cb060fbd616c3e8ec56adeab9 Reviewed-on: https://chromium-review.googlesource.com/732866 Reviewed-by: Kenichi Ishibashi <bashi@chromium.org> Commit-Queue: Hitoshi Yoshida <peria@chromium.org> Cr-Commit-Position: refs/heads/master@{#511011} [modify] https://crrev.com/239dad8253c57d692200f9918f3b3af9772a977a/third_party/WebKit/Source/bindings/tests/idls/core/TestImplements.idl [modify] https://crrev.com/239dad8253c57d692200f9918f3b3af9772a977a/third_party/WebKit/Source/bindings/tests/idls/core/TestObject.idl [modify] https://crrev.com/239dad8253c57d692200f9918f3b3af9772a977a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp [modify] https://crrev.com/239dad8253c57d692200f9918f3b3af9772a977a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp [modify] https://crrev.com/239dad8253c57d692200f9918f3b3af9772a977a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.h
,
Nov 30
,
Today
(7 minutes ago)
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/07e9e67ecf8ef312540c51042069d91ca0b823ea commit 07e9e67ecf8ef312540c51042069d91ca0b823ea Author: Hitoshi Yoshida <peria@chromium.org> Date: Wed Jan 23 09:46:41 2019 IDL: Replace serializer with toJSON in IDL Serializer is a deprecated feature in WebIDL, but we still have it on several IDL files. This CL replaces it with toJSON() operation, which is a replacement for serializer, but does not change user facing behaviors. For DetectedBarcode, DetectedText, and DetectedFace, toJSON() is not defined in spec, but this CL defines it to keep their backward compatibility. Bug: 736332 Change-Id: Iff420493f7d41a78452cef5a203330dba6333bca Reviewed-on: https://chromium-review.googlesource.com/c/1429310 Reviewed-by: Yuki Shiino <yukishiino@chromium.org> Reviewed-by: Kentaro Hara <haraken@chromium.org> Commit-Queue: Hitoshi Yoshida <peria@chromium.org> Cr-Commit-Position: refs/heads/master@{#625148} |
|||
►
Sign in to add a comment |
|||
Comment 1 by adithyas@chromium.org
, Jun 23 2017Status: Assigned (was: Untriaged)