From e840f2394dfbdd53ed4107e5b756d3d55f25af28 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 24 Apr 2020 18:07:07 -0400 Subject: [PATCH] Revert "Fix background color assignment for popups (fixes issue #2482)" This reverts commit 1a0593dd6c40ee58fad335017bb88ccce720b1da. --- libcef/browser/browser_host_impl.cc | 7 ------- libcef/browser/content_browser_client.cc | 5 +++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index 96b1f3fe4..24bdc5b46 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -2534,13 +2534,6 @@ void CefBrowserHostImpl::RenderViewCreated( RenderFrameCreated(render_view_host->GetMainFrame()); platform_delegate_->RenderViewCreated(render_view_host); - - // Make sure the background color is set on the WebView and the Widget. - render_view_host->OnWebkitPreferencesChanged(); - if (render_view_host->GetWidget()->GetView()) { - render_view_host->GetWidget()->GetView()->SetBackgroundColor( - GetBackgroundColor()); - } } void CefBrowserHostImpl::RenderViewDeleted( diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index fcb00e12a..d087837d1 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -1051,6 +1051,11 @@ void CefContentBrowserClient::OverrideWebkitPrefs( // Using RVH instead of RFH here because rvh->GetMainFrame() may be nullptr // when this method is called. renderer_prefs::PopulateWebPreferences(rvh, *prefs); + + if (rvh->GetWidget()->GetView()) { + rvh->GetWidget()->GetView()->SetBackgroundColor( + prefs->base_background_color); + } } void CefContentBrowserClient::BrowserURLHandlerCreated(