W3C home > Mailing lists > Public > public-web-perf@w3.org > November 2010

Re: [NavigationTiming] Move window.performance to navigator.performance

From: Simon Pieters <simonp@opera.com>
Date: Tue, 23 Nov 2010 16:17:32 +0100
To: "Jonas Sicking" <jonas@sicking.cc>
Cc: "public-web-perf@w3.org" <public-web-perf@w3.org>
Message-ID: <op.vmmp3icaidj3kv@dhcp-190.linkoping.osa>
I'll assume that you intended to cc the list...

On Tue, 23 Nov 2010 11:59:55 +0100, Jonas Sicking <jonas@sicking.cc> wrote:

> On Tue, Nov 23, 2010 at 2:05 AM, Simon Pieters <simonp@opera.com> wrote:
>> Hi,
>>
>> I'm a bit concerned about
>>
>> http://test.w3.org/webperf/specs/NavigationTiming/#nt-window-performance
>> [Supplemental]
>> interface Window {
>>  readonly attribute Performance performance;
>> };
>>
>> This adds a new property 'performance' to the global scope. I think  
>> there
>> may be pages out there that already use that property for other things  
>> --
>> script variables or <div id="performance"> or <a name="performance"> or
>> <form onsubmit="return validate(performance.value)"><input
>> name="performance">, and so forth.
>>
>> http://google.com/codesearch?q=name%3D%28%22%7C%27%29%3Fperformance%28%22%7C%27%7C%5Cs%7C%3E%29+lang%3Ahtml
>>
>> To avoid polluting the global scope with a common name, potentially  
>> breaking
>> scripts out there, I suggest we move the attribute to the Navigator
>> interface.
>>
>> http://dev.w3.org/html5/spec/timers.html#system-state-and-capabilities:-the-navigator-object
>>
>> To follow the convention around Navigator in HTML5 I guess it could look
>> something like:
>>
>> [Supplemental, NoInterfaceObject]
>> interface NavigatorPerformance {
>>  readonly attribute Performance performance;
>> };
>> Navigator implements NavigatorPerformance;
>
> One problem with using navigator is that the navigator instance
> survives across same-origin page transitions. (At least in gecko)

Interesting, I didn't know that. It doesn't seem to survive page  
transitions in Opera or WebKit, but in IE it does.

Why does it survive page transitions in Gecko? Why is it a problem for  
navigator.performance? Is it also a problem for any of the other members  
of navigator?

-- 
Simon Pieters
Opera Software
Received on Tuesday, 23 November 2010 15:17:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 21 December 2010 18:13:56 GMT