W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2016

Re: [geometry] DOMRectReadOnly serializer

From: Boris Zbarsky <bzbarsky@mit.edu>
Date: Sun, 16 Oct 2016 14:14:32 -0400
To: Rik Cabanier <cabanier@gmail.com>, Simon Fraser <smfr@me.com>, Simon Pieters <simonp@opera.com>
Cc: "public-fx@w3.org" <public-fx@w3.org>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <32b061a8-88b4-1c10-283c-a89aa3dfedfd@mit.edu>
On 10/16/16 12:46 PM, Rik Cabanier wrote:
> Looking at
> https://lists.w3.org/Archives/Public/public-fx/2016JanMar/0014.html, it
> looks like a WebIDL requirement.
> Boris, SimonP, can you comment on this?

WebIDL provides a convenient syntax for the common case for serializers.

It _does_ allow you do define a totally custom serializer, like so:


and then defining its behavior in prose however you want.

But note that the serializer syntax is in flux because it's 
overcomplicated already; see 
<https://github.com/heycam/webidl/issues/188>.  That said, we should 
leave some way of specifying a completely custom serializer, but I see 
no reason it shouldn't just be the declaration of a method named toJSON 
which you then define in prose as usual to return whatever you want to 

Received on Sunday, 16 October 2016 18:15:04 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:25 UTC