You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that IE has a toJSON method on these that affects what JSON.stringify returns. I see nothing like that in the spec; is it supposed to be there?
So should I add the toJSON() method to PerformanceResourceTiming object and define is as:
toJSON() method:
Returns a json object representing the PerformanceResourceTiming object.
In fact should I define it on PerformanceEntry itself (as well as on window.performance.timing) to cover all Performance objects?
What you should do is define a serializer. See http://heycam.github.io/webidl/#idl-serializers and I suspect what you want here is:
serializer = { attribute };
for interfaces that don't inherit from something that needs serialization but want to serialize all their own attributes or
serializer = { inherit, attribute };
for ones that want to serialize their own attributes plus whatever their parent interface serializes. This will automatically create a toJSON method that does the right things for you.
I suggest you test what UAs do and whether the spec you write is compatible with that.
Gecko does have a serializer on PerformanceEntry and on PerformanceTiming, for what that's worth.
@plehegar Is there a reason to list all the attributes manually instead of just saying "all attributes"? Seems like this is a recipe for getting things out of sync.
Also, don't you need a serializer on PerformanceEntry too? Using "inherit" is not valid IDL unless there is an ancestor with a serializer.
Quoted from the discussion in public-web-perf@w3.org [1].
@bzbarsky
@jainarvind
@bzbarsky
[1] http://lists.w3.org/Archives/Public/public-web-perf/2014Aug/thread.html#msg0
The text was updated successfully, but these errors were encountered: