summaryrefslogtreecommitdiff
path: root/dom/webidl
diff options
context:
space:
mode:
authorFranklinDM <mrmineshafter17@gmail.com>2023-04-05 22:22:34 +0800
committerFranklinDM <mrmineshafter17@gmail.com>2023-04-10 18:22:53 +0800
commitd4138780ee267baf56250bb3a592419202553385 (patch)
treeeff468633e02e8277efc289c8694e826d0cc663a /dom/webidl
parent5fc711ba17cd86a7f168c159b551acdb598dbf1f (diff)
downloaduxp-d4138780ee267baf56250bb3a592419202553385.tar.gz
Issue #2053 - Part 2: Update PerformanceMeasure to User Timing L3
There are a few minor differences between this and Mozilla's implementation: (a) The type error messages were not hardcoded to the Performance class and were moved to Errors.msg instead. (b) PerformanceMeasureOptions is used directly and doesn't use the the Maybe<> container class. I haven't found the reason yet, but PerformanceMeasureOptions is disallowed from having a copy constructor and without that, it isn't possible to use it with Maybe<>... There doesn't seem to be any problem with using it directly, though. (c) Resist fingerprinting-pref changes were skipped. Partially based on https://bugzilla.mozilla.org/show_bug.cgi?id=1762482
Diffstat (limited to 'dom/webidl')
-rw-r--r--dom/webidl/Performance.webidl12
-rw-r--r--dom/webidl/PerformanceMeasure.webidl1
2 files changed, 12 insertions, 1 deletions
diff --git a/dom/webidl/Performance.webidl b/dom/webidl/Performance.webidl
index 16223065d0..e681505216 100644
--- a/dom/webidl/Performance.webidl
+++ b/dom/webidl/Performance.webidl
@@ -44,6 +44,14 @@ partial interface Performance {
entryType);
};
+// https://w3c.github.io/user-timing/#extensions-performance-interface
+dictionary PerformanceMeasureOptions {
+ any detail;
+ (DOMString or DOMHighResTimeStamp) start;
+ DOMHighResTimeStamp duration;
+ (DOMString or DOMHighResTimeStamp)end;
+};
+
// http://www.w3.org/TR/resource-timing/#extensions-performance-interface
[Exposed=Window]
partial interface Performance {
@@ -72,7 +80,9 @@ partial interface Performance {
[Func="Performance::IsEnabled"]
void clearMarks(optional DOMString markName);
[Func="Performance::IsEnabled", Throws]
- void measure(DOMString measureName, optional DOMString startMark, optional DOMString endMark);
+ PerformanceMeasure measure(DOMString measureName,
+ optional (DOMString or PerformanceMeasureOptions) startOrMeasureOptions,
+ optional DOMString endMark);
[Func="Performance::IsEnabled"]
void clearMeasures(optional DOMString measureName);
};
diff --git a/dom/webidl/PerformanceMeasure.webidl b/dom/webidl/PerformanceMeasure.webidl
index aa4e8cd256..a520778b88 100644
--- a/dom/webidl/PerformanceMeasure.webidl
+++ b/dom/webidl/PerformanceMeasure.webidl
@@ -10,4 +10,5 @@
[Exposed=(Window,Worker)]
interface PerformanceMeasure : PerformanceEntry
{
+ readonly attribute any detail;
};