Re: review of Navigation Timing's use of Web IDL

    Thanks for reviewing, Cameron. I will happily follow your advice of
doing nothing. :-)

cheers,
Zhiheng

On Thu, Mar 17, 2011 at 7:01 PM, Cameron McCormack <cam@mcc.id.au> wrote:

> Cameron McCormack:
> > The spec has
> >
> >   [Supplemental]
> >   interface Window {
> >     attribute Performance performance;
> >   };
> >
> > but as plh pointed out, [Supplemental] is not (yet) defined in Web IDL.
> > I would recommend writing this as:
> >
> >   [NoInterfaceObject]
> >   interface WindowPerformance {
> >     readonly attribute Performance performance;
> >   };
> >
> >   Window implements WindowPerformance;
> >
> > which has the desired effect using existing functionality in Web IDL.
> > (I think the attribute should be read only, too, if it doesn’t make
> > sense to be able to assign to window.performance.)
>
> As Ian pointed out to me on IRC, there is actually an observable
> difference between the (currently undefined) top snippet and the one
> just above.  For the former, the performance property will exist on
> Window.prototype, while for the latter, it will exist on
> Object.getPrototypeOf(window), instead (and
> Object.getPrototypeOf(Object.getPrototypeOf(window)) ==
> Window.prototype).
>
> Once we have the mixin interface concept, then that'll let you do what
> [Supplemental] wants to do currently, i.e. stick properties directly on
> Window.prototype.
>
> This all doesn’t particularly matter, since no browsers do the mixin
> prototype object thing that Web IDL currently requires, so apologies for
> the confusion.  It will be a very minor change for you to make once I’ve
> made the relevant Web IDL edits, anyway.  Better advice for you then is
> to just leave what you have for now and wait until Web IDL has changed.
>
> --
> Cameron McCormack ≝ http://mcc.id.au/
>
>

Received on Friday, 18 March 2011 21:17:52 UTC