Index: Source/web/WebViewImpl.cpp |
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp |
index b809f05932b0600c34a375563b90e8478061b572..fe17d3770d187610a482b46a0acc642632796b2b 100644 |
--- a/Source/web/WebViewImpl.cpp |
+++ b/Source/web/WebViewImpl.cpp |
@@ -428,6 +428,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) |
, m_showDebugBorders(false) |
, m_continuousPaintingEnabled(false) |
, m_showScrollBottleneckRects(false) |
+ , m_baseBackgroundColor(Color::white) |
{ |
Page::PageClients pageClients; |
pageClients.chromeClient = &m_chromeClientImpl; |
@@ -2462,11 +2463,11 @@ WebColor WebViewImpl::backgroundColor() const |
if (isTransparent()) |
return Color::transparent; |
if (!m_page) |
- return Color::white; |
+ return m_baseBackgroundColor; |
FrameView* view = m_page->mainFrame()->view(); |
StyleColor backgroundColor = view->documentBackgroundColor(); |
if (!backgroundColor.isValid()) |
- return Color::white; |
+ return m_baseBackgroundColor; |
return backgroundColor.rgb(); |
} |
@@ -3579,6 +3580,19 @@ bool WebViewImpl::isTransparent() const |
return m_isTransparent; |
} |
+void WebViewImpl::setBaseBackgroundColor(WebColor color) |
+{ |
+ if (m_baseBackgroundColor == color) |
+ return; |
+ |
+ m_baseBackgroundColor = color; |
+ |
+ m_page->mainFrame()->view()->setBaseBackgroundColor(color); |
+ |
+ if (m_layerTreeView) |
+ m_layerTreeView->setBackgroundColor(backgroundColor()); |
+} |
+ |
void WebViewImpl::setIsActive(bool active) |
{ |
if (page() && page()->focusController()) |