This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20361 - Grammar is wrong for serializers
Summary: Grammar is wrong for serializers
Status: RESOLVED MOVED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Cameron McCormack
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-12 16:37 UTC by Robin Berjon
Modified: 2016-10-22 16:09 UTC (History)
7 users (show)

See Also:


Attachments

Description Robin Berjon 2012-12-12 16:37:59 UTC
A serializer is supposed to be able to be:

   serializer identifier name();

But the syntax has that as serializer OperationRest. OperationRest does not include the identifier, so it needs to be added.
Comment 1 Robin Berjon 2012-12-12 16:39:09 UTC
(In reply to comment #0)
> A serializer is supposed to be able to be:
> 
>    serializer identifier name();
> 
> But the syntax has that as serializer OperationRest. OperationRest does not
> include the identifier, so it needs to be added.

Of course I would be more readable if I were awake. I meant

    serializer type identifier();

The type is not accounted for in the syntax.
Comment 2 Dominique Hazael-Massieux 2012-12-21 14:24:29 UTC
Maybe relatedly, the grammar prevents having a ";" (instead of mandating it) after an empty serializer declaration. 

interface Foo { serializer }; // valid according to the current grammar
interface Foo { serializer; }; // invalid according to the current grammar
Comment 3 Jens Widell 2015-03-23 11:59:46 UTC
The grammar also lacks support for the

  serializer = { attribute };

and

  serializer = { inherit, attribute };

variants.
Comment 4 Boris Zbarsky 2015-03-23 12:39:59 UTC
I still claim the entire serializer setup is overengineered.  Does anyone really want anything other than { attribute } for interfaces with no ancestors that have serializers or { inherit, attribute } for ones that have such ancestors?
Comment 5 Travis Leithead [MSFT] 2015-03-24 13:55:57 UTC
(In reply to Boris Zbarsky from comment #4)
> I still claim the entire serializer setup is overengineered.  Does anyone
> really want anything other than { attribute } for interfaces with no
> ancestors that have serializers or { inherit, attribute } for ones that have
> such ancestors?

In IE, we've only wanted (and implemented) this for the NavigationTiming [1] and related interfaces, in order to make it easy to package and serialize the attributes. +1 for potentially simplifying the grammar to remove use-cases until/unless we find a good reason for them.

[1] http://www.w3.org/TR/navigation-timing/#sec-navigation-timing-interface
Comment 6 Boris Zbarsky 2015-03-24 14:07:57 UTC
In Gecko's case we use it for some of the timing stuff, but also for some WebRTC interfaces (RTCIceCandidate, RTCSessionDescription).  In any case, all those consumers want to serialize all the attributes.
Comment 7 Domenic Denicola 2016-10-22 16:09:05 UTC
Consolidating serializer issues into a simplification issue at https://github.com/heycam/webidl/issues/188