fix: css transparent background being lost (#32593)

This commit is contained in:
Shelley Vohr 2022-01-27 15:56:35 +01:00 committed by GitHub
parent 86f8faea6b
commit 3768a7b25f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 836 additions and 5 deletions

View file

@ -373,8 +373,11 @@ void BrowserWindow::SetBackgroundColor(const std::string& color_name) {
SkColor color = ParseHexColor(color_name);
web_contents()->SetPageBaseBackgroundColor(color);
auto* rwhv = web_contents()->GetRenderWidgetHostView();
if (rwhv)
if (rwhv) {
rwhv->SetBackgroundColor(color);
static_cast<content::RenderWidgetHostViewBase*>(rwhv)
->SetContentBackgroundColor(color);
}
// Also update the web preferences object otherwise the view will be reset on
// the next load URL call
if (api_web_contents_) {