Skip to content

Commit

Permalink
Bug 1735098 - Implement EpochTimeStamp from HR-Time r=edgar
Browse files Browse the repository at this point in the history
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
  • Loading branch information
marcoscaceres committed Nov 16, 2021
1 parent 1ad8c73 commit 0f403e1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion dom/bindings/parser/WebIDL.py
Expand Up @@ -8668,7 +8668,6 @@ def reset(self):

# Builtin IDL defined by WebIDL
_builtins = """
typedef unsigned long long DOMTimeStamp;
typedef (ArrayBufferView or ArrayBuffer) BufferSource;
"""

Expand Down
5 changes: 2 additions & 3 deletions dom/bindings/parser/tests/test_builtins.py
Expand Up @@ -14,7 +14,6 @@ def WebIDLTest(parser, harness):
attribute unsigned long u32;
attribute long long s64;
attribute unsigned long long u64;
attribute DOMTimeStamp ts;
};
"""
)
Expand All @@ -32,7 +31,7 @@ def WebIDLTest(parser, harness):
harness.check(iface.parent, None, "Interface has no parent")

members = iface.members
harness.check(len(members), 10, "Should be one production")
harness.check(len(members), 9, "Should be one production")

names = ["b", "s8", "u8", "s16", "u16", "s32", "u32", "s64", "u64", "ts"]
types = [
Expand All @@ -47,7 +46,7 @@ def WebIDLTest(parser, harness):
"UnsignedLongLong",
"UnsignedLongLong",
]
for i in range(10):
for i in range(9):
attr = members[i]
harness.ok(isinstance(attr, WebIDL.IDLAttribute), "Should be an IDLAttribute")
harness.check(
Expand Down
1 change: 1 addition & 0 deletions dom/imptests/idlharness.js
Expand Up @@ -416,6 +416,7 @@ IdlArray.prototype.assert_type_is = function(value, type)
return;

case "unsigned long long":
case "EpochTimeStamp":
case "DOMTimeStamp":
assert_equals(typeof value, "number");
assert_true(0 <= value, "unsigned long long is negative");
Expand Down
2 changes: 2 additions & 0 deletions dom/interfaces/base/domstubs.idl
Expand Up @@ -11,7 +11,9 @@ class nsWrapperCache;

[ptr] native nsWrapperCachePtr(nsWrapperCache);

// DOMTimeStamp is deprecated, use EpochTimeStamp instead.
typedef unsigned long long DOMTimeStamp;
typedef unsigned long long EpochTimeStamp;
typedef double DOMHighResTimeStamp;
typedef unsigned long long nsViewID;

Expand Down
3 changes: 3 additions & 0 deletions dom/webidl/Performance.webidl
Expand Up @@ -14,6 +14,9 @@
* W3C liability, trademark and document use rules apply.
*/

// DOMTimeStamp is deprecated, use EpochTimeStamp instead.
typedef unsigned long long DOMTimeStamp;
typedef unsigned long long EpochTimeStamp;
typedef double DOMHighResTimeStamp;
typedef sequence <PerformanceEntry> PerformanceEntryList;

Expand Down

0 comments on commit 0f403e1

Please sign in to comment.