Title: [183647] trunk/Source/WebKit2
Revision
183647
Author
timothy_hor...@apple.com
Date
2015-04-30 15:16:42 -0700 (Thu, 30 Apr 2015)

Log Message

Asynchronous (or timed-out synchronous) resize flashes white instead of page background color
https://bugs.webkit.org/show_bug.cgi?id=144468

Reviewed by Simon Fraser and Dan Bernstein.

* UIProcess/API/mac/WKView.mm:
(-[WKView _viewBackgroundColor]):
(-[WKView updateLayer]):
Use the pageExtendedBackgroundColor for the background color of the WKView,
if we have one (and aren't using a transparent background). This means
during asynchronous resize or other cases where the Web process isn't keeping
up with the UI process during a resize, we'll see background color instead of white.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (183646 => 183647)


--- trunk/Source/WebKit2/ChangeLog	2015-04-30 22:15:29 UTC (rev 183646)
+++ trunk/Source/WebKit2/ChangeLog	2015-04-30 22:16:42 UTC (rev 183647)
@@ -1,3 +1,18 @@
+2015-04-30  Tim Horton  <timothy_hor...@apple.com>
+
+        Asynchronous (or timed-out synchronous) resize flashes white instead of page background color
+        https://bugs.webkit.org/show_bug.cgi?id=144468
+
+        Reviewed by Simon Fraser and Dan Bernstein.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _viewBackgroundColor]):
+        (-[WKView updateLayer]):
+        Use the pageExtendedBackgroundColor for the background color of the WKView,
+        if we have one (and aren't using a transparent background). This means
+        during asynchronous resize or other cases where the Web process isn't keeping
+        up with the UI process during a resize, we'll see background color instead of white.
+
 2015-04-30  Beth Dakin  <bda...@apple.com>
 
         Should choose UIScrollView indicatorStyle based on the document background color

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (183646 => 183647)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2015-04-30 22:15:29 UTC (rev 183646)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2015-04-30 22:16:42 UTC (rev 183647)
@@ -4061,12 +4061,20 @@
     return YES;
 }
 
+- (CGColorRef)_viewBackgroundColor
+{
+    if (self.drawsBackground && !self.drawsTransparentBackground) {
+        if (NSColor *backgroundColor = self._pageExtendedBackgroundColor)
+            return backgroundColor.CGColor;
+        return CGColorGetConstantColor(kCGColorWhite);
+    }
+
+    return CGColorGetConstantColor(kCGColorClear);
+}
+
 - (void)updateLayer
 {
-    if ([self drawsBackground] && ![self drawsTransparentBackground])
-        self.layer.backgroundColor = CGColorGetConstantColor(kCGColorWhite);
-    else
-        self.layer.backgroundColor = CGColorGetConstantColor(kCGColorClear);
+    self.layer.backgroundColor = self._viewBackgroundColor;
 
     // If asynchronous geometry updates have been sent by forceAsyncDrawingAreaSizeUpdate,
     // then subsequent calls to setFrameSize should not result in us waiting for the did
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to