Re: [csswg-drafts] [css-contain][filter-effects] paint containment vs filter effects (#6325)

> The source rect for the filter takes into account any clipping of content, so the contain:paint clip should prevent this from happening.

The source rect takes into account clipping, so pixels that would be out of the contained element before filters are applied are clipped and not taken into account by the filter, and that's fine, but the filter itself spreads things around, without being limited to clipping on descendants.

Here, for instance, I have a paint-contained element with a red background, with a blur filter on the parent of the container applied when you hover. Also a blue line overlayed on top to see where the boundaries of the element with containment are. No red leaks out of the contained element normally, but some amount of red can be seen outside of that boundary when you hover and apply the blur filter.

http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=9421

Here, it's the same idea, but nested within an element with overflow hidden with a black border. Things are sized so that the (unblured) red square with paint containment is just out of view. If you hover the document, it gets blurred, and some red can be seen. And if you hover the black bordered box, the red background is changed to blue, and that can be seen too.

http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=9422

So, In that example, I am changing the background color of an off screen element with paint containment, and I still need to re-render it to get the on-screen pixels correct. That seems to defeat the point of paint containment to me.

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6325#issuecomment-862013975 using your GitHub account


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

Received on Wednesday, 16 June 2021 03:43:07 UTC