Open emilio opened 2 years ago
What do we do for filter: url(#svgFilterWithFeFlood); visibility: hidden;
?
https://bugzil.la/1765862 is the issue where we found this.
The CSS Working Group just discussed [filter-effects-2] backdrop-filter and visibility
.
filter seems to be applied from visibility: hidden elements in all browsers on this test page I put together: https://jsbin.com/jegijet/edit?html,css,output
That said, I agree with the sentiment that as a developer I feel like visibility: hidden
should prevent backdrop-filter
and other visual effects from that element which was hidden from being applied.
https://drafts.fxtf.org/filter-effects-2/#BackdropFilterProperty doesn't say what happens when
visibility: hidden
is applied to the backdrop root. As a result, browsers diverge.Test-case could be: https://bug1765862.bmoattachments.org/attachment.cgi?id=9275099
Following the spec to the letter I think would mean that we should render the backdrop unconditionally, even if that subtree is
visibility: hidden
. That's not web compatible (see relevant Gecko bug).When everything in the subtree is invisible it seems clear that no backdrop should be rendered.
When the backdrop root is visible it is clear that it should be rendered.
But what if there's
visibility: visible
contents inside the backdrop root? Safari seems to render the whole backdrop. Blink only filters the contents of thevisibility: visible
descendant.I think it's more reasonable (and also probably simpler to spec and implement, since toggling visibility dynamically seems to have funny effects on both Safari and Chrome) to see
backdrop-filter
as a "background" effect, and thus get its visibility only determined by the visibility of the backdrop root (just likebackground-color
orbackground-image
).I'm fairly confident this should be web compatible, specially given both current implementations disagree, what do you think?
cc @chrishtr @smfr @glennw