Re: Where are instances of PerformanceNavigationTiming created?

On 7/9/14, 3:55 PM, Philippe Le Hegaret wrote:
> Similar to Resource Timing, the Processing Model indicates when the
> instance is created:
> [[
> 2. Create a new PerformanceNavigationTiming object.
> ]]
> https://w3c.github.io/web-performance/specs/NavigationTiming2/Overview.html#step-create-object

Hmm.  I must have missed that somehow.  I could have sworn I searched 
the spec text for "PerformanceNavigationTiming"...

When, exactly, are these steps executed?  That doesn't seem to be 
stated.  Presumably this is meant to hook into the "navigate" algorithm 
somehow, right?

There's a bit of a problem here, in that this processing model seems to 
envision creation of a PerformanceNavigationTiming object before the 
page that results from the navigation exists, but this object, like all 
other IDL objects, can't be created before the corresponding JS global 
is created.  What's probably needed here is some sort of record that's 
created at navigation start and stores values like the unload time, etc, 
with the values then copied to a PerformanceNavigationTiming once the 
latter can be created... or something along those lines.

> We don't explicitly say when performance.getEntriesByType would be able
> to return the instance however but I believe the expectation would be
> from the beginning, ie as soon as the page is able to invoke
> getEntriesByType.

Well, so...  The spec text in 
http://www.w3.org/TR/performance-timeline/#sec-performance-timeline is 
fairly vague but implies that PerformanceEntry instances should be 
gettable via getEntriesByType as long as they exist.  Or perhaps 
forever?  There is no mention in 
http://www.w3.org/TR/performance-timeline/#sec-window.performance-attribute 
of them being able to stop existing...

However, the processing model of 
https://w3c.github.io/web-performance/specs/ResourceTiming/Overview.html#processing-model 
certainly assumes that PerformanceEntry instances can stop existing.  In 
fact I _think_ it assumes that only entries that are stored in the 
"primary buffer" actually exist and can be fetched vie getEntries and 
company.

It would be good to get all this actually clearly defined.

For example, if I navigate away from a window, or close it, but hold a 
reference to the performance object, can I still get its 
PerformanceNavigationTiming?  Why or why not?

-Boris

Received on Thursday, 10 July 2014 01:28:10 UTC