[svgwg] Media fragment percent fallback should reference css-images-3 default object size instead of CSS 2.1 (#1136)

goldenboy777 has just created a new issue for https://github.com/w3c/svgwg:

== Media fragment percent fallback should reference css-images-3 default object size instead of CSS 2.1 ==
[SVG2 §16.3.2](https://svgwg.org/svg2-draft/linking.html#SVGFragmentIdentifiersDefinitions) currently says:
> Media fragments can be specified as "pixel:" (default) and "percent:". In the latter case the resulting 'viewBox' transformation is calculated against referenced SVG resolved size (width and height). When the host document cannot resolve the width and height of the SVG document, the used values for width and height should be calculated according to CSS rules for [calculating width and ratio for inline replaced elements](https://www.w3.org/TR/CSS2/visudet.html#inline-replaced-width).

There are two issues with this text:

- **CSS 2.1 reference leaves cases undefined.** The referenced section (CSS 2.1 §10.3.2) does not fully define how to resolve the size when only a natural aspect ratio is available (e.g., an SVG with a `viewBox` but no `width`/`height`). The [css-images-3 default sizing algorithm](https://www.w3.org/TR/css-images-3/#default-sizing) with a [default object size](https://www.w3.org/TR/css-images-3/#default-object-size) of 300×150 handles all cases clearly.

- **The algorithm should apply per-axis.** An SVG may have one specified dimension but not the other. The concrete object size algorithm from css-images-3 naturally handles this by applying the default only for unspecified dimensions.

### Proposed change:

**Replace:**

> When the host document cannot resolve the width and height of the SVG document, the used values for width and height should be calculated according to CSS rules for calculating width and ratio for inline replaced elements.

**With:**

> When the SVG document does not have a fully resolved natural size, the percent values should be resolved against the concrete object size as defined by the [default sizing algorithm](https://www.w3.org/TR/css-images-3/#default-sizing) (css-images-3), using a default object size of 300×150.


Firefox already implements this and Chromium is in the process of implementing it.
(This issue is mainly about updating the spec to cover all the cases)

Please view or discuss this issue at https://github.com/w3c/svgwg/issues/1136 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 16 June 2026 19:55:11 UTC