Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relationship between performance.timing.navigationStart and hr-time time origin #43

Closed
majido opened this issue Apr 18, 2016 · 6 comments
Assignees
Milestone

Comments

@majido
Copy link

majido commented Apr 18, 2016

Based on my reading of the spec performance.timing.navigationStart seems to be the same as time origin as specified in hr-time spec. The wording is not exactly the same so I may be mistaken.

If my interpretation is correct then I think we should spell this relationship explicitly in this spec and perhaps align the texts. Otherwise, I think they should be made the same. :)

hr-spec definition

If the global object [HTML51] is a Window object, the time origin must be equal to:

  • the time when the browsing context is first created if there is no previous document;
  • otherwise, the time of the user confirming the navigation if a confirmation dialog is displayed during the prompt to unload algorithm;
  • otherwise, the time of starting the navigation responsible for loading the Window object's newest Document object.

navigation-timing-2 definition

This attribute must return the time immediately after the user agent finishes prompting to unload the previous document. If there is no previous document, this attribute must return the time the current document is created.

where
current document = Window object's newest Document object.

@igrigorik
Copy link
Member

Hmm, conceptually, yes.. Only gotcha is that PerformanceTiming is a legacy interface which predates our time origin definition in HR-Time. That said, I guess we're not planning to deprecate it, and since it's pretty much aligned, perhaps we can simplify it.

navigationStart

This attribute must return the time origin of the Window object.

@plehegar @toddreifsteck wdyt?

@toddreifsteck
Copy link
Member

I agree with @igrigorik 's suggestion.

@plehegar plehegar self-assigned this May 5, 2016
@plehegar
Copy link
Member

plehegar commented May 5, 2016

performance.timing.navigationStart is part of the historical section of the spec. That section starts with: "All time values defined in this appendix are measured in milliseconds since midnight of January 1, 1970 (UTC)."

Thus the description says "If there is no previous document, this attribute must return the time the current document is created."

Note that the equivalent in PerformanceNavigationTiming is the startTime, which is always equal to 0:
https://w3c.github.io/navigation-timing/#dom-PerformanceNavigationTiming-startTime

We should do better at marking that section as historical. Folks shouldn't look at the historical if they're looking at using the L2 but we still need to keep it there for legacy.

@plehegar
Copy link
Member

plehegar commented May 5, 2016

@igrigorik
Copy link
Member

Here's my attempt..

image

#historical {
    background-position: right;
    background-repeat: repeat-y;
    background-color: rgba(251, 233, 233, 0.5);
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='150px' width='50px'><text x='0' y='50' fill='red' font-size='30' fill-opacity='0.20'>L1</text></svg>");
}

@plehegar @toddreifsteck any objections?

@plehegar
Copy link
Member

belated +1 on this one. Nice result!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants