From c4f405cb8b7e04cdc82cdef6fae99667f1e61572 Mon Sep 17 00:00:00 2001 From: npm1 Date: Thu, 5 Mar 2020 11:41:12 -0500 Subject: [PATCH] Clarify paints outside viewport FP and FCP must consider contents that are painted outside of the viewport. This is only relevant in odd edge cases and is done for simplicity and performance. Fixes https://github.com/w3c/paint-timing/issues/58 --- painttiming.bs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/painttiming.bs b/painttiming.bs index 669afee..d0d212d 100644 --- a/painttiming.bs +++ b/painttiming.bs @@ -57,14 +57,18 @@ Usage example {#example} Terminology {#sec-terminology} ============================== -Paint: the browser has performed a "paint" (or "render") when it has converted the render tree to pixels on the screen. +Paint: the user agent has performed a "paint" (or "render") when it has converted the render tree to pixels on the screen. This is formally defined as the when update the rendering happens in event loop processing. - NOTE: The rendering pipeline is very complex, and the timestamp should be the latest timestamp the browser is able to note in this pipeline (best effort). Typically the time at which the frame is submitted to the OS for display is recommended for this API. + NOTE: The rendering pipeline is very complex, and the timestamp should be the latest timestamp the user agent is able to note in this pipeline (best effort). Typically the time at which the frame is submitted to the OS for display is recommended for this API. -First Paint entry contains a {{DOMHighResTimeStamp}} reporting the time when the browser first rendered after navigation. This excludes the default background paint, but includes non-default background paint and the enclosing box of an iframe. This is the first key moment developers care about in page load – when the browser has started to render the page. +First Paint entry contains a {{DOMHighResTimeStamp}} reporting the time when the user agent first rendered after navigation. This excludes the default background paint, but includes non-default background paint and the enclosing box of an iframe. This is the first key moment developers care about in page load – when the user agent has started to render the page. -First Contentful Paint entry contains a {{DOMHighResTimeStamp}} reporting the time when the browser first rendered any text, image (including background images), non-white canvas or SVG. This excludes any content of iframes, but includes text with pending webfonts. This is the first time users could start consuming page content. +First Contentful Paint entry contains a {{DOMHighResTimeStamp}} reporting the time when the user agent first rendered any text, image (including background images), non-white canvas or SVG. This excludes any content of iframes, but includes text with pending webfonts. This is the first time users could start consuming page content. + +Whenever a user agent preemptively paints content outside of the viewport, those paints MUST be considered for First Paint and First Contentful Paint. + + NOTE: a user agent has freedom to choose their own strategy for painting. Such strategy could even be to never paint content that is outside of the viewport. Therefore, different user agents can have different behaviors for First Paint and First Contentful Paint in edge cases where the only content occurs outside of the viewport. The {{PerformancePaintTiming}} interface {#sec-PerformancePaintTiming} =======================================