Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backdrop-filter demo says the feature is not supported by Safari (but it is) #1169

Open
electrovir opened this issue Mar 11, 2023 · 9 comments
Labels
effort: large This task is a large effort. enhancement Improves an existing feature.

Comments

@electrovir
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter

What specific section or headline is this issue about?

Try It

What information was incorrect, unhelpful, or incomplete?

The "Try It" demo says This feature is not supported by your current browser. Check Browser compatibility for more details. However, it is supported in my browser: the browser compatibility chart says it's supported and I'm using it right now in my own code (and it works).

What did you expect to see?

The demo

Do you have any supporting links, references, or citations?

Using Safari Version 16.3

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@electrovir electrovir added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Mar 11, 2023
@wbamberg wbamberg transferred this issue from mdn/content Mar 11, 2023
@Josh-Cena
Copy link
Member

Hi, this feature is actually not supported.

document.createElement("div").style.backdropFilter; // returns undefined in Safari

You can try a minimal example:

<div style="background-image: url('https://interactive-examples.mdn.mozilla.net/media/examples/balloon.jpg'); width: 250px; height: 300px; display: flex; justify-content: center; flex-direction: column;">
  <div style="backdrop-filter: blur(10px); text-align: center;">
    <p>Hello</p>
  </div>
</div>

This doesn't work in my Safari 16.3. The reason why the live example below works is because it uses the -webkit-backdrop-filter: blur(10px); fallback, which is mentioned in the compat table:

Implemented with the vendor prefix: -webkit-

@electrovir
Copy link
Author

Does that not count as support? It just seems strange to me that the demo up top would show an error like that when it's trivial to make it work (just add the prefix).

@Josh-Cena
Copy link
Member

Well, the demo demonstrates the un-prefixed API. It could try to automatically "polyfill" with prefixes, but that would be hard to generalize since you can edit the CSS however you wish. In that case this would be re-purposed as an enhancement request.

@NiedziolkaMichal
Copy link
Member

We could apply autoprefixer for CSS properties used in the initial example and make it work even if the user changes a property value. Making it work for all possible properties would probably significantly increase bundle size, but I think users very rarely edit the example to a completely different property, so it's not really needed.

@NiedziolkaMichal NiedziolkaMichal added enhancement Improves an existing feature. and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Mar 11, 2023
@Josh-Cena
Copy link
Member

Josh-Cena commented Mar 11, 2023

I reckon the bundle size won't be huge (especially since it can be lazy-loaded), but wondering whether it would create more confusions (why something is allegedly not available but still working, etc.)

@NiedziolkaMichal
Copy link
Member

@Josh-Cena 256kb minified. I guess for CSS properties that were entered by the user in a "choice box", we could just apply all vendor prefixes without even checking if they exist, but it wouldn't work for rare cases in which property is implemented under a bit different property name.

@wbamberg
Copy link
Collaborator

FWIW we use prefixes manually in examples sometimes: https://developer.mozilla.org/en-US/docs/web/css/box-decoration-break.

I think applying but hiding prefixes (if that is the suggestion) would be very confusing for people.

@wbamberg wbamberg changed the title backdrop-filer demo says the feature is not supported by Safari (but it is) backdrop-filter demo says the feature is not supported by Safari (but it is) Mar 14, 2023
@NiedziolkaMichal
Copy link
Member

@wbamberg How about if the editor would show either prefixed property or unprefixed property, based on what it supports?

In the backdrop-filter example, Chrome would show:
image

and Safari would show:
image

@wbamberg
Copy link
Collaborator

I think this would be fine. Main thing is that what people see in the editor should be what's actually getting used :).

@caugner caugner added the effort: large This task is a large effort. label Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: large This task is a large effort. enhancement Improves an existing feature.
Projects
None yet
Development

No branches or pull requests

5 participants