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:
parent
9e45a1cd51
commit
1153a5ce5a
3 changed files with 77 additions and 7 deletions
|
@ -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_)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue