Title: [244754] trunk/Source/WebKit
Revision
244754
Author
[email protected]
Date
2019-04-29 14:05:33 -0700 (Mon, 29 Apr 2019)

Log Message

REGRESSION (r244142): Fandango accounts tab crashes under Color()
https://bugs.webkit.org/show_bug.cgi?id=197380
<rdar://problem/50186175>

Reviewed by Megan Gardner.

* UIProcess/API/Cocoa/WKWebView.mm:
(baseScrollViewBackgroundColor):
We now call -_updateScrollViewBackground from -setBackgroundColor:.
-setBackgroundColor: can be called from -[UIView initWithCoder:]; if it
is, WKWebView's _page is not yet initialized, so we crash. Return an invalid color.
Then, the caller falls back to WKContentView's backgroundColor. But WKContentView
isn't initialized yet either. So add a further fallback.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (244753 => 244754)


--- trunk/Source/WebKit/ChangeLog	2019-04-29 20:50:37 UTC (rev 244753)
+++ trunk/Source/WebKit/ChangeLog	2019-04-29 21:05:33 UTC (rev 244754)
@@ -1,3 +1,19 @@
+2019-04-29  Tim Horton  <[email protected]>
+
+        REGRESSION (r244142): Fandango accounts tab crashes under Color()
+        https://bugs.webkit.org/show_bug.cgi?id=197380
+        <rdar://problem/50186175>
+
+        Reviewed by Megan Gardner.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (baseScrollViewBackgroundColor):
+        We now call -_updateScrollViewBackground from -setBackgroundColor:.
+        -setBackgroundColor: can be called from -[UIView initWithCoder:]; if it
+        is, WKWebView's _page is not yet initialized, so we crash. Return an invalid color.
+        Then, the caller falls back to WKContentView's backgroundColor. But WKContentView
+        isn't initialized yet either. So add a further fallback.
+
 2019-04-29  Dean Jackson  <[email protected]>
 
         Add InteractionIsHappening to SuppressSelectionAssistantReason

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (244753 => 244754)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-04-29 20:50:37 UTC (rev 244753)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2019-04-29 21:05:33 UTC (rev 244754)
@@ -1679,6 +1679,9 @@
             return color;
     }
 
+    if (!webView->_page)
+        return { };
+
     return webView->_page->pageExtendedBackgroundColor();
 }
 
@@ -1690,7 +1693,7 @@
     WebCore::Color color = baseScrollViewBackgroundColor(webView);
 
     if (!color.isValid())
-        color = [webView->_contentView backgroundColor].CGColor;
+        color = webView->_contentView ? [webView->_contentView backgroundColor].CGColor : UIColor.whiteColor.CGColor;
 
     CGFloat zoomScale = contentZoomScale(webView);
     CGFloat minimumZoomScale = [webView->_scrollView minimumZoomScale];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to