- From: Said Abou-Hallawa via GitHub <noreply@w3.org>
- Date: Tue, 16 Sep 2025 22:27:08 +0000
- To: public-svg-issues@w3.org
shallawa has just created a new issue for https://github.com/w3c/svgwg: == Computing filterRegion and primitiveSubregion when referencing the filter from an outsider element == **What problem are you trying to solve?** Browsers may disagree when computing `filterRegion` and `filterUnits = "userSpaceOnUse"` and when computing `primitiveSubregion` and `primitiveUnits="userSpaceOnUse"`. The disagreement happens when the referencing element is an outsider element (i.e. an element which is not descendant to the same SVG root of the referenced SVG filter). Consider this example: ``` <svg width="0" height="0" style="position: absolute;"> <filter id="filter" primitiveUnits="userSpaceOnUse"> <feFlood flood-color="green" width="100%" height="100%" /> </filter> </svg> <svg width="300" height="300"> <rect x="10" y="10" width="100" height="100" filter="url(#filter)" /> </svg> <div style="width: 100px; height: 100px; filter: url(#filter);"></div> ``` The spec is not clear on how the `width="100%"` and `height="100%"` are resolved in this case. The boundingBox of the referenced SVG is an empty rectangle. What solutions exist today? It seems the browsers adopt one of these solutions: - The boundingBox of the referenced SVG is used to resolve the percentage lengths. - The boundingBox of the referencing SVG or the boundingBox of the target element is used to resolve the percentage lengths. How would you solve it? The boundingBox of the target element is used to resolve the percentage lengths. This is guaranteed not be empty rectangle. Please view or discuss this issue at https://github.com/w3c/svgwg/issues/1012 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 16 September 2025 22:27:09 UTC