cookie-store icon indicating copy to clipboard operation
cookie-store copied to clipboard

Consider using DOMHighResTimestamp instead of DOMTimeStamp

Open yoavweiss opened this issue 4 years ago • 5 comments

We're considering our options RE DOMTimeStamp, and wondering what it's used for. It seems less well-defined than DOMHighResTimestamp. Would y'all consider switching over?

See heycam/webidl#2 for discussion.

yoavweiss avatar Aug 31 '21 08:08 yoavweiss

I think that's fine. This may require updating these definitions a bit:

https://wicg.github.io/cookie-store/#dom-cookieinit-expires - change the type https://wicg.github.io/cookie-store/#dom-cookielistitem-expires - change the type https://wicg.github.io/cookie-store/#as-a-timestamp - fine as is? https://wicg.github.io/cookie-store/#date-serialize - just change the type name? https://wicg.github.io/cookie-store/#delete-a-cookie - talks about "earliest representable date" ... probably still okay

inexorabletash avatar Aug 31 '21 15:08 inexorabletash

DOMTimeStamp is gone now https://github.com/whatwg/webidl/pull/1021 so someone needs to put up a PR soon, I guess?

inexorabletash avatar Oct 19 '21 22:10 inexorabletash

cc: @domenic - looks like this spec is still using it:

https://dontcallmedom.github.io/webidlpedia/names/CookieInit.html vs. https://dontcallmedom.github.io/webidlpedia/names/DOMTimeStamp.html

Is it because DOMTimeStamp? is not indexed or something?

inexorabletash avatar Oct 19 '21 23:10 inexorabletash

Oh jeez, my bad for merging early then. /Cc @dontcallmedom

It seems like cookies might actually need EpochTimeStamp instead of DOMHighResTimeStamp since they need to be compatible with JS Date.

domenic avatar Oct 19 '21 23:10 domenic

Yeah, EpochTimeStamp seems like a good fit - https://w3c.github.io/hr-time/#dom-epochtimestamp

I think https://w3c.github.io/hr-time/#dfn-epoch-relative-timestamp will let us remove some of the prose in https://wicg.github.io/cookie-store/#algorithms

inexorabletash avatar Oct 20 '21 15:10 inexorabletash