w3c / navigation-timing

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

navigationStart marked as Obsolte #82

Closed nicjansma closed 6 years ago

nicjansma commented 6 years ago

Kind of related to https://github.com/w3c/navigation-timing/issues/43

This is a minor issue, but in the latest spec, under section 7. Obsolete, we have the old performance.timing interface:

image https://www.w3.org/TR/navigation-timing-2/#obsolete

My concern here is that while I don't think we're suggesting any browser should remove this interface (due to web compat), performance.timing.navigationStart is the only way of getting the time origin. You can't use performance.getEntriesByType('navigation')[0].startTime as that is always 0.

So I'm worried that devs might find it confusing to have performance.timing.navigationStart under the Obsolete section (with the ... strongly advised... text), as there's no alternate way of getting the time-origin from any other interface.

@igrigorik I kind of like how you had labeled the section Historical instead of Obsolete before: https://github.com/w3c/navigation-timing/issues/43#issuecomment-248274528, which might better communicate we don't have any (current) plans to remove the interface in a future spec.

Or, we could simply add a clause in the Obsolete paragraph like:

This section defines attributes and interfaces previously introduced in [NAVIGATION-TIMING] Level 1 and are kept here for backwards compatibility. Authors should not use the following interfaces and are strongly advised to use the new PerformanceNavigationTiming interface—see summary of changes and improvements. The only exception is navigationStart, which is the only current way of fetching the page's time origin.

or something

nicjansma commented 6 years ago

Found out about timeOrigin in https://www.w3.org/TR/hr-time-2/#the-performance-interface today!

Maybe if the spec simply had a friendly pointer for people using performance.timing.navigationStart to performance.timeOrigin.