[SVG] Fix `<feImage>` rendering when referenced node contains hidden containers [chromium/src : main]

0 views
Skip to first unread message

Ragvesh Sharma (Gerrit)

unread,
Mar 18, 2026, 11:27:02 AM (4 days ago) Mar 18
to Virali Purbey, Fredrik Söderquist, Philip Rogers, Divyansh Mangal, Vinay Singh, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-revie...@chromium.org, blink-...@chromium.org, fmalit...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org
Attention needed from Divyansh Mangal, Fredrik Söderquist, Philip Rogers, Vinay Singh and Virali Purbey

Ragvesh Sharma added 58 comments

Commit Message
Line 7, Patchset 6:[SVG] Fix feImage rendering when referenced node contains hidden containers
Virali Purbey . resolved

nit: <feImage>

Ragvesh Sharma

Acknowledged

Line 9, Patchset 6:When an feImage references a node (via href) that contains hidden
Virali Purbey . resolved

nit: <feImage>

Ragvesh Sharma

Acknowledged

Line 9, Patchset 6:When an feImage references a node (via href) that contains hidden
Virali Purbey . resolved

nit: `href`

Ragvesh Sharma

Acknowledged

Line 13, Patchset 6:The root cause was that SourceToDestinationTransform() used
Divyansh Mangal . resolved

nit: add function name with quotes

Ragvesh Sharma

Acknowledged

Line 14, Patchset 6:HasViewportDependence() to decide whether to apply a viewport adjustment
Divyansh Mangal . resolved

nit: add function name with quotes

Ragvesh Sharma

Acknowledged

Line 15, Patchset 6:scale. HasViewportDependence() propagates up from all children,
Divyansh Mangal . resolved

nit: add function name with quotes

Ragvesh Sharma

Acknowledged

Line 18, Patchset 6:SelfHasRelativeLengths() == true, causing the parent <g> to have
Divyansh Mangal . resolved

nit: add function name with quotes

Ragvesh Sharma

Acknowledged

Line 20, Patchset 6:ComputeViewportAdjustmentScale(), replacing the normal filter scale with
Divyansh Mangal . resolved

nit: add function name with quotes

Ragvesh Sharma

Acknowledged

Line 23, Patchset 6:The fix introduces HasRenderedViewportDependence() which skips hidden
Divyansh Mangal . resolved

nit: add function name with quotes

Ragvesh Sharma

Acknowledged

Line 26, Patchset 6:visual geometry of the referenced element.
Virali Purbey . resolved

The entire problem is not solved in this case.

`ComputeViewportAdjustmentScale()` applies a single uniform scale to the entire referenced subtree. This correctly maps percentage-based lengths (e.g. width="100%") to the filter primitive subregion but distorts sibling elements using absolute units (e.g. width="60"). A proper fix would re-resolve percentage lengths per-element against the filter region rather than scaling the whole paint.

Consider the below case:

```
<g id="referenced">
<rect width="100%" height="100%" fill="lightblue"/> <!-- percentage → needs scaling -->
<rect x="50" y="40" width="60" height="100" fill="black"/> <!-- absolute → gets distorted -->
</g>
```
Ragvesh Sharma

Agreed — this is the pre-existing limitation tracked by `TODO(crbug/260709)`. Our CL correctly determines when to apply `ComputeViewportAdjustmentScale()` but doesn't change how it scales. Fixing the per-element re-resolution is a larger effort and out of scope for this bug fix

File third_party/blink/renderer/core/svg/graphics/filters/svg_fe_image.cc
Line 82, Patchset 6:static bool HasRenderedViewportDependence(const LayoutObject& object) {
Virali Purbey . resolved

nit: "Rendered" could be confused with "has a LayoutObject" in Blink terminology. Can we consider `HasVisibleViewportDependence` or `HasPaintedViewportDependence` to more clearly contrast with hidden containers?

Ragvesh Sharma

Acknowledged

Line 82, Patchset 6:static bool HasRenderedViewportDependence(const LayoutObject& object) {
Virali Purbey . resolved

Any reason why we are making this static?

Ragvesh Sharma

The function has been removed entirely in the updated patchset. The tree walk was replaced by a `HasVisibleViewportDependence()` bitfield on `LayoutObject`, computed during layout at O(1) cost.

Line 82, Patchset 6:static bool HasRenderedViewportDependence(const LayoutObject& object) {
Divyansh Mangal . resolved

nit: every other static function uses `layout_object` as parameter probably good to follow the same naming convention.

Ragvesh Sharma

`HasRenderedViewportDependence()` has been removed. The tree walk is replaced by a `HasVisibleViewportDependence()` bitfield on `LayoutObject`, so there's no static function or parameter anymore.

Line 83, Patchset 6: if (!object.HasViewportDependence() || object.IsSVGHiddenContainer()) {
Divyansh Mangal . resolved

If the root layout object is a hidden container (e.g., <g> containing a <rect> plus a hidden gradient), this early return skips checking children entirely even if the children include visible elements with viewport-relative lengths.

Fredrik Söderquist

Hidden containers will never end up producing any content though, so skipping children seems reasonable?

Ragvesh Sharma
As fs@ confirmed, hidden containers never produce any visible content — `LayoutSVGHiddenContainer::Paint()` is a final no-op. The early return was correct.

This is no longer applicable in the updated patchset — the tree walk has been replaced by the `HasVisibleViewportDependence()` bitfield, which is computed during layout in `SVGContentContainer::Layout()`. Hidden containers are excluded at propagation time, not at query time.
Line 87, Patchset 6: if (!object.SlowFirstChild()) {
return true;
}

// Check the root element's own relative lengths.
if (auto* element = DynamicTo<SVGElement>(object.GetNode())) {
if (element->SelfHasRelativeLengths()) {
return true;
}
}
Fredrik Söderquist . resolved

I think you could fold this into the loop (perhaps the above as well). Just start at the "root" instead of. This would avoid duplicating the predicate.

Ragvesh Sharma

Acknowledged. This is no longer applicable in the updated patchset — the tree walk function has been removed entirely. Viewport dependence excluding hidden containers is now computed as a `HasVisibleViewportDependence()` bitfield on `LayoutObject` during layout in `SVGContentContainer::Layout()`, making the check O(1) at read time.

Line 100, Patchset 6: current = current->IsSVGHiddenContainer()
Virali Purbey . resolved

nit: We could also skip subtrees where `HasViewportDependence()` is already false, since this flag propagates upward from children, if a node doesn't have it, no descendant can either:

```
current = (current->IsSVGHiddenContainer() || !current->HasViewportDependence())
? current->NextInPreOrderAfterChildren(&object)
: current->NextInPreOrder(&object)
```

This avoids descending into subtrees whose aggregate flag is already false. Not critical for this code path, but makes the intent clearer.

Fredrik Söderquist

👍

I suspect that this will read easier (and not repeat itself that much) if written as a `while`-loop.

Ragvesh Sharma

Both incorporated — but in a different way than suggested. The tree walk has been removed entirely in the updated patchset. Instead, `HasVisibleViewportDependence()` is now a `bitfield` on `LayoutObject`, computed during layout in `SVGContentContainer::Layout()` alongside the existing `HasViewportDependence()`.

This makes the check O(1) at paint time, eliminating the need for any loop, subtree skipping, or while-loop restructuring.

Line 100, Patchset 6: current = current->IsSVGHiddenContainer()
? current->NextInPreOrderAfterChildren(&object)
: current->NextInPreOrder(&object)) {
Divyansh Mangal . resolved

we have the check `current->IsSVGHiddenContainer()` at L:103 so why have this ternary operator?

Ragvesh Sharma

Acknowledged

Line 113, Patchset 6: if (auto* element = DynamicTo<SVGElement>(current->GetNode())) {
if (element->SelfHasRelativeLengths()) {
return true;
}
}
Fredrik Söderquist . resolved
I think it would be better to have this in the LayoutObject so that we can keep it in sync with what the layout code uses (and `SelfHasRelativeLengths()` is being dismantled). Since we're assuming containers here perhaps we could do something like:
```
auto* container = DynamicTo<LayoutSVGContainer>(*current);
// For containers, check the if it has dependencies by itself, else descend
// into it. For non-containers we know that they have viewport dependencies.
if (!container || container->SelfHasViewportDependence()) {
return true;
}
```
?
(where `SelfHasViewportDependence()` is a new function). And the `SlowFirstChild()` check could be eliminated.
Ragvesh Sharma

Done. `HasVisibleViewportDependence()` is now a bitfield on `LayoutObject`, computed during layout in `SVGContentContainer::Layout()` alongside the existing `HasViewportDependence()`. Hidden containers are excluded at propagation time. The tree walk function, `SelfHasRelativeLengths()` call, and `SlowFirstChild()` check have all been eliminated. Thanks for the suggestion — it led to a much cleaner O(1) solution.

Line 128, Patchset 1: if (HasRenderedViewportDependence(layout_object)) {
Vinay Singh . resolved

Runtime flag??

Ragvesh Sharma

This is a correctness fix for a rendering bug open since 2013 — it only affects cases where hidden containers (like <radialGradient>) falsely trigger viewport-dependent scaling. Elements without hidden container children are unaffected. Since this is strictly a bug fix with no intentional behavior change, I don't think a runtime flag is needed here. WDYT?

Divyansh Mangal

But the tree traversal will happen for most cases correct (apart from the early returns)?
I also agree a runtime-feature flag what be good to have here.

Vinay Singh

There is a performance regression angle here because of traversal that we are doing.
The runtime flag is a way to control the blast radius should that pose a problem for any niche use case that we are not considering now.

Ragvesh Sharma

Acknowledged

Line 144, Patchset 6: if (HasRenderedViewportDependence(layout_object)) {
Divyansh Mangal . resolved

Since the bit `HasViewportDependence()` contains information of viewport dependency from all children, including hidden containers. Should we instead create a new bit field, lets say `HasViewportDependenceExcludingHiddenContainers`
which excludes hidden containers?

what I am suggesting instead of a tree traversal like done here, we can cache the value needed like just what `HasViewportDependence` does. Benefit of that we won't require the tree traversal here. But let me know your thoughts on this we can ask owners as well for thier opinions as well.

Vinay Singh

+1

The argument here would be that for an SVG element deeply embeeded into a large SVG will invoke the tree traversal aggresively multiple times for say a JS animated SVG.
We should focus on retaining this information in a quickly accesible single fields like a bitfield.

Ragvesh Sharma

Acknowledged

File third_party/blink/web_tests/external/wpt/svg/render/reftests/feImage-with-hidden-container-ref.html
File-level comment, Patchset 6:
Fredrik Söderquist . resolved

Consider if you can make the test so that the reference does not need to use `<filter>` at all. (if it could just be a green 100x100 that'd be great.)

Ragvesh Sharma

Done

Line 6, Patchset 6:<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
Virali Purbey . resolved

Remove this.

Ragvesh Sharma

Acknowledged

Line 8, Patchset 6: <filter filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
Virali Purbey . resolved

Please remove this.

Ragvesh Sharma

Acknowledged

Line 9, Patchset 6: id="flt1" x="0" y="0" width="160" height="180">
Virali Purbey . resolved

Not needed.

Ragvesh Sharma
Actually, x="0" y="0" are not the default values for the <filter> element. Per the Filter Effects spec (https://www.w3.org/TR/filter-effects-1/) and MDN (
https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/filter), the defaults are x="-10%" and y="-10%" (with width="120%" and height="120%"). This padding exists
so that filter effects like <feGaussianBlur> aren't clipped at the element boundary.

Without explicit x="0" y="0", the filter region shifts to a negative offset (e.g., x=-40 for a 400px viewport), which mispositions the <feImage> output. We need these
attributes to anchor the filter region at the origin so it matches the reference.
Line 10, Patchset 6: <feImage xlink:href="#img1"/>
Virali Purbey . resolved

`href`

Ragvesh Sharma

Acknowledged

Line 4, Patchset 6:
<!-- Reference 1 (no hidden container) -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="400" height="180">
<filter filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
id="flt1" x="0" y="0" width="160" height="180">
<feImage xlink:href="#img1"/>
</filter>
<rect filter="url(#flt1)" width="160" height="180"/>
<g transform="translate(200 0)">
<g id="img1">
<rect width="160" height="180" fill="lightblue"/>
<rect x="50" y="40" width="60" height="100" fill="black"/>
</g>
</g>
</svg>
Divyansh Mangal . resolved

This can be updated as (if my above comments are accepted):

```
<!-- Reference 1 (no hidden container) -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="180">
<g>
<rect width="160" height="180" fill="lightblue"/>
<rect x="50" y="40" width="60" height="100" fill="black"/>
</g>
</svg>
```
Ragvesh Sharma

Done

Line 22, Patchset 6:<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
Virali Purbey . resolved

Remove the same as above test for all the refs as well.

Ragvesh Sharma

Acknowledged

Line 21, Patchset 6:<!-- Reference 2 (no hidden container) -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="400" height="180">
<filter filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
id="flt2" x="0" y="0" width="160" height="180">
<feImage xlink:href="#img2"/>
</filter>
<rect filter="url(#flt2)" width="160" height="180"/>
<g transform="translate(200 0)">
<g id="img2">
<rect width="160" height="180" fill="lightblue"/>
<rect x="50" y="40" width="60" height="100" fill="black"/>
</g>
</g>
</svg>
Divyansh Mangal . resolved

same as above

Ragvesh Sharma

Acknowledged

Line 38, Patchset 6:<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="400" height="180">
<filter filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
id="flt3" x="0" y="0" width="160" height="180">
<feImage xlink:href="#img3"/>
</filter>
<rect filter="url(#flt3)" width="160" height="180"/>
<g transform="translate(200 0)">
<g id="img3">
<rect width="160" height="180" fill="lightblue"/>
<rect x="50" y="40" width="60" height="100" fill="black"/>
</g>
</g>
</svg>
Divyansh Mangal . resolved

same as above

Ragvesh Sharma

Acknowledged

Line 52, Patchset 6:
<!-- Reference 4 (no hidden container, but has viewport-relative length) -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="400" height="180">
<filter filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
id="flt4" x="0" y="0" width="160" height="180">
<feImage xlink:href="#img4"/>
</filter>
<rect filter="url(#flt4)" width="160" height="180"/>
<g transform="translate(200 0)">
<g id="img4">
<rect width="100%" height="100%" fill="lightblue"/>
<rect x="50" y="40" width="60" height="100" fill="black"/>
</g>
</g>
</svg>
Divyansh Mangal . resolved

same as above

Ragvesh Sharma

Acknowledged

File third_party/blink/web_tests/external/wpt/svg/render/reftests/feImage-with-hidden-container.html
File-level comment, Patchset 6:
Fredrik Söderquist . resolved

I guess this would sort under `css/filter-effects/` - not `svg/`?

Ragvesh Sharma

Done

Line 1, Patchset 6:<!DOCTYPE html>
Divyansh Mangal . resolved

Do we require test for `pattern`/`mask` elements?

Ragvesh Sharma

Acknowledged

Line 3, Patchset 6:<link rel="help" href="https://www.w3.org/TR/filter-effects-1/#feImageElement">
<link rel="match" href="feImage-with-hidden-container-ref.html">
Divyansh Mangal . resolved

add an author link like this
`<link rel="author" title="Divyansh Mangal" href="mailto:dma...@microsoft.com">`

Ragvesh Sharma

Acknowledged

Line 7, Patchset 6:<!-- Test 1: radialGradient -->
Virali Purbey . resolved

Can we add different test cases in different files for simplicity?

Ragvesh Sharma

Acknowledged

Line 8, Patchset 6:<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
Virali Purbey . resolved

Remove this.

Ragvesh Sharma

Acknowledged

Line 10, Patchset 6: <filter filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
Virali Purbey . resolved

This is not needed as it is the default value.

Ragvesh Sharma
Done. Removed — the default for `primitiveUnits` is indeed `userSpaceOnUse` per the Filter Effects spec (https://drafts.fxtf.org/filter-effects/#FilterElement) and MDN (
https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/primitiveUnits).
Line 11, Patchset 6: id="flt1" x="0" y="0" width="160" height="180">
Virali Purbey . resolved

This is not adding any value. Remove this.

Ragvesh Sharma
Actually, x="0" y="0" are not the default values for the <filter> element. Per the Filter Effects spec (https://www.w3.org/TR/filter-effects-1/) and MDN (
https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/filter), the defaults are x="-10%" and y="-10%" (with width="120%" and height="120%"). This padding exists
so that filter effects like <feGaussianBlur> aren't clipped at the element boundary.

Without explicit x="0" y="0", the filter region shifts to a negative offset (e.g., x=-40 for a 400px viewport), which mispositions the <feImage> output. We need these
attributes to anchor the filter region at the origin so it matches the reference.
Line 12, Patchset 6: <feImage xlink:href="#img1"/>
Virali Purbey . resolved

Can we just use `href`?

Ragvesh Sharma

Acknowledged

Line 15, Patchset 6: <g transform="translate(200 0)">
<g id="img1">
<radialGradient/>
<rect width="160" height="180" fill="lightblue"/>
<rect x="50" y="40" width="60" height="100" fill="black"/>
</g>
</g>
Divyansh Mangal . resolved

I think we can simply these tests, by just not rendering these rectnagles

For example this can be simplified as:

```
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="180">
<defs>
<g id="img1">
<radialGradient/>
<rect width="160" height="180" fill="lightblue"/>
<rect x="50" y="40" width="60" height="100" fill="black"/>
</g>
</defs>

<filter filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
id="flt1" x="0" y="0" width="160" height="180">
<feImage xlink:href="#img1"/>
</filter>
<rect filter="url(#flt1)" width="160" height="180"/>
</svg>
```

You can then simplify portion in ref file by simply not having the filter code at all.

Ragvesh Sharma

Done. Tests now use `<defs>` to wrap the referenced `<g>` and `<filter>`, rendering only via `<rect filter="url(#flt)">`. The reference files have been simplified to plain `<rect>` elements with no `<filter>` code.

Line 8, Patchset 6:<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="400" height="180">
<filter filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
id="flt1" x="0" y="0" width="160" height="180">
<feImage xlink:href="#img1"/>
</filter>
<rect filter="url(#flt1)" width="160" height="180"/>
<g transform="translate(200 0)">
<g id="img1">
<radialGradient/>
<rect width="160" height="180" fill="lightblue"/>
<rect x="50" y="40" width="60" height="100" fill="black"/>
</g>
</g>
Divyansh Mangal . resolved

A second observation that I observed these behave differently in Firefox, it seems
The rectangle using the filter does not even gets rendered in Firefox, is that a bug on their end? what happens in Safari?

Fredrik Söderquist

IIRC, Gecko does not support `feImage` which reference an element.

Ragvesh Sharma

Acknowledged. As fs@ noted, Gecko does not support `<feImage>` referencing an element at all. Safari/WebKit has partial support for element references, but it's known to be buggy with viewport-dependent gaps and artifacts (WebKit Bug #266295 (https://bugs.webkit.org/show_bug.cgi?id=266295)).

Line 25, Patchset 6:<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
Virali Purbey . resolved

See above.

Ragvesh Sharma

Acknowledged

Line 27, Patchset 6: <filter filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
Virali Purbey . resolved

See above.

Ragvesh Sharma

Acknowledged

Line 28, Patchset 6: id="flt2" x="0" y="0" width="160" height="180">
Virali Purbey . resolved

This is not adding any value. Remove this.

Ragvesh Sharma
Actually, x="0" y="0" are not the default values for the <filter> element. Per the Filter Effects spec (https://www.w3.org/TR/filter-effects-1/) and MDN (
https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/filter), the defaults are x="-10%" and y="-10%" (with width="120%" and height="120%"). This padding exists
so that filter effects like <feGaussianBlur> aren't clipped at the element boundary.

Without explicit x="0" y="0", the filter region shifts to a negative offset (e.g., x=-40 for a 400px viewport), which mispositions the <feImage> output. We need these
attributes to anchor the filter region at the origin so it matches the reference.
Line 29, Patchset 6: <feImage xlink:href="#img2"/>
Virali Purbey . resolved

`href`

Ragvesh Sharma

Acknowledged

Line 24, Patchset 6:<!-- Test 2: linearGradient -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="400" height="180">
<filter filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
id="flt2" x="0" y="0" width="160" height="180">
<feImage xlink:href="#img2"/>
</filter>
<rect filter="url(#flt2)" width="160" height="180"/>
<g transform="translate(200 0)">
<g id="img2">
<linearGradient/>
<rect width="160" height="180" fill="lightblue"/>
<rect x="50" y="40" width="60" height="100" fill="black"/>
</g>
</g>
</svg>
Divyansh Mangal . resolved

please see above

Ragvesh Sharma

Done

Line 41, Patchset 6:<!-- Test 3: filter -->
Virali Purbey . resolved

Consider adding a test for <pattern> i.e another hidden container with percentage-based defaults.

Ragvesh Sharma

Acknowledged

Line 42, Patchset 6:<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
Virali Purbey . resolved

Remove this.

Ragvesh Sharma

Acknowledged

Line 44, Patchset 6: <filter filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
Virali Purbey . resolved

Remove this.

Ragvesh Sharma

Acknowledged

Line 45, Patchset 6: id="flt3" x="0" y="0" width="160" height="180">
Virali Purbey . resolved

This is not adding any value. Remove this.

Ragvesh Sharma
Actually, x="0" y="0" are not the default values for the <filter> element. Per the Filter Effects spec (https://www.w3.org/TR/filter-effects-1/) and MDN (
https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/filter), the defaults are x="-10%" and y="-10%" (with width="120%" and height="120%"). This padding exists
so that filter effects like <feGaussianBlur> aren't clipped at the element boundary.

Without explicit x="0" y="0", the filter region shifts to a negative offset (e.g., x=-40 for a 400px viewport), which mispositions the <feImage> output. We need these
attributes to anchor the filter region at the origin so it matches the reference.
Line 46, Patchset 6: <feImage xlink:href="#img3"/>
Virali Purbey . resolved

`href`

Ragvesh Sharma

Acknowledged

Line 40, Patchset 6:
<!-- Test 3: filter -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="400" height="180">
<filter filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
id="flt3" x="0" y="0" width="160" height="180">
<feImage xlink:href="#img3"/>
</filter>
<rect filter="url(#flt3)" width="160" height="180"/>
<g transform="translate(200 0)">
<g id="img3">
<filter/>
<rect width="160" height="180" fill="lightblue"/>
<rect x="50" y="40" width="60" height="100" fill="black"/>
</g>
</g>
</svg>
Divyansh Mangal . resolved

please see above

Ragvesh Sharma

Done

Line 58, Patchset 6:<!-- Test 4: hidden container + visible element with genuine viewport-relative length -->
Virali Purbey . resolved

Can we add a negative case where SVG viewport size is different from filter primitive subregion?

Ragvesh Sharma

Done. The `feImage-with-hidden-container-viewport-dependent.html` test covers this — SVG viewport is `400×180` while the filter primitive subregion is `160×180`. The referenced `<g>` contains both a `<radialGradient/>` (hidden container) and a `<rect width="100%">` (visible, viewport-dependent). This verifies that `ComputeViewportAdjustmentScale()` is correctly triggered by the visible element's percentage lengths while the hidden container's viewport dependence is excluded.

Line 59, Patchset 6:<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
Virali Purbey . resolved

Remove this.

Ragvesh Sharma

Acknowledged

Line 61, Patchset 6: <filter filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
Virali Purbey . resolved

Remove this.

Ragvesh Sharma

Acknowledged

Line 62, Patchset 6: id="flt4" x="0" y="0" width="160" height="180">
Virali Purbey . resolved

This is not adding any value. Remove this.

Ragvesh Sharma
Actually, x="0" y="0" are not the default values for the <filter> element. Per the Filter Effects spec (https://www.w3.org/TR/filter-effects-1/) and MDN (
https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Element/filter), the defaults are x="-10%" and y="-10%" (with width="120%" and height="120%"). This padding exists
so that filter effects like <feGaussianBlur> aren't clipped at the element boundary.

Without explicit x="0" y="0", the filter region shifts to a negative offset (e.g., x=-40 for a 400px viewport), which mispositions the <feImage> output. We need these
attributes to anchor the filter region at the origin so it matches the reference.
Line 63, Patchset 6: <feImage xlink:href="#img4"/>
Virali Purbey . resolved

`href`

Ragvesh Sharma

Acknowledged

Line 68, Patchset 6: <radialGradient/>
Virali Purbey . resolved

Should we also test a case `radialGradient` is defined in <defs>, a very common use to consider?

Ragvesh Sharma

Acknowledged

Line 57, Patchset 6:
<!-- Test 4: hidden container + visible element with genuine viewport-relative length -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="400" height="180">
<filter filterUnits="userSpaceOnUse" primitiveUnits="userSpaceOnUse"
id="flt4" x="0" y="0" width="160" height="180">
<feImage xlink:href="#img4"/>
</filter>
<rect filter="url(#flt4)" width="160" height="180"/>
<g transform="translate(200 0)">
<g id="img4">
<radialGradient/>
<rect width="100%" height="100%" fill="lightblue"/>
<rect x="50" y="40" width="60" height="100" fill="black"/>
</g>
</g>
</svg>
Divyansh Mangal . resolved

please see above

Ragvesh Sharma

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Divyansh Mangal
  • Fredrik Söderquist
  • Philip Rogers
  • Vinay Singh
  • Virali Purbey
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I973ddc053f31a00c808523a4e04495337ed5c668
Gerrit-Change-Number: 7665866
Gerrit-PatchSet: 8
Gerrit-Owner: Ragvesh Sharma <rags...@microsoft.com>
Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
Gerrit-Reviewer: Ragvesh Sharma <rags...@microsoft.com>
Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
Gerrit-CC: Stephen Chenney <sche...@chromium.org>
Gerrit-CC: Vinay Singh <vinay...@microsoft.com>
Gerrit-CC: Virali Purbey <virali...@microsoft.com>
Gerrit-Attention: Vinay Singh <vinay...@microsoft.com>
Gerrit-Attention: Philip Rogers <p...@chromium.org>
Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
Gerrit-Attention: Divyansh Mangal <dma...@microsoft.com>
Gerrit-Comment-Date: Wed, 18 Mar 2026 15:26:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Vinay Singh <vinay...@microsoft.com>
Comment-In-Reply-To: Ragvesh Sharma <rags...@microsoft.com>
Comment-In-Reply-To: Virali Purbey <virali...@microsoft.com>
Comment-In-Reply-To: Fredrik Söderquist <f...@opera.com>
Comment-In-Reply-To: Divyansh Mangal <dma...@microsoft.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Fredrik Söderquist (Gerrit)

unread,
Mar 18, 2026, 1:48:21 PM (4 days ago) Mar 18
to Ragvesh Sharma, Virali Purbey, Philip Rogers, Divyansh Mangal, Vinay Singh, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-revi...@chromium.org, kinuko...@chromium.org, jmedle...@chromium.org, zol...@webkit.org, blink-revie...@chromium.org, blink-...@chromium.org, fmalit...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org
Attention needed from Divyansh Mangal, Philip Rogers, Ragvesh Sharma, Vinay Singh and Virali Purbey

Fredrik Söderquist added 4 comments

File third_party/blink/renderer/core/svg/graphics/filters/svg_fe_image.cc
Line 128, Patchset 1: if (HasRenderedViewportDependence(layout_object)) {
Vinay Singh . unresolved

Runtime flag??

Ragvesh Sharma

This is a correctness fix for a rendering bug open since 2013 — it only affects cases where hidden containers (like <radialGradient>) falsely trigger viewport-dependent scaling. Elements without hidden container children are unaffected. Since this is strictly a bug fix with no intentional behavior change, I don't think a runtime flag is needed here. WDYT?

Divyansh Mangal

But the tree traversal will happen for most cases correct (apart from the early returns)?
I also agree a runtime-feature flag what be good to have here.

Vinay Singh

There is a performance regression angle here because of traversal that we are doing.
The runtime flag is a way to control the blast radius should that pose a problem for any niche use case that we are not considering now.

Ragvesh Sharma

Acknowledged

Fredrik Söderquist

I think this thread missed to weigh using up a bit on _all_ LayoutObjects to fix this fairly limited case. Having an additional bit also means more bookkeeping. And now there's also an additional virtual call in the main container layout function - which is _much_ more commonly called than the `<feImage>` code-path. Is this a good trade-off based on known quantities?

File third_party/blink/renderer/platform/runtime_enabled_features.json5
Line 5407, Patchset 8 (Latest): status: "experimental",
Fredrik Söderquist . unresolved

stable

File third_party/blink/web_tests/external/wpt/css/filter-effects/feImage-with-hidden-container-defs.html
File-level comment, Patchset 8 (Latest):
Fredrik Söderquist . unresolved

I'd still suggest making the test simpler. I'.e there should be no need to have multiple `<rect>`s if they both are of the same type. And if using multiple ones they could still be arranged such that the reference doesn't need to have multiple ones (or even any SVG at all - it could just be a div). As mentioned previously, I'd recommend just having all tests produce a 100x100 green square and either no text or text to match a known reference.

File third_party/blink/web_tests/external/wpt/css/filter-effects/feImage-with-hidden-container-viewport-dependent.html
File-level comment, Patchset 8 (Latest):
Fredrik Söderquist . unresolved

Is this test actually correct? I think it just codifies our currently (incorrect/buggy) behavior, no? In that case it shouldn't be added to WPT. At least not with an incorrect reference.

Open in Gerrit

Related details

Attention is currently required from:
  • Divyansh Mangal
  • Philip Rogers
  • Ragvesh Sharma
  • Vinay Singh
  • Virali Purbey
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I973ddc053f31a00c808523a4e04495337ed5c668
    Gerrit-Change-Number: 7665866
    Gerrit-PatchSet: 8
    Gerrit-Owner: Ragvesh Sharma <rags...@microsoft.com>
    Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
    Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
    Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
    Gerrit-Reviewer: Ragvesh Sharma <rags...@microsoft.com>
    Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
    Gerrit-CC: Stephen Chenney <sche...@chromium.org>
    Gerrit-CC: Vinay Singh <vinay...@microsoft.com>
    Gerrit-CC: Virali Purbey <virali...@microsoft.com>
    Gerrit-Attention: Vinay Singh <vinay...@microsoft.com>
    Gerrit-Attention: Ragvesh Sharma <rags...@microsoft.com>
    Gerrit-Attention: Philip Rogers <p...@chromium.org>
    Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
    Gerrit-Attention: Divyansh Mangal <dma...@microsoft.com>
    Gerrit-Comment-Date: Wed, 18 Mar 2026 17:48:04 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Vinay Singh <vinay...@microsoft.com>
    Comment-In-Reply-To: Ragvesh Sharma <rags...@microsoft.com>
    Comment-In-Reply-To: Divyansh Mangal <dma...@microsoft.com>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Ragvesh Sharma (Gerrit)

    unread,
    Mar 19, 2026, 9:52:58 AM (3 days ago) Mar 19
    to Virali Purbey, Fredrik Söderquist, Philip Rogers, Divyansh Mangal, Vinay Singh, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-revi...@chromium.org, kinuko...@chromium.org, jmedle...@chromium.org, zol...@webkit.org, blink-revie...@chromium.org, blink-...@chromium.org, fmalit...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org
    Attention needed from Divyansh Mangal, Fredrik Söderquist, Philip Rogers, Vinay Singh and Virali Purbey

    Ragvesh Sharma voted and added 4 comments

    Votes added by Ragvesh Sharma

    Auto-Submit+1
    Commit-Queue+2

    4 comments

    File third_party/blink/renderer/core/svg/graphics/filters/svg_fe_image.cc
    Line 128, Patchset 1: if (HasRenderedViewportDependence(layout_object)) {
    Vinay Singh . resolved

    Runtime flag??

    Ragvesh Sharma

    This is a correctness fix for a rendering bug open since 2013 — it only affects cases where hidden containers (like <radialGradient>) falsely trigger viewport-dependent scaling. Elements without hidden container children are unaffected. Since this is strictly a bug fix with no intentional behavior change, I don't think a runtime flag is needed here. WDYT?

    Divyansh Mangal

    But the tree traversal will happen for most cases correct (apart from the early returns)?
    I also agree a runtime-feature flag what be good to have here.

    Vinay Singh

    There is a performance regression angle here because of traversal that we are doing.
    The runtime flag is a way to control the blast radius should that pose a problem for any niche use case that we are not considering now.

    Ragvesh Sharma

    Acknowledged

    Fredrik Söderquist

    I think this thread missed to weigh using up a bit on _all_ LayoutObjects to fix this fairly limited case. Having an additional bit also means more bookkeeping. And now there's also an additional virtual call in the main container layout function - which is _much_ more commonly called than the `<feImage>` code-path. Is this a good trade-off based on known quantities?

    Ragvesh Sharma

    Agreed — using a bit on all LayoutObjects for this limited case isn't a good trade-off. The updated patchset removes the bitfield and all the layout bookkeeping. The check is now localized to `svg_fe_image.cc` — a walk of immediate children only when `HasViewportDependence()` is true, which keeps the fix contained to the `<feImage>` code-path with zero impact on the general layout path.

    File third_party/blink/renderer/platform/runtime_enabled_features.json5
    Line 5407, Patchset 8: status: "experimental",
    Fredrik Söderquist . resolved

    stable

    Ragvesh Sharma

    Done

    File third_party/blink/web_tests/external/wpt/css/filter-effects/feImage-with-hidden-container-defs.html
    File-level comment, Patchset 8:
    Fredrik Söderquist . resolved

    I'd still suggest making the test simpler. I'.e there should be no need to have multiple `<rect>`s if they both are of the same type. And if using multiple ones they could still be arranged such that the reference doesn't need to have multiple ones (or even any SVG at all - it could just be a div). As mentioned previously, I'd recommend just having all tests produce a 100x100 green square and either no text or text to match a known reference.

    Ragvesh Sharma

    Acknowledged

    File third_party/blink/web_tests/external/wpt/css/filter-effects/feImage-with-hidden-container-viewport-dependent.html
    File-level comment, Patchset 8:
    Fredrik Söderquist . resolved

    Is this test actually correct? I think it just codifies our currently (incorrect/buggy) behavior, no? In that case it shouldn't be added to WPT. At least not with an incorrect reference.

    Ragvesh Sharma

    Agreed — removed entirely.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Divyansh Mangal
    • Fredrik Söderquist
    • Philip Rogers
    • Vinay Singh
    • Virali Purbey
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I973ddc053f31a00c808523a4e04495337ed5c668
      Gerrit-Change-Number: 7665866
      Gerrit-PatchSet: 9
      Gerrit-Owner: Ragvesh Sharma <rags...@microsoft.com>
      Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
      Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
      Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
      Gerrit-Reviewer: Ragvesh Sharma <rags...@microsoft.com>
      Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
      Gerrit-CC: Stephen Chenney <sche...@chromium.org>
      Gerrit-CC: Vinay Singh <vinay...@microsoft.com>
      Gerrit-CC: Virali Purbey <virali...@microsoft.com>
      Gerrit-Attention: Vinay Singh <vinay...@microsoft.com>
      Gerrit-Attention: Philip Rogers <p...@chromium.org>
      Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
      Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
      Gerrit-Attention: Divyansh Mangal <dma...@microsoft.com>
      Gerrit-Comment-Date: Thu, 19 Mar 2026 13:52:47 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Vinay Singh <vinay...@microsoft.com>
      Comment-In-Reply-To: Ragvesh Sharma <rags...@microsoft.com>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Fredrik Söderquist (Gerrit)

      unread,
      Mar 19, 2026, 10:29:52 AM (3 days ago) Mar 19
      to Ragvesh Sharma, Virali Purbey, Philip Rogers, Divyansh Mangal, Vinay Singh, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-revi...@chromium.org, kinuko...@chromium.org, jmedle...@chromium.org, zol...@webkit.org, blink-revie...@chromium.org, blink-...@chromium.org, fmalit...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org
      Attention needed from Divyansh Mangal, Philip Rogers, Ragvesh Sharma, Vinay Singh and Virali Purbey

      Fredrik Söderquist added 2 comments

      Patchset-level comments
      File-level comment, Patchset 9 (Latest):
      Fredrik Söderquist . resolved

      Tests look good!

      File third_party/blink/renderer/core/svg/graphics/filters/svg_fe_image.cc
      Line 72, Patchset 9 (Latest): // Non-container leaf or a container with self-viewport-dependence.
      Fredrik Söderquist . unresolved

      But this we technically don't know? (Except if the container is empty.) I think this may need the the additional function that was brought up previously.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Divyansh Mangal
      • Philip Rogers
      • Ragvesh Sharma
      • Vinay Singh
      • Virali Purbey
      Submit Requirements:
        • requirement satisfiedCode-Coverage
        • requirement is not satisfiedCode-Owners
        • requirement is not satisfiedCode-Review
        • requirement is not satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: I973ddc053f31a00c808523a4e04495337ed5c668
        Gerrit-Change-Number: 7665866
        Gerrit-PatchSet: 9
        Gerrit-Owner: Ragvesh Sharma <rags...@microsoft.com>
        Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
        Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
        Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
        Gerrit-Reviewer: Ragvesh Sharma <rags...@microsoft.com>
        Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
        Gerrit-CC: Stephen Chenney <sche...@chromium.org>
        Gerrit-CC: Vinay Singh <vinay...@microsoft.com>
        Gerrit-CC: Virali Purbey <virali...@microsoft.com>
        Gerrit-Attention: Vinay Singh <vinay...@microsoft.com>
        Gerrit-Attention: Ragvesh Sharma <rags...@microsoft.com>
        Gerrit-Attention: Philip Rogers <p...@chromium.org>
        Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
        Gerrit-Attention: Divyansh Mangal <dma...@microsoft.com>
        Gerrit-Comment-Date: Thu, 19 Mar 2026 14:29:36 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        satisfied_requirement
        unsatisfied_requirement
        open
        diffy

        Ragvesh Sharma (Gerrit)

        unread,
        Mar 19, 2026, 1:25:07 PM (3 days ago) Mar 19
        to Virali Purbey, Fredrik Söderquist, Philip Rogers, Divyansh Mangal, Vinay Singh, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-revi...@chromium.org, kinuko...@chromium.org, jmedle...@chromium.org, zol...@webkit.org, blink-revie...@chromium.org, blink-...@chromium.org, fmalit...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org
        Attention needed from Divyansh Mangal, Fredrik Söderquist, Philip Rogers, Vinay Singh and Virali Purbey

        Ragvesh Sharma voted and added 1 comment

        Votes added by Ragvesh Sharma

        Auto-Submit+1

        1 comment

        File third_party/blink/renderer/core/svg/graphics/filters/svg_fe_image.cc
        Line 72, Patchset 9: // Non-container leaf or a container with self-viewport-dependence.
        Fredrik Söderquist . resolved

        But this we technically don't know? (Except if the container is empty.) I think this may need the the additional function that was brought up previously.

        Ragvesh Sharma

        Good catch. Updated — the `!SlowFirstChild()` has been replaced with an explicit `SelfHasRelativeLengths()` check for every visible, viewport-dependent node. This reads directly from the element's DOM attributes, so it can't be stale from previously-removed children.

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Divyansh Mangal
        • Fredrik Söderquist
        • Philip Rogers
        • Vinay Singh
        • Virali Purbey
        Submit Requirements:
          • requirement satisfiedCode-Coverage
          • requirement is not satisfiedCode-Owners
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedReview-Enforcement
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: chromium/src
          Gerrit-Branch: main
          Gerrit-Change-Id: I973ddc053f31a00c808523a4e04495337ed5c668
          Gerrit-Change-Number: 7665866
          Gerrit-PatchSet: 10
          Gerrit-Owner: Ragvesh Sharma <rags...@microsoft.com>
          Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
          Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
          Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
          Gerrit-Reviewer: Ragvesh Sharma <rags...@microsoft.com>
          Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
          Gerrit-CC: Stephen Chenney <sche...@chromium.org>
          Gerrit-CC: Vinay Singh <vinay...@microsoft.com>
          Gerrit-CC: Virali Purbey <virali...@microsoft.com>
          Gerrit-Attention: Vinay Singh <vinay...@microsoft.com>
          Gerrit-Attention: Philip Rogers <p...@chromium.org>
          Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
          Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
          Gerrit-Attention: Divyansh Mangal <dma...@microsoft.com>
          Gerrit-Comment-Date: Thu, 19 Mar 2026 17:24:52 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          Comment-In-Reply-To: Fredrik Söderquist <f...@opera.com>
          satisfied_requirement
          unsatisfied_requirement
          open
          diffy

          Fredrik Söderquist (Gerrit)

          unread,
          Mar 20, 2026, 8:20:45 AM (2 days ago) Mar 20
          to Ragvesh Sharma, Virali Purbey, Philip Rogers, Divyansh Mangal, Vinay Singh, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-revi...@chromium.org, kinuko...@chromium.org, jmedle...@chromium.org, zol...@webkit.org, blink-revie...@chromium.org, blink-...@chromium.org, fmalit...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org
          Attention needed from Divyansh Mangal, Philip Rogers, Ragvesh Sharma, Vinay Singh and Virali Purbey

          Fredrik Söderquist added 1 comment

          File third_party/blink/renderer/core/svg/graphics/filters/svg_fe_image.cc
          Line 80, Patchset 12 (Latest): if (auto* element = DynamicTo<SVGElement>(current->GetNode())) {

          if (element->SelfHasRelativeLengths()) {
          return true;
          }
          }
          Fredrik Söderquist . unresolved

          This should really go in the `LayoutObject`, because it has a more complete picture of the dependencies. This function only covers dependencies from attributes. (And as mentioned previously, it's slated to go away.)

          Open in Gerrit

          Related details

          Attention is currently required from:
          • Divyansh Mangal
          • Philip Rogers
          • Ragvesh Sharma
          • Vinay Singh
          • Virali Purbey
          Submit Requirements:
            • requirement satisfiedCode-Coverage
            • requirement is not satisfiedCode-Owners
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: comment
            Gerrit-Project: chromium/src
            Gerrit-Branch: main
            Gerrit-Change-Id: I973ddc053f31a00c808523a4e04495337ed5c668
            Gerrit-Change-Number: 7665866
            Gerrit-PatchSet: 12
            Gerrit-Owner: Ragvesh Sharma <rags...@microsoft.com>
            Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
            Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
            Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
            Gerrit-Reviewer: Ragvesh Sharma <rags...@microsoft.com>
            Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
            Gerrit-CC: Stephen Chenney <sche...@chromium.org>
            Gerrit-CC: Vinay Singh <vinay...@microsoft.com>
            Gerrit-CC: Virali Purbey <virali...@microsoft.com>
            Gerrit-Attention: Vinay Singh <vinay...@microsoft.com>
            Gerrit-Attention: Ragvesh Sharma <rags...@microsoft.com>
            Gerrit-Attention: Philip Rogers <p...@chromium.org>
            Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
            Gerrit-Attention: Divyansh Mangal <dma...@microsoft.com>
            Gerrit-Comment-Date: Fri, 20 Mar 2026 12:20:27 +0000
            Gerrit-HasComments: Yes
            Gerrit-Has-Labels: No
            satisfied_requirement
            unsatisfied_requirement
            open
            diffy

            Ragvesh Sharma (Gerrit)

            unread,
            Mar 21, 2026, 2:31:26 AM (24 hours ago) Mar 21
            to Virali Purbey, Fredrik Söderquist, Philip Rogers, Divyansh Mangal, Vinay Singh, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-revi...@chromium.org, kinuko...@chromium.org, jmedle...@chromium.org, zol...@webkit.org, blink-revie...@chromium.org, blink-...@chromium.org, fmalit...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org
            Attention needed from Divyansh Mangal, Fredrik Söderquist, Philip Rogers, Vinay Singh and Virali Purbey

            Ragvesh Sharma voted and added 1 comment

            Votes added by Ragvesh Sharma

            Auto-Submit+1

            1 comment

            File third_party/blink/renderer/core/svg/graphics/filters/svg_fe_image.cc
            Line 80, Patchset 12: if (auto* element = DynamicTo<SVGElement>(current->GetNode())) {

            if (element->SelfHasRelativeLengths()) {
            return true;
            }
            }
            Fredrik Söderquist . resolved

            This should really go in the `LayoutObject`, because it has a more complete picture of the dependencies. This function only covers dependencies from attributes. (And as mentioned previously, it's slated to go away.)

            Ragvesh Sharma

            Thanks for the suggestion. Incorporated.

            Open in Gerrit

            Related details

            Attention is currently required from:
            • Divyansh Mangal
            • Fredrik Söderquist
            • Philip Rogers
            • Vinay Singh
            • Virali Purbey
            Submit Requirements:
              • requirement satisfiedCode-Coverage
              • requirement is not satisfiedCode-Owners
              • requirement is not satisfiedCode-Review
              • requirement is not satisfiedReview-Enforcement
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: chromium/src
              Gerrit-Branch: main
              Gerrit-Change-Id: I973ddc053f31a00c808523a4e04495337ed5c668
              Gerrit-Change-Number: 7665866
              Gerrit-PatchSet: 14
              Gerrit-Owner: Ragvesh Sharma <rags...@microsoft.com>
              Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
              Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
              Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
              Gerrit-Reviewer: Ragvesh Sharma <rags...@microsoft.com>
              Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
              Gerrit-CC: Stephen Chenney <sche...@chromium.org>
              Gerrit-CC: Vinay Singh <vinay...@microsoft.com>
              Gerrit-CC: Virali Purbey <virali...@microsoft.com>
              Gerrit-Attention: Vinay Singh <vinay...@microsoft.com>
              Gerrit-Attention: Philip Rogers <p...@chromium.org>
              Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
              Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
              Gerrit-Attention: Divyansh Mangal <dma...@microsoft.com>
              Gerrit-Comment-Date: Sat, 21 Mar 2026 06:31:16 +0000
              satisfied_requirement
              unsatisfied_requirement
              open
              diffy

              Philip Rogers (Gerrit)

              unread,
              Mar 21, 2026, 6:43:38 PM (8 hours ago) Mar 21
              to Ragvesh Sharma, Virali Purbey, Fredrik Söderquist, Divyansh Mangal, Vinay Singh, Chromium LUCI CQ, AyeAye, chromium...@chromium.org, Dirk Schulze, Stephen Chenney, blink-revi...@chromium.org, kinuko...@chromium.org, jmedle...@chromium.org, zol...@webkit.org, blink-revie...@chromium.org, blink-...@chromium.org, fmalit...@chromium.org, kouhe...@chromium.org, pdr+svgw...@chromium.org
              Attention needed from Divyansh Mangal, Fredrik Söderquist, Ragvesh Sharma, Vinay Singh and Virali Purbey

              Philip Rogers added 1 comment

              File third_party/blink/renderer/core/svg/graphics/filters/svg_fe_image.cc
              Line 73, Patchset 17 (Latest): if (!current->SlowFirstChild()) {
              Philip Rogers . unresolved
              Does this loop have a bug for text and foreign object? These types have children but are not containers. For example:
              ```
              <!DOCTYPE html>
              <title>feImage should be affected by text with viewport dependence</title>
              <link rel="match" href="reference/green-200x200.html">
              <svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" style="background: red">
              <defs>
              <filter filterUnits="userSpaceOnUse" id="flt" x="0" y="0" width="200" height="200">
              <feImage href="#img"/>
              </filter>
              </defs>
                <svg width="100" height="100" overflow="visible">
              <g id="img">
              <rect width="100" height="100" fill="green"/>
              <text x="50%" fill="transparent">a</text>
              </g>
              </svg>
                <rect filter="url(#flt)" width="200" height="200"/>
              </svg>
              ```

              and

              ```
              <!DOCTYPE html>
              <title>feImage should be affected by foreignObject with viewport dependence</title>
              <link rel="match" href="reference/green-200x200.html">
              <svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" style="background: red">
              <defs>
              <filter filterUnits="userSpaceOnUse" id="flt" x="0" y="0" width="200" height="200">
              <feImage href="#img"/>
              </filter>
              </defs>
                <svg width="100" height="100" overflow="visible">
              <g id="img">
              <rect width="100" height="100" fill="green"/>
              <foreignObject width="100%" height="100%">
              <div xmlns="http://www.w3.org/1999/xhtml">a</div>
              </foreignObject>
              </g>
              </svg>
                <rect filter="url(#flt)" width="200" height="200"/>
              </svg>

              ```

              With reference:
              ```
              <!DOCTYPE html>
              <div style="width: 200px; height: 200px; background-color: green"></div>

              ```

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Divyansh Mangal
              • Fredrik Söderquist
              • Ragvesh Sharma
              • Vinay Singh
              • Virali Purbey
              Submit Requirements:
                • requirement satisfiedCode-Coverage
                • requirement is not satisfiedCode-Owners
                • requirement is not satisfiedCode-Review
                • requirement is not satisfiedNo-Unresolved-Comments
                • requirement is not satisfiedReview-Enforcement
                Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
                Gerrit-MessageType: comment
                Gerrit-Project: chromium/src
                Gerrit-Branch: main
                Gerrit-Change-Id: I973ddc053f31a00c808523a4e04495337ed5c668
                Gerrit-Change-Number: 7665866
                Gerrit-PatchSet: 17
                Gerrit-Owner: Ragvesh Sharma <rags...@microsoft.com>
                Gerrit-Reviewer: Divyansh Mangal <dma...@microsoft.com>
                Gerrit-Reviewer: Fredrik Söderquist <f...@opera.com>
                Gerrit-Reviewer: Philip Rogers <p...@chromium.org>
                Gerrit-Reviewer: Ragvesh Sharma <rags...@microsoft.com>
                Gerrit-CC: Dirk Schulze <dsch...@chromium.org>
                Gerrit-CC: Stephen Chenney <sche...@chromium.org>
                Gerrit-CC: Vinay Singh <vinay...@microsoft.com>
                Gerrit-CC: Virali Purbey <virali...@microsoft.com>
                Gerrit-Attention: Vinay Singh <vinay...@microsoft.com>
                Gerrit-Attention: Ragvesh Sharma <rags...@microsoft.com>
                Gerrit-Attention: Virali Purbey <virali...@microsoft.com>
                Gerrit-Attention: Fredrik Söderquist <f...@opera.com>
                Gerrit-Attention: Divyansh Mangal <dma...@microsoft.com>
                Gerrit-Comment-Date: Sat, 21 Mar 2026 22:43:27 +0000
                Gerrit-HasComments: Yes
                Gerrit-Has-Labels: No
                satisfied_requirement
                unsatisfied_requirement
                open
                diffy
                Reply all
                Reply to author
                Forward
                0 new messages