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

Define the EpochTimeStamp typedef #124

Merged
merged 5 commits into from Oct 9, 2021
Merged

Conversation

marcoscaceres
Copy link
Member

@marcoscaceres marcoscaceres commented Sep 9, 2021

Closes #123

See whatwg/webidl#2 for discussion. Bugs have been filed with the relevant specifications telling them to move away from using DOMTimeStamp.

In particular, if the change results in potential backwards compatibility issues and content breakage, it needs to be justified.

As this is a typedef, it has no impact on web compat itself.

For normative spec changes, please get implementation commitments anf file issues on the various engines during the review process. All tasks should be complete before merging.

Implementation commitment - primarily for "change" and other normative changes:

Tasks:

  • [Added tests] - WPT will handle this automatically once each dependent spec is updated.

Preview | Diff

index.html Outdated Show resolved Hide resolved
@yoavweiss
Copy link
Contributor

Maybe instead of calling this LegacyTimestamp we can just call it EpochTimestamp? That's the functional difference between it and DOMHighResTimestamp, which could be useful for some, even in the future.

@marcoscaceres marcoscaceres changed the title Define the LegacyTimeStamp typedef Define the EpochTimeStamp typedef Sep 29, 2021
index.html Outdated
<li>If |epoch| was not passed, set |epoch| to 00:00:00 UTC on 1 January
1970.
</li>
<li>Return the number of milliseconds from |epoch| to the current time.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ECMAScript spec uses "current time", so I just went with that... is that ok?

@marcoscaceres marcoscaceres marked this pull request as ready for review October 1, 2021 01:36
index.html Outdated Show resolved Hide resolved
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. My main feedback is on the algorithm, along similar lines to @yoavweiss's remark.

index.html Outdated Show resolved Hide resolved
Copy link
Contributor

@yoavweiss yoavweiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, the one thing you might want to add is an Assert that the time passed is after 1970. Probably no need for a before assert as it's so far into the future...

@marcoscaceres
Copy link
Member Author

@annevk, ok to merge?

@annevk
Copy link
Member

annevk commented Oct 8, 2021

Yeah!

@marcoscaceres marcoscaceres merged commit 160cde6 into gh-pages Oct 9, 2021
@marcoscaceres marcoscaceres deleted the legacyTimestamp branch October 9, 2021 08:38
index.html Show resolved Hide resolved
@marcoscaceres
Copy link
Member Author

@yoavweiss
Copy link
Contributor

Chromium bug

@marcoscaceres
Copy link
Member Author

File webkit bug and updated the template.

webkit-commit-queue pushed a commit to WebKit/WebKit that referenced this pull request Oct 11, 2021
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
@marcoscaceres
Copy link
Member Author

cdumez updated WebKit already 🤯: https://bugs.webkit.org/show_bug.cgi?id=231496

bertogg pushed a commit to Igalia/webkit that referenced this pull request Oct 19, 2021
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
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Nov 16, 2021
Add the EpochTimeStamp, which can be used to incrementally rename/remove DOMTimeStamp. See also w3c/hr-time#124 and whatwg/webidl#1021

Differential Revision: https://phabricator.services.mozilla.com/D128030
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Nov 16, 2021
Add the EpochTimeStamp, which can be used to incrementally rename/remove DOMTimeStamp. See also w3c/hr-time#124 and whatwg/webidl#1021

Differential Revision: https://phabricator.services.mozilla.com/D128030
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Nov 16, 2021
Add the EpochTimeStamp, which can be used to incrementally rename/remove DOMTimeStamp. See also w3c/hr-time#124 and whatwg/webidl#1021

Differential Revision: https://phabricator.services.mozilla.com/D128030
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Nov 18, 2021
Add the EpochTimeStamp, which can be used to incrementally rename/remove DOMTimeStamp. See also w3c/hr-time#124 and whatwg/webidl#1021

Differential Revision: https://phabricator.services.mozilla.com/D128030
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define LegacyTimeStamp
4 participants