Changeset 244754 in webkit


Ignore:
Timestamp:
Apr 29, 2019 2:05:33 PM (5 years ago)
Author:
timothy_horton@apple.com
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.

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r244751 r244754  
     12019-04-29  Tim Horton  <timothy_horton@apple.com>
     2
     3        REGRESSION (r244142): Fandango accounts tab crashes under Color()
     4        https://bugs.webkit.org/show_bug.cgi?id=197380
     5        <rdar://problem/50186175>
     6
     7        Reviewed by Megan Gardner.
     8
     9        * UIProcess/API/Cocoa/WKWebView.mm:
     10        (baseScrollViewBackgroundColor):
     11        We now call -_updateScrollViewBackground from -setBackgroundColor:.
     12        -setBackgroundColor: can be called from -[UIView initWithCoder:]; if it
     13        is, WKWebView's _page is not yet initialized, so we crash. Return an invalid color.
     14        Then, the caller falls back to WKContentView's backgroundColor. But WKContentView
     15        isn't initialized yet either. So add a further fallback.
     16
    1172019-04-29  Dean Jackson  <dino@apple.com>
    218
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r244590 r244754  
    16801680    }
    16811681
     1682    if (!webView->_page)
     1683        return { };
     1684
    16821685    return webView->_page->pageExtendedBackgroundColor();
    16831686}
     
    16911694
    16921695    if (!color.isValid())
    1693         color = [webView->_contentView backgroundColor].CGColor;
     1696        color = webView->_contentView ? [webView->_contentView backgroundColor].CGColor : UIColor.whiteColor.CGColor;
    16941697
    16951698    CGFloat zoomScale = contentZoomScale(webView);
Note: See TracChangeset for help on using the changeset viewer.