Consider using the "content-visibility" property as a progressive performance enhancement

Created on 29 January 2024, 4 months ago
Updated 3 May 2024, 15 days ago

Problem/Motivation

Google has called this property out in https://web.dev/articles/dom-size-and-interactivity#use_the_content-visi... and our initial render timing findings on pages with an extreme number of hidden-by-default DOM nodes is quite dramatic.

The `content-visibility` property will prevent user-agents from evaluating certain DOM nodes and descendants based on a heuristic.

Accessibility considerations

Since DOM node evaluation may be skipped by this property, extra care should be used such that there aren't any accessibility regressions. For example, it's probably not a good use of this property to apply to a <footer> element, as it may remove the footer landmark from the accessibility tree and awkwardly blink into the tree as a user is scrolling down the page without warning...however for certain patterns, like toggleable content (such as hamburger-like-menus, or accordions), this could be useful.

Proposed resolution

  1. Discuss
  2. Find places in core which might benefit from the change -- perhaps in hamburger menus?
  3. Benchmark the impact of said changes (note, the magnitude of the change is like in the order of milliseconds, except for extreme cases)

User interface changes

None

API changes

None

Data model changes

None

🌱 Plan
Status

Active

Version

11.0 πŸ”₯

Component
CSSΒ  β†’

Last updated about 12 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States Luke.Leber Pennsylvania

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Production build 0.67.2 2024