w3c / navigation-timing

Navigation Timing
https://w3c.github.io/navigation-timing/
Other
116 stars 30 forks source link

Drop prerenderSwitch from new draft? #38

Closed igrigorik closed 9 years ago

igrigorik commented 9 years ago

There is a subtle gotcha with it too as far as interop with PerformanceObserver is concerned: our processing model says it should be set at step 26, before the entry is queued to notify any observers...

Does that mean we should delay steps 27,28 until the visibilityChange transition fires? If so, we need to change the wording in that step to account for cases where page is not being prerendered.. It also means the nav timing entry would be delayed until page is made visible.. This seems a bit odd.

I'm wondering if we should simply drop prerenderSwitch from the spec? It's trivial to get the timestamp via existing Page Visibility and User Timing APIs..

document.addEventListener('visibilitychange', function() {
  performance.mark(document.visibilityState);
});

Thoughts, objections?

plehegar commented 9 years ago

We need feedback from Todd on this one since IE did some implementations there. @toddreifsteck? https://msdn.microsoft.com/library/dn265039%28v=vs.85%29.aspx

yoavweiss commented 9 years ago

AFAICT, it is not supported in neither Blink nor WebKit, so I would presume that it would be safe to deprecate and remove it.

Do we know what was the use case for adding it in the first place?

plehegar commented 9 years ago

I wrote http://www.w3.org/2015/10/webperf-prerender.html to attempt to prerender the webperf overview test but it didn't trigger prerenderSwitch in Edge as far as I can tell. Since we define prerender in Resource Hints, are you also proposing to drop https://w3c.github.io/resource-hints/#prerender ?

igrigorik commented 9 years ago

@plehegar no, I'm not proposing we drop prerender as an overall platform feature. Rather, I'm suggesting we drop prerenderSwitch from Navigation Timing spec because it's trivially implemented by the developers with existing tools (see my example above); it hasn't been implemented by any vendor; it's not clear how it's supposed to work with Performance Observer.

plehegar commented 9 years ago

ok. sounds good to me. Let's get a +1 from Todd and we should be all set.

igrigorik commented 9 years ago

@toddreifsteck can you take a quick look at this one?

toddreifsteck commented 9 years ago

LGTM, merging

toddreifsteck commented 9 years ago

Oh.. just an issue without a pull. Yes, this would be fine. :-)

igrigorik commented 9 years ago

Resolved via 6cc5a9e9e76a2f1970330ad6031d027a98bcf539.