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

[Bug]: CSS rendering is different when webview transparency set #4945

Open
leaanthony opened this issue Nov 23, 2024 · 1 comment
Open

[Bug]: CSS rendering is different when webview transparency set #4945

leaanthony opened this issue Nov 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@leaanthony
Copy link

leaanthony commented Nov 23, 2024

What happened?

When using a background colour for both host window and webview with Alpha = 0, the CSS backdrop-filter: blur does not work as expected.

Example when using Mica:

image

It works as expected if Alpha = 255:

image

Original report (via Wails): wailsapp/wails#2340
I don't know if it's useful or not, but the same bug happened on Mac: illixion/vscode-vibrancy-continued#87

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

131.0.2903.63

SDK Version

No response

Framework

Win32

Operating System

Windows 11

OS Version

26100.2454

Repro steps

  • Create a standard win32 window
  • Embed the webview
  • Set the webview background colour to {0,0,0,0}
  • Load the attached html file
  • See the text without blur
  • Set the webview background colour to {0,0,0,255}
  • Load the attached html file
  • See the text with blur

Index html (renamed to txt to upload)
index.txt

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

@leaanthony leaanthony added the bug Something isn't working label Nov 23, 2024
@hbl917070
Copy link

I encountered the same issue as well.
However, blur processing needs to calculate with the surrounding pixels to achieve the effect. If all the surrounding pixels are transparent, it makes sense that the blur cannot be computed.
After all, CSS's backdrop-filter only applies to elements within the webpage, and the content beneath the browser window is not included in the computation.
To solve this problem, the only option would be to continuously set the content beneath the window as the webpage background when the WebView2 background color is transparent. However, this approach would likely incur a very high computational cost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants