-
Notifications
You must be signed in to change notification settings - Fork 172
DOMTimeStamp confusion #2
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
DOMTimeStamp exists because it was in DOM 2 Core and was used as the type of We could redefine it to being a |
What people want from a timestamp type is a good question to ask, though. :) |
EME is now also trying to use DOMTimeStamp (for absolute time comparisons, I believe). w3c/encrypted-media#59 |
Can we recommend to the EME folks to just use |
No, we should recommend using the correct types and then we can fix up the type definitionsin one place to benefit everyone. |
DOM no longer uses this. Geolocation API does though. |
We could transition Geolocation to using a relative timestamp (or just inline "unsigned long long" over on Geo to get rid of the typedef). I'm pretty open to whatever folks think is best. My worry from the geo side is that devs will be relying on the current timestamp to make decisions about asking for a position refresh. |
I think it's fine to rely on this, though it should maybe move out of IDL. Perhaps we should put all web platform time things in hr-time to consolidate on that and also have a single place to make recommendations with regards which abstraction to pick. cc @yoavweiss |
Makes sense to me to have all time related definitions under a single spec. At the same time, it may expand the scope of the spec and I need to make sure WG folks are ok with that. I can bring it up in the next call. |
The WebPerfWG discussed this last week. We'd be fine with moving the definition over if we can do that without renaming HR-time nor changing its scope in the charter. Would that work? |
That seems fine. It's not clear to me it can be changed to a double though. Note that the other thing here would be to take some ownership of the questions raised in #2 (comment). |
Looking at users of this, I found:
Some of those seem pretty malleable still, but others are sufficiently baked in. At the same time, I'm not sure what breakage would look like if we switched them over to DOMHighResTimestamp, which is a double. |
Did somebody file an issue/PR against the tag design principles as well? https://w3ctag.github.io/design-principles/#times-and-dates says after all "When representing date-times on the platform, use the DOMTimeStamp type." |
Per discussions in whatwg/webidl#2.
Per discussions in whatwg/webidl#2.
Per discussions in whatwg/webidl#2.
I'd like to consolidate the suggestions above and formalize this as:
Anything else? |
If we are going to rename it, let's remove the DOM prefix. That went out of fashion quite a while ago. So just |
I put up a draft at w3c/hr-time#124 for review, plus and sent #1021. I'll send some PRs for Geo and Push. |
whatwg/notifications#171 is at least one case where compat would block us from moving all cases to |
We've put up a proposal for "EpochTimeStamp" at w3c/hr-time#124 ... would be great to get some feedback from folks here. |
Would changing |
@ExE-Boss I don't think so. Why would we want to do that? |
https://bugs.webkit.org/show_bug.cgi?id=231496 Reviewed by Sam Weinig. Source/WebCore: DOMTimeStamp was renamed EpochTimeStamp. There is no observable behavioral change - it's just a name change. Relevant WebIDL discussions/issue: - whatwg/webidl#2 Which lead to: - w3c/hr-time#124 * Headers.cmake: * Modules/geolocation/Geolocation.cpp: (WebCore::createGeolocationPosition): (WebCore::Geolocation::haveSuitableCachedPosition): * Modules/geolocation/GeolocationPosition.h: (WebCore::GeolocationPosition::create): (WebCore::GeolocationPosition::timestamp const): (WebCore::GeolocationPosition::GeolocationPosition): * Modules/geolocation/GeolocationPosition.idl: * Modules/notifications/Notification.idl: * Modules/push-api/PushSubscription.cpp: (WebCore::PushSubscription::PushSubscription): (WebCore::PushSubscription::expirationTime const): * Modules/push-api/PushSubscription.h: * Modules/push-api/PushSubscription.idl: * Modules/push-api/PushSubscriptionJSON.h: * Modules/push-api/PushSubscriptionJSON.idl: * Modules/push-api/PushSubscriptionOptions.h: * WebCore.xcodeproj/project.pbxproj: * bindings/scripts/IDLParser.pm: (addBuiltinTypedefs): * bindings/scripts/test/TestTypedefs.idl: * dom/EpochTimeStamp.h: Renamed from Source/WebCore/dom/DOMTimeStamp.h. (WebCore::convertSecondsToEpochTimeStamp): (WebCore::convertEpochTimeStampToSeconds): * testing/Internals.cpp: (WebCore::Internals::createPushSubscription): * testing/Internals.h: * testing/Internals.idl: Source/WebKitLegacy/mac: * DOM/DOMEvent.h: * DOM/DOMEvent.mm: (-[DOMEvent timeStamp]): * DOM/DOMObject.h: Source/WebKitLegacy/win: * DOMEventsClasses.cpp: (DOMEvent::timeStamp): * DOMEventsClasses.h: (DOMUIEvent::timeStamp): (DOMKeyboardEvent::timeStamp): (DOMMouseEvent::timeStamp): (DOMMutationEvent::timeStamp): (DOMOverflowEvent::timeStamp): (DOMWheelEvent::timeStamp): * Interfaces/DOMEvents.idl: Canonical link: https://commits.webkit.org/242783@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
What's the remaining work item here to keep this open as w3c/hr-time#124 is merged? |
Closes #2. It has been renamed to EpochTimeStamp and moved to https://w3c.github.io/hr-time/#the-epochtimestamp-typedef.
https://bugs.webkit.org/show_bug.cgi?id=231496 Reviewed by Sam Weinig. Source/WebCore: DOMTimeStamp was renamed EpochTimeStamp. There is no observable behavioral change - it's just a name change. Relevant WebIDL discussions/issue: - whatwg/webidl#2 Which lead to: - w3c/hr-time#124 * Headers.cmake: * Modules/geolocation/Geolocation.cpp: (WebCore::createGeolocationPosition): (WebCore::Geolocation::haveSuitableCachedPosition): * Modules/geolocation/GeolocationPosition.h: (WebCore::GeolocationPosition::create): (WebCore::GeolocationPosition::timestamp const): (WebCore::GeolocationPosition::GeolocationPosition): * Modules/geolocation/GeolocationPosition.idl: * Modules/notifications/Notification.idl: * Modules/push-api/PushSubscription.cpp: (WebCore::PushSubscription::PushSubscription): (WebCore::PushSubscription::expirationTime const): * Modules/push-api/PushSubscription.h: * Modules/push-api/PushSubscription.idl: * Modules/push-api/PushSubscriptionJSON.h: * Modules/push-api/PushSubscriptionJSON.idl: * Modules/push-api/PushSubscriptionOptions.h: * WebCore.xcodeproj/project.pbxproj: * bindings/scripts/IDLParser.pm: (addBuiltinTypedefs): * bindings/scripts/test/TestTypedefs.idl: * dom/EpochTimeStamp.h: Renamed from Source/WebCore/dom/DOMTimeStamp.h. (WebCore::convertSecondsToEpochTimeStamp): (WebCore::convertEpochTimeStampToSeconds): * testing/Internals.cpp: (WebCore::Internals::createPushSubscription): * testing/Internals.h: * testing/Internals.idl: Source/WebKitLegacy/mac: * DOM/DOMEvent.h: * DOM/DOMEvent.mm: (-[DOMEvent timeStamp]): * DOM/DOMObject.h: Source/WebKitLegacy/win: * DOMEventsClasses.cpp: (DOMEvent::timeStamp): * DOMEventsClasses.h: (DOMUIEvent::timeStamp): (DOMKeyboardEvent::timeStamp): (DOMMouseEvent::timeStamp): (DOMMutationEvent::timeStamp): (DOMOverflowEvent::timeStamp): (DOMWheelEvent::timeStamp): * Interfaces/DOMEvents.idl: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@283912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DOMTimeStamp has a few questionable things I was hoping to get cleared up:
unsigned long long
, it cannot represent dates before 1970. Is that a desired property for a timestamp?unsigned long long
(or ideallynumber
, which would fix the 1970 restriction).I'd love to discuss the general problem of number types in WebIDL after I've had time to put together a more concrete proposal, but I am wondering if there's anything we can do to clean up the DOMTimeStamp corner of this mess.
The text was updated successfully, but these errors were encountered: