fix: <webview> background transparency (#31722)

This commit is contained in:
Milan Burda 2021-11-06 03:55:19 +01:00 committed by GitHub
parent bc4308dcf8
commit 95a867b795
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1457,7 +1457,8 @@ void WebContents::HandleNewRenderFrame(
// Set the background color of RenderWidgetHostView. // Set the background color of RenderWidgetHostView.
auto* web_preferences = WebContentsPreferences::From(web_contents()); auto* web_preferences = WebContentsPreferences::From(web_contents());
if (web_preferences) { if (web_preferences) {
absl::optional<SkColor> color = web_preferences->GetBackgroundColor(); absl::optional<SkColor> color =
IsGuest() ? SK_ColorTRANSPARENT : web_preferences->GetBackgroundColor();
web_contents()->SetPageBaseBackgroundColor(color); web_contents()->SetPageBaseBackgroundColor(color);
rwhv->SetBackgroundColor(color.value_or(SK_ColorWHITE)); rwhv->SetBackgroundColor(color.value_or(SK_ColorWHITE));
} }