Skip to content

How should Container Timing attributes work? Could multiple observers have different views? #20

@mmocny

Description

@mmocny

The current proposal for container timing expands on element timing:

  • You apply a containertiming attribute to a node, giving it an id
  • You can also optionally apply settings to a sub-tree: ignore, transparent, shadowed.

But this sort of creates a single global perspective that all observers of the page timings must agree to.

For example, if a parent node opts to observe child timings, but then any child also opts to observe its own timings, right now the default proposal is to hide these timings from the parent container. This might be surprising if the two attributes aren't explicitly assigned by the same author.

(I think its potentially even worse with the ignore setting where this is decided globally).


There might also be differences of opinion of how to even construct the container timing "tree".

For example, a hypothetical future LCP algorithm might want to apply some default container timing setting for specific nodes (tables, svg, etc), but ignore all others.
This might differ than shape of the tree from an explicit opt-in from a site owner. And that might differ further from the default settings of a "custom component library" that measures timings for its components. Etc.


Proposal: could it be possible to establish the shape of the container tree, and settings (like transparent, shadowed, ignore) to specific observers of element timing, rather than applied directly to the dom nodes?

Another potential advantage of this might be: you can publish a dom with data-* attributes which help define container relationships, but this wouldn't actually do anything until an Observer is registered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions