FrameView base background color always starts white.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2019 20:32:49 +0000 (20:32 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Apr 2019 20:32:49 +0000 (20:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196976

Reviewed by Beth Dakin.

Source/WebCore:

* page/FrameView.cpp:
(WebCore::FrameView::setBaseBackgroundColor): Bail early if the base background
color did not change.

Source/WebKit:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Set m_backgroundColor before calling
WebFrame::createWithCoreMainFrame so the call to create the FrameView
for the empty page in transitionToCommittedForNewPage() gets
the correct color from WebPage.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244355 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/WebPage.cpp

index 9b18b3c..f0c537e 100644 (file)
@@ -1,3 +1,14 @@
+2019-04-16  Timothy Hatcher  <timothy@apple.com>
+
+        FrameView base background color always starts white.
+        https://bugs.webkit.org/show_bug.cgi?id=196976
+
+        Reviewed by Beth Dakin.
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::setBaseBackgroundColor): Bail early if the base background
+        color did not change.
+
 2019-04-16  Devin Rousso  <drousso@apple.com>
 
         Unprefix -webkit-sticky
index 7e946a7..e5ced21 100644 (file)
@@ -2984,7 +2984,11 @@ Color FrameView::baseBackgroundColor() const
 
 void FrameView::setBaseBackgroundColor(const Color& backgroundColor)
 {
-    m_baseBackgroundColor = backgroundColor.isValid() ? backgroundColor : Color::white;
+    Color newBaseBackgroundColor = backgroundColor.isValid() ? backgroundColor : Color::white;
+    if (m_baseBackgroundColor == newBaseBackgroundColor)
+        return;
+
+    m_baseBackgroundColor = newBaseBackgroundColor;
 
     if (!isViewForDocumentInFrame())
         return;
index 287bd8d..f31786d 100644 (file)
@@ -1,3 +1,16 @@
+2019-04-16  Timothy Hatcher  <timothy@apple.com>
+
+        FrameView base background color always starts white.
+        https://bugs.webkit.org/show_bug.cgi?id=196976
+
+        Reviewed by Beth Dakin.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage): Set m_backgroundColor before calling
+        WebFrame::createWithCoreMainFrame so the call to create the FrameView
+        for the empty page in transitionToCommittedForNewPage() gets
+        the correct color from WebPage.
+
 2019-04-16  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, fix the build with recent SDKs.
index a0940d2..e10e8fd 100644 (file)
@@ -497,6 +497,8 @@ WebPage::WebPage(uint64_t pageID, WebPageCreationParameters&& parameters)
 
     updatePreferences(parameters.store);
 
+    m_backgroundColor = parameters.backgroundColor;
+
     m_drawingArea = DrawingArea::create(*this, parameters);
     m_drawingArea->setPaintingEnabled(false);
     m_drawingArea->setShouldScaleViewToFitDocument(parameters.shouldScaleViewToFitDocument);
@@ -670,8 +672,6 @@ WebPage::WebPage(uint64_t pageID, WebPageCreationParameters&& parameters)
 #if USE(AUDIO_SESSION)
     PlatformMediaSessionManager::setShouldDeactivateAudioSession(true);
 #endif
-
-    setBackgroundColor(parameters.backgroundColor);
 }
 
 #if ENABLE(WEB_RTC)