The Container Timing API is an experimental browser API (currently in Chrome origin trial, versions 148–153) that lets developers annotate DOM regions with a `containertiming` attribute and receive PerformanceObserver entries as new contentful parts of that region paint. Unlike Element Timing, which measures a single element, Container Timing accumulates paint data across an entire component subtree, reporting `firstRenderTime`, cumulative `size`, `lastPaintedElement`, and more. Key caveats: the browser never signals when a container is 'finished', paint is not the same as interactivity, and the `size` property is not a percentage of completion. Practical use cases include ecommerce buy boxes, search result grids, dashboards, and publisher lead packages. The post covers how to set up the observer, how to collect and interpret the paint sequence, how to use `containertiming-ignore` for non-critical descendants, and how to enable the feature locally or via origin trial token. Mozilla has a positive standards position; WebKit's position is still open.

21m read timeFrom csswizardry.com
Post cover image
Table of contents
What Problem Does Container Timing Solve?How the Container Timing API WorksWhat Counts as an Update?A Container Is Never Necessarily ‘Finished’Container Timing vs. Element TimingRealistic Uses for Container TimingWhat Container Timing Is NotTrying the Chrome Origin TrialBrowser Support and StandardisationWhat I Would Measure FirstFrequently Asked Questions
2.7K Impressions