Implement `PaintTimingMixin` without the `presentationTime` as a first step
Categories
(Core :: DOM: Performance APIs, enhancement)
Tracking
()
| 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.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
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.
Updated•1 year ago
|
| Assignee | ||
Comment 2•1 year ago
|
||
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.
Comment 5•1 year ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/2c1297577960
https://hg.mozilla.org/mozilla-central/rev/7272221822b0
Comment 7•1 year ago
•
|
||
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
| Assignee | ||
Comment 8•1 year ago
|
||
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.
| Assignee | ||
Comment 9•1 year ago
|
||
There was a build error. Let's see if this will fix it: https://github.com/w3c/largest-contentful-paint/pull/132
| Assignee | ||
Comment 10•1 year ago
|
||
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
Comment 11•1 year ago
|
||
Perfect! Thank you for the quick fix!
Sebastian
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?
| Assignee | ||
Comment 13•1 year ago
|
||
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.
| Assignee | ||
Comment 14•1 year ago
|
||
Ah, looks like you were faster than me: https://github.com/w3c/largest-contentful-paint/issues/133
Updated•1 year ago
|
Description
•