v148 · origin trial · performance api
Container Timing
A performance API that lets you measure when a named section of the DOM — a card, a widget, a news feed — first renders and when its last sub-element paints. Extends Element Timing from single elements to whole component trees.
chrome://flags/#enable-experimental-web-platform-features (the flag recorded by ChromeStatus and BCD) or launch Chrome with --enable-blink-features=ContainerTiming (the ContainerTiming entry in runtime_enabled_features.json5, which also allows third-party origin-trial tokens). For real users, register for the trial at developer.chrome.com/origintrials.
at a glance
| Origin trial | Chrome 148+ |
|---|---|
| Status | Origin trial (Experiment) |
| Specification | WICG Container Timing specification |
| Explainer | WICG/container-timing — GitHub explainer |
| Blog | Container Timing origin trial — Chrome for Developers |
| ChromeStatus | 5110962817073152 — Container Timing (API record) |
why it exists
The Element Timing API lets you observe when a single <img> or text block renders. But modern pages are built from components — a news card, a product widget, a comment thread — and what developers actually care about is when the whole component is ready, not just its headline image. Container Timing extends the same elementtiming / PerformanceObserver pattern to entire subtrees: mark a container with the containertiming attribute, and the browser reports the render timing of the container as a whole, tracking its constituent elements until all have painted.
shape of the API
Add the containertiming attribute to any element you want to measure. The attribute value becomes the identifier in the resulting PerformanceContainerTiming performance entry:
<section containertiming="product-card">
<img src="product.jpg" alt="...">
<h2>Product Name</h2>
<p>Description...</p>
<button>Add to cart</button>
</section>
Formal syntax (Web IDL)
Verbatim from the Container Timing specification IDL index (Draft Community Group Report, 1 October 2026; the old wicg.github.io address now redirects there), plus the PaintTimingMixin it includes from Paint Timing §3.1:
[Exposed=Window]
interface PerformanceContainerTiming : PerformanceEntry {
readonly attribute DOMString identifier;
readonly attribute DOMRectReadOnly intersectionRect;
readonly attribute unsigned long long size;
readonly attribute DOMHighResTimeStamp firstRenderTime;
readonly attribute HTMLElement? lastPaintedElement;
readonly attribute HTMLElement? rootElement;
[Default] object toJSON();
};
PerformanceContainerTiming includes PaintTimingMixin;
partial interface HTMLElement {
[CEReactions, Reflect] attribute DOMString containerTiming;
[CEReactions, Reflect] attribute boolean containerTimingIgnore;
};
[Exposed=Window]
interface mixin PaintTimingMixin {
readonly attribute DOMHighResTimeStamp paintTime;
readonly attribute DOMHighResTimeStamp? presentationTime;
};
Chromium’s performance_container_timing.idl (main, read 2026-11-15) declares the same members behind RuntimeEnabled=ContainerTiming, with two type differences: size is a double and lastPaintedElement is an Element?. The two reflected attributes are declared in Chromium’s html_element.idl as Reflect=containertiming and Reflect=containertimingignore.
PerformanceEntry properties
| Property | Description |
|---|---|
entryType | "container" |
name / duration | Inherited from PerformanceEntry; always the empty string and 0 for container entries. |
identifier | The value of the containertiming attribute. |
startTime | The paint time of the most recent frame that added new area to the container’s painted region. Each new entry for the same container reports a later value. |
firstRenderTime | The paint time of the container’s first recorded paint (a DOMHighResTimeStamp). |
size | The total area, in square CSS pixels, of the container’s painted region: every newly painted rectangle unioned since the container was registered. Compare size between entries to filter out small changes. |
intersectionRect | A DOMRectReadOnly: the bounding rectangle of the painted region, in viewport CSS pixels. Rectangles are not adjusted if the container later moves. |
lastPaintedElement | The element that contributed the largest newly painted area in this frame, or null. The spec describes it as a debugging aid, not a metric. |
rootElement | The container root (the element carrying containertiming), or null. |
paintTime | From PaintTimingMixin: the rendering-update end time of the entry’s paint timing info. |
presentationTime | From PaintTimingMixin: the implementation-defined presentation time, or null when the browser does not expose one. |
toJSON() | Runs the default toJSON steps: returns a plain object with the entry’s attributes, suitable for JSON.stringify() and analytics beacons. Takes no arguments. |
HTML attributes
containertiming="<identifier>", reflected asHTMLElement.containerTiming(aDOMString): makes the element a container root. The value becomes the entry’sidentifier. Any string is accepted; nothing is validated and nothing throws.containertimingignore, reflected asHTMLElement.containerTimingIgnore(aboolean): marks the element and its descendants as an ignored subtree. Paints inside it do not count towards any ancestor container root. On a nested container root it also stops that root’s paints from reaching the outer container.
<div containertiming="feed">
<main>...</main>
<!-- Updates here never create "feed" entries -->
<aside containertimingignore>...</aside>
</div>
When entries are emitted
- A container root is registered when an element with
containertimingis connected to the document. Set the attribute before inserting the element: setting it later records only later paints. - Only image and text paints from light-DOM descendants count. Content inside a shadow tree or an ignored subtree does not.
- After each frame the browser queues at most one entry per container root, and only when the painted region grew. Even a 1-pixel increase queues an entry. Repainting an area that was already painted does not.
- Once the document has dispatched a scroll or input event, paints are no longer recorded. Entries already pending for that frame are still emitted.
- Removing the attribute or disconnecting the element drops its record. Adding it again (or reconnecting) starts a fresh painted region.
- A nested container root’s paints also update its nearest ancestor container root, unless the nested root has
containertimingignore.
Errors: no member throws. An unsupported browser ignores the attributes, and observe({ type: 'container' }) registers nothing (Chrome logs a console warning for an unknown entry type), so feature-detect with PerformanceObserver.supportedEntryTypes.includes('container').
example
Observe container render metrics using a buffered PerformanceObserver:
const observer = new PerformanceObserver((entryList) => {
for (const entry of entryList.getEntries()) {
console.log(`Container "${entry.identifier}" rendered`);
console.log(' First paint:', entry.firstRenderTime, 'ms');
console.log(' Last paint:', entry.startTime, 'ms');
console.log(' Painted area:', entry.size, 'px²');
// entry is a PerformanceContainerTiming; entry.entryType is "container"
console.log(' Entry type:', entry.entryType);
console.log(' Last painted element:', entry.lastPaintedElement);
}
});
observer.observe({ type: 'container', buffered: true });
Measuring multiple components
<!-- Mark each component you want to time -->
<div containertiming="hero-banner"> ... </div>
<ul containertiming="product-grid"> ... </ul>
<aside containertiming="sidebar-recs"> ... </aside>
// The observer receives separate entries for each identifier
const observer = new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
sendMetric(`render_${entry.identifier}`, entry.startTime);
}
});
observer.observe({ type: 'container', buffered: true });
Origin trial setup
<meta http-equiv="origin-trial" content="YOUR_TOKEN_HERE">
Live example
The Chrome Platform Showcase Container Timing page collects five interactive demos. The embed below is its Content Section Timer. It needs a Chrome build with the API enabled (see the warning above) to report real entries.
browser support
Per-version data from BCD api/PerformanceContainerTiming.json and the containerTiming / containerTimingIgnore entries in BCD api/HTMLElement.json (fetched 2026-11-15). Every interface member (identifier, intersectionRect, size, firstRenderTime, lastPaintedElement, rootElement, paintTime, presentationTime, toJSON()) has the same data as the interface.
| Browser | PerformanceContainerTiming | containerTiming / containerTimingIgnore | Notes |
|---|---|---|---|
| Chrome | 145 (behind a flag) | 145 (behind a flag) | BCD: preference #enable-experimental-web-platform-features; status experimental. Interim, from ChromeStatus (not in BCD): origin trial on desktop and Android, Chrome 148–153. |
| Edge | Mirrors Chrome | Mirrors Chrome | BCD "edge": "mirror" (same flag). Chrome origin-trial tokens are not recorded for Edge. |
| Firefox | 156 (behind a pref) | 156 (behind a pref) | BCD: dom.enable_container_timing set to true. Position: Positive (mozilla/standards-positions #1155). |
| Safari | Not supported | Not supported | BCD version_added: false. Position: Neutral (WebKit/standards-positions #442). |
BCD has no entry for the containertiming / containertimingignore HTML attributes themselves, only for their reflected IDL properties, and it does not record the Chrome origin trial. webstatus.dev rates the feature Baseline limited (queried 2026-11-15).
security and privacy
The spec’s §7 Security and Privacy Considerations says the API exposes nothing new beyond what Element Timing and Paint Timing already allow a page to estimate:
- Elements inside cross-origin iframes are never reported to the parent frame, and no timing crosses a frame boundary unless the page sends it with
postMessage(). - Only elements in the page’s own light DOM are measured. Shadow-tree content does not contribute.
- Timestamps are
DOMHighResTimeStampvalues, subject to the same reduced-resolution protections as other Performance APIs. - The API does not enable cross-site tracking or expose browsing history.
Treat identifier values as public: they are written into the page’s own markup and are visible to any script running on the page, including third-party analytics.