Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/script/dom/performance/performance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ impl PerformanceMethods<crate::DomTypeHolder> for Performance {
}

/// <https://w3c.github.io/user -timing/#dom-performance-mark>
fn Mark(&self, mark_name: DOMString) -> Fallible<()> {
fn Mark(&self, mark_name: DOMString) -> Fallible<DomRoot<PerformanceMark>> {
let global = self.global();
// NOTE: This should happen within the performancemark constructor
if global.is::<Window>() && INVALID_ENTRY_NAMES.contains(&&*mark_name.str()) {
Expand All @@ -659,7 +659,7 @@ impl PerformanceMethods<crate::DomTypeHolder> for Performance {
// TODO Step 3. Add entry to the performance entry buffer.

// Step 4. Return entry.
Ok(())
Ok(entry)
}

/// <https://w3c.github.io/user-timing/#dom-performance-clearmarks>
Expand Down
2 changes: 1 addition & 1 deletion components/script_bindings/webidls/Performance.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dictionary PerformanceMeasureOptions {
[Exposed=(Window,Worker)]
partial interface Performance {
[Throws]
undefined mark(DOMString markName);
PerformanceMark mark(DOMString markName);
undefined clearMarks(optional DOMString markName);
[Throws]
PerformanceMeasure measure(DOMString measureName, optional (DOMString or PerformanceMeasureOptions) startOrMeasureOptions = {}, optional DOMString endMark);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[mark-measure-feature-detection.html]
[Test PerformanceMeasure existence and feature detection]
expected: FAIL

[Test PerformanceMark existence and feature detection]
expected: FAIL

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Refer: #43753 (comment)

I will handle soon in follow-up PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ack

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe this functionality was implemented in #43990, so I'm not sure what this comment refers to.

@simonwuelker simonwuelker Apr 14, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

#43990 fixed another (unrelated) todo.

The performance.mark and performance.measure APIs sometimes return a value and sometimes they return nothing, depending on the version of the specification implemented. The test thinks that we implement L2, but we implement L3, just not fully.

See also the relevant test:

assert_equals(typeof(PerformanceMark.prototype), "object");
// Test for UserTiming L3.
if (PerformanceMark.prototype.hasOwnProperty('detail')) {
assert_equals(typeof(performance.mark("mark")), "object",
"performance.mark should return an object in UserTiming L3.");
}
// Test for UserTiming L2.
else {
assert_equals(typeof(performance.mark("mark")), "undefined",
"performance.mark should be void in UserTiming L2.");

Previously we never returned a value and didn't expose details (so we passed).
Now we always return a value, but still don't expose details (so we fail).
But presumably, returning the mark is less likely to break things than returning nothing.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, I found that too. 👍

14 changes: 0 additions & 14 deletions tests/wpt/meta/user-timing/mark-measure-return-objects.any.js.ini

This file was deleted.

18 changes: 0 additions & 18 deletions tests/wpt/meta/user-timing/measure-l3.any.js.ini
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
[measure-l3.any.html]
[When the end mark is given and the start is unprovided, the end time of the measure entry should be the end mark's time, the start time should be 0.]
expected: FAIL

[When the start mark is given and the end is unprovided, the start time of the measure entry should be the start mark's time, the end should be now.]
expected: FAIL

[When start and end mark are both given, the start time and end time of the measure entry should be the the marks' time, repectively]
expected: FAIL

[When start and end mark are both given, the start time and end time of the measure entry should be the marks' time, repectively]
expected: FAIL


[measure-l3.any.worker.html]
[When the end mark is given and the start is unprovided, the end time of the measure entry should be the end mark's time, the start time should be 0.]
expected: FAIL

[When the start mark is given and the end is unprovided, the start time of the measure entry should be the start mark's time, the end should be now.]
expected: FAIL

[When start and end mark are both given, the start time and end time of the measure entry should be the the marks' time, repectively]
expected: FAIL

[When start and end mark are both given, the start time and end time of the measure entry should be the marks' time, repectively]
expected: FAIL
Loading