Skip to content

script : Return PerformanceMark object from the Performance.mark()#44199

Merged
xiaochengh merged 2 commits into
servo:mainfrom
shubhamg13:PerformanceMark
Apr 14, 2026
Merged

script : Return PerformanceMark object from the Performance.mark()#44199
xiaochengh merged 2 commits into
servo:mainfrom
shubhamg13:PerformanceMark

Conversation

@shubhamg13

@shubhamg13 shubhamg13 commented Apr 14, 2026

Copy link
Copy Markdown
Member

This returns the PerformanceMark object from Performance.mark()

Testing: More WPT tests passed

Signed-off-by: Shubham Gupta <shubham.gupta@chromium.org>
@shubhamg13 shubhamg13 requested a review from gterzian as a code owner April 14, 2026 09:09
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 14, 2026
Signed-off-by: Shubham Gupta <shubham.gupta@chromium.org>
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. 👍

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Apr 14, 2026
@xiaochengh xiaochengh enabled auto-merge April 14, 2026 09:18
@xiaochengh xiaochengh added this pull request to the merge queue Apr 14, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 14, 2026
Merged via the queue into servo:main with commit 4ff29fe Apr 14, 2026
30 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 14, 2026
@shubhamg13 shubhamg13 deleted the PerformanceMark branch April 14, 2026 10:33
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.

5 participants