v141 · miscellaneous

Support width and height as presentation attributes on nested <svg> elements

This feature supports applying width and height as presentation attributes on nested <svg> elements through both SVG markup and CSS. This dual approach provides even greater flexibility for developers, allowing them to manage and style SVG elements more efficiently within complex designs.

concepts

  1. Nested SVG W/H

    Nested <svg> elements now treat width/height as full presentation attributes — overridable by CSS. Matches the SVG2 spec; required for many design-system compositions.

  2. Responsive Icons

    Drag the stage and toggle attribute / CSS / unsized nested SVGs. The icon-library promise of pure-markup glyphs finally works in Chromium.

  3. Chart Composition

    Dashboard with three sub-charts (bar, donut, line) each sized by its own attribute. The pattern that needed CSS scaffolding before 141.

  4. SVG Sizing Calculator

    Paste an SVG snippet with nested <svg> elements and edit width/height attributes live. The tool shows the resolved intrinsic size, the CSS cascade value, and a before/after rendering comparing the Chromium 140 (broken) vs 141 (fixed) behaviour — useful for diagnosing layout regressions in icon systems.

why it shipped

The motivation for supporting width and height as presentation attributes on nested <svg> elements can be understood through several key points:

references