Border-radius on parent element breaks backdrop-filter clip

#40890814 Filed 2023-02-02 Status: Accepted (P3) CL 8605447

Summary

Problem

An element with backdrop-filter that sits inside nested ancestors with border-radius + overflow: hidden is not clipped to the inner ancestor's rounded corners. The hoisted backdrop fill paints into the outermost synthesized render surface, where the per-quad fast rounded-corner clips on the inner synthetic effects cannot reach it. Result: rectangular artifacts in the corners where the rounded clip was supposed to cut.

Fix (CL 8605447)

When synthesizing effect nodes for a backdrop-filter chain, collect the inner plain rounded-rect clips, project them into the outermost clip's transform space, and fold them into the DstIn mask layer of the outermost synthesized effect. The inner synthetic effects become vestigial and are skipped. Behind the BackdropFilterInnerRoundedClips kill switch (status: "stable"); re-enables three WPT reftests that were on TestExpectations.

Repro

Nested border-radius + overflow:hidden: #outer (10px) › #inner (25px) › #backdrop-source (magenta) + #backdrop-filter with backdrop-filter: invert(1). Inversion of magenta => green, which must be clipped to #inner's 25px radius.

nested border-radius + backdrop-filter: invert(1)

Live render. Unpatched Chrome shows red/magenta leaks in all four corners; patched Chrome (or Firefox) shows a clean green rounded rectangle.
Expected: clean green rounded rectangle
Reference page (sampler-ref.html) -- plain green rounded rect, no filter.
Diff: magenta pixels mark corners that change between before and after
Magenta pixels show where before vs after differ (652 px): the four corner artifacts removed by the fix.

content_shell: before / after

Before: red corner artifacts past inner border-radius
beforeinner rounded clip not applied to backdrop fill
After: clean rounded green rectangle
afterinner rrect folded into outermost mask

References

crbug.com/40890814 -- original report (filed 2023-02-02)

CL 8605447 -- Clip backdrop-filter by nested ancestor border-radius

Original reporter codepen

WPT reftests re-enabled: backdrop-filter-nested-border-radius-clip{,-3,-4}.html

standalone sampler.html / sampler-ref.html