-
Notifications
You must be signed in to change notification settings - Fork 79
|expiration| should be Unix time like Date() #59
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
Comments
We now have several instances of "time" in the spec. Even if we can't get a common definition in Web IDL, we should have a local definition of time in the Definitions section that those instances can refer to. Once I follow up with Web IDL, we can mark this "to be implemented". The proposal is:
|
Also, define what an invalid time is. In issue #58, we decided on |
For future reference, we removed the use of |
Note that https://heycam.github.io/webidl/#idl-Date already has the text about ECMAScript consistency. If we do need a definition of time, perhaps the Common definitions section of the Web IDL spec would be an appropriate place. |
Yes, a type like |
Looks like the DOM standard is also expecting a DOMTimeStamp to be defined ( |
@travisleithead or @plehegar - Can you provide an update on the WebIDL issue 2 and recommend how we should proceed here? Do we wait for Issue-2 to be processed? |
In the absence of a response on the WebIDL status, I suggest we address this as follows: |
Can @travisleithead and/or @plehegar please comment on @mwatson2's proposal? |
DOMTimeStamp is part of https://www.w3.org/TR/WebIDL-1/#common-DOMTimeStamp |
Web IDL bug 22824 has been fixed, removing Therefore, I propose we resolve this similar to my proposal on October 14th but address the last two bullets by borrowing the relevant text deleted from Web IDL. I'm not sure we need to track this for VNext. If/when Web IDL gets a definition, we can choose to update the spec to refer to it. |
I intend to work this soon, implementing the plan proposed by David:
|
There is some debate in Mozilla's bug tracker about the correct interpretation of this change. https://bugzilla.mozilla.org/show_bug.cgi?id=1324925 The current spec text says: "Time is intended to be consistent with Unix time". The definition of Unix Time on Wikipedia says: "Unix time ... is a system for describing instants in time, defined as the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970, not counting leap seconds." This would lead me to believe that session expirations were meant to be in seconds. Mozilla thought the same and changed the implementation to seconds. Chrome still reports milliseconds. Is Chrome behind the spec? Or was Mozilla misled by spec text which needs to be clarified? If the intent was to have the value in milliseconds, it might be helpful for the spec to state a unit explicitly. A double with "millisecond accuracy" could still conceivably be in units of seconds. If there is a consensus that the intent was to use milliseconds, I would be happy to send a PR to make it explicit. |
Yes, it is intended to be in milliseconds. Not because that accuracy is important but because it is consistent with ECMAScript Date objects ("A Date object contains a Number indicating a particular instant in time to within a millisecond.") and it should be easy to create a Date object from values exposed by this API. Presumably, this should be true for all web APIs dealing with absolute times, though I'm not aware of such a definition (as we would have preferred). See also whatwg/webidl#2. The first paragraph of the Time definition seems clear to me:
The Unix time reference could be misleading and unnecessary. The linked reference in the original report has changed, so I don't know what was there before. I think this reference may have been related to the epoch and whether leap seconds are included. Proposals to clarify this section are welcome. It may be sufficient to just reference https://tc39.github.io/ecma262/#sec-time-values-and-time-range, which appears to address all the related issues. We should also replace the unofficial and now redirected URL in the EME spec with this URL. |
Well, it just makes the spec self-conttradictory, because ES time and Unix time aren't consistent with each other.
If that's what you meant, that's what you should have done, yes. |
I'll update Firefox's implementation to report the expiration in milliseconds not seconds. |
I opened #370 to track the issues above and others related to time. |
The
expiration
attribute is currently defined asThis could be interpreted as including leap seconds, which would appear to be inconsistent with ECMAScript and
Date()
, which appear to expect Unix time.Ideally, there would be a definition of time that all specs could point to. I'll follow up with Web IDL.
The text was updated successfully, but these errors were encountered: