fix: BrowserView background color in webContents (#33435)

* chore: fix BrowserView background color in webContents

* disable screen capture test on linux

* spec: fix platform failure condition
This commit is contained in:
Shelley Vohr 2022-03-28 18:47:08 +02:00 committed by GitHub
parent 9e45a1cd51
commit 1153a5ce5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 77 additions and 7 deletions

View file

@ -1489,11 +1489,13 @@ void WebContents::HandleNewRenderFrame(
// Set the background color of RenderWidgetHostView.
auto* web_preferences = WebContentsPreferences::From(web_contents());
if (web_preferences) {
absl::optional<SkColor> maybe_color = web_preferences->GetBackgroundColor();
web_contents()->SetPageBaseBackgroundColor(maybe_color);
bool guest = IsGuest() || type_ == Type::kBrowserView;
absl::optional<SkColor> color =
guest ? SK_ColorTRANSPARENT : web_preferences->GetBackgroundColor();
web_contents()->SetPageBaseBackgroundColor(color);
SetBackgroundColor(rwhv, color.value_or(SK_ColorWHITE));
SkColor color =
maybe_color.value_or(guest ? SK_ColorTRANSPARENT : SK_ColorWHITE);
SetBackgroundColor(rwhv, color);
}
if (!background_throttling_)