-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PaintTimingMixin
, exposing interoperable + implementation defined paint timestamps
#108
Conversation
- `paintTime` (the end of "update the rendering phase") - `presentationTime` (an optional implementation-defined timestamp) `startTime` returns `presentationTime`, or `paintTime` if `presentationTime` is not implemented. Currently this `PaintTimingMixin` is only included in `PerformancePaintTiming`, but it will be included in `ElementTiming`, `LargestContentfulPaint`, `PerformanceEventTiming`, and `PerformanceLongAnimationFrameTiming` as a follow up. This is based on a resolution at the web performance working group. Minutes: https://docs.google.com/document/d/1ZWAUJZBJUvSUyShvKXNEU-cuCe47jpgbR69ckWZUTfI/edit?tab=t.0#heading=h.kb3idfbysfg7 Closes #62
PaintTimingMixin
, which exposes two timestamps:PaintTimingMixin
, exposing interoperable + implementation defined paint timestamps
index.bs
Outdated
|
||
The {{PaintTimingMixin/paintTime}} attribute's getter step is to return [=/this=]'s [=PaintTimingMixin/paint timing info=]'s [=paint timing info/rendering update end time=]. | ||
|
||
The {{PaintTimingMixin/presentationTime}} attribute's getter step is to return [=/this=]'s [=PaintTimingMixin/paint timing info=]'s [=paint timing info/implementation-defined presentation time=] if it is not null; Otherwise zero. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this return undefined if the implementation does not support the presentationTime
attribute? I thought that's why it was marked optional. Zero might be misinterpreted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
index.bs
Outdated
1. If |document|'s [=environment settings object/cross-origin isolated capability=] is false, then: | ||
1. Coarsen |paintTimingInfo|'s [=implementation-defined presentation time=] to the next multiple of 4 milliseconds, or coarser. | ||
1. Wait until the [=current high resolution time=] is |paintTimingInfo|'s [=implementation-defined presentation time=]. | ||
1. [=Queue a global task=] on the [=performance timeline task source=] given |document|'s [=relevant global object=] to |flushPaintTimings|. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably read "to execute |flushPaintTimings|
"
(or "call", "run", etc... but I think you need a verb.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks great
Add
PaintTimingMixin
, which exposes two timestamps:paintTime
(the end of "update the rendering phase")presentationTime
(an optional implementation-defined timestamp)startTime
returnspresentationTime
, orpaintTime
ifpresentationTime
is not implemented.Currently this
PaintTimingMixin
is only included inPerformancePaintTiming
, but it will be included inElementTiming
,LargestContentfulPaint
,PerformanceEventTiming
, andPerformanceLongAnimationFrameTiming
as a follow up.This is based on a resolution at the web performance working group. Minutes: https://docs.google.com/document/d/1ZWAUJZBJUvSUyShvKXNEU-cuCe47jpgbR69ckWZUTfI/edit?tab=t.0#heading=h.kb3idfbysfg7
Closes #62
Preview | Diff