+
Skip to content

[Bug]: Rendering bugs when WebContentsView has a transparent background in Electron 31 #42335

@Hans-Halverson

Description

@Hans-Halverson

Preflight Checklist

Electron Version

31.0.0-beta.7

What operating system are you using?

macOS

Operating System Version

macOS Sonoma 14.4.1

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

30.0.9

Expected Behavior

When a WebContentsView has a transparent background we should be able to render animated or partially transparent content without visual bugs appearing.

Actual Behavior

Visual bugs appear, seeming like paints keep happen on top of each other and keep compounding until you take some action e.g. resizing the window. For example an animated spinner quickly turns into a full, solid circle. Or a partially transparent rectangle starts to get darker over time as the paints keep layering on top of each other.

A gist is attached with this behavior, and the following video shows what I mean since it's a bit hard to describe:

Electron31TransparentRenderingBugs.mov

Testcase Gist URL

https://gist.github.com/6be5a293066790bf03432da7baeb7894

Additional Information

This only appears to happen when the WebContentsView's background color is set to be transparent. If you remove the setBackgroundColor line from the attached Gist the visual bugs dissappear.

I tracked this down to #41326, as this issue was introduced between v31.0.0-nightly.20240304 and v31.0.0-nightly.20240305 and that is the only commit in between. I can also confirm that reverting this PR fixes these visual bugs for me locally.

Metadata

Metadata

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载