Closed Bug 1963464 Opened 1 year ago Closed 1 year ago

Implement `PaintTimingMixin` without the `presentationTime` as a first step

Categories

(Core :: DOM: Performance APIs, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: canova, Assigned: canova)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

This is the definition of PaintTimingMixin:

[Exposed=Window]
interface mixin PaintTimingMixin {
    readonly attribute DOMHighResTimeStamp paintTime;
    readonly attribute DOMHighResTimeStamp? presentationTime;
};

presentationTime returns an implementation-defined time. It is nullable and browsers might choose to not implement it. We would like to implement it eventually but it requires a lot of plumbing. So as a first step, we would like to implement the mixin without this attribute. And then as a second step we will implement it in 1950098.

This patch implements PaintTimingMixin with only the paintTime, without the
presentationTime. The presentationTime property is nullable in the spec and
the browsers might choose to not implement it. We would like to implement it
in the future, but we will do that as a follow-up.

Assignee: nobody → canaltinova
Status: NEW → ASSIGNED

We had to update the presentationTime checks because they were only checking
if it was undefined. But spec mentions presentationTime as nullable. So
"presentationTime" in entry will return true for browsers that implement the
PaintTimingMixin but choose to not implement the presentationTime property.

Pushed by canaltinova@gmail.com: https://hg.mozilla.org/integration/autoland/rev/2c1297577960 Initial implementation of PaintTimingMixin for the PaintTiming and LCP entries r=sefeng,webidl https://hg.mozilla.org/integration/autoland/rev/7272221822b0 Update the wpt test checks and the test expectations r=sefeng
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/52325 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
Upstream PR merged by moz-wptsync-bot
Regressions: 1964381

The implementation of paintTime should be documented at https://developer.mozilla.org/en-US/docs/Web/API/PerformancePaintTiming and https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint and their related browser compat data plus the release notes for Firefox 140.

One question, though: Nazım Can, the definition of the LargestContentfulPaint interface currently doesn't include the PaintTimingMixin. What's the reason for that?

Sebastian

Flags: needinfo?(canaltinova)

Good question. The LCP spec was updated in this PR to include the PaintTimingMixin. And in the source code I can see that line. But it appears that the rendered version is not updated...

I also see that Sean created an issue one month ago mentioning that the rendered version of the spec is not updated and still points to a version from Jan 2024: https://github.com/w3c/largest-contentful-paint/issues/130

So I believe it should be updated if we can trigger a build. I'll try to chase it.

Flags: needinfo?(canaltinova)

There was a build error. Let's see if this will fix it: https://github.com/w3c/largest-contentful-paint/pull/132

Looks like it's fixed after that PR. I can see the PaintTimingMixin in the idl definition now: https://w3c.github.io/largest-contentful-paint/#sec-largest-contentful-paint-interface

Perfect! Thank you for the quick fix!

Sebastian

Regressions: 1965441
Regressions: 1965555

The corresponding spec PR https://github.com/w3c/largest-contentful-paint/pull/126 removed renderTime from LargestContentfulPaint but we still have it, should there be a tracking bug?

Flags: needinfo?(canaltinova)

Good question, Kagami. I'm not so sure if that was intentional. I will reach out to the spec authors to double check this. But looking at the idl definition on Chrome, they still support renderTime, so even if that was intentional, I wouldn't remove it just now so we don't create an interop issue.

I filed bug 1966759 to track this.

Flags: needinfo?(canaltinova)

Ah, looks like you were faster than me: https://github.com/w3c/largest-contentful-paint/issues/133

QA Whiteboard: [qa-triage-done-c141/b140]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: