⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 244142 in webkit


Ignore:
Timestamp:
Apr 10, 2019, 11:51:28 AM (7 years ago)
Author:
timothy@apple.com
Message:

WKScrollView background color does not match WKWebView before content is loaded.
https://bugs.webkit.org/show_bug.cgi?id=196745
rdar://problem/49750810

Reviewed by Megan Gardner.

  • UIProcess/API/Cocoa/WKWebView.mm:

(scrollViewBackgroundColor): Default to _contentView.backgroundColor on invalid base color.
(-[WKWebView _processDidExit]): Reset to _contentView.backgroundColor.
(-[WKWebView setBackgroundColor:]): Call _updateScrollViewBackground since it can use
_contentView.backgroundColor and it has changed.

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r244141 r244142  
     12019-04-10  Timothy Hatcher  <timothy@apple.com>
     2
     3        WKScrollView background color does not match WKWebView before content is loaded.
     4        https://bugs.webkit.org/show_bug.cgi?id=196745
     5        rdar://problem/49750810
     6
     7        Reviewed by Megan Gardner.
     8
     9        * UIProcess/API/Cocoa/WKWebView.mm:
     10        (scrollViewBackgroundColor): Default to _contentView.backgroundColor on invalid base color.
     11        (-[WKWebView _processDidExit]): Reset to _contentView.backgroundColor.
     12        (-[WKWebView setBackgroundColor:]): Call _updateScrollViewBackground since it can use
     13        _contentView.backgroundColor and it has changed.
     14
    1152019-04-10  Megan Gardner  <megan_gardner@apple.com>
    216
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r244089 r244142  
    16981698
    16991699    if (!color.isValid())
    1700         color = WebCore::Color::white;
     1700        color = [webView->_contentView backgroundColor].CGColor;
    17011701
    17021702    CGFloat zoomScale = contentZoomScale(webView);
     
    18631863
    18641864    [_contentView setFrame:self.bounds];
    1865     [_scrollView setBackgroundColor:[UIColor whiteColor]];
     1865    [_scrollView setBackgroundColor:[_contentView backgroundColor]];
    18661866    [_scrollView setContentOffset:[self _initialContentOffsetForScrollView]];
    18671867    [_scrollView setZoomScale:1];
     
    25422542    [super setBackgroundColor:backgroundColor];
    25432543    [_contentView setBackgroundColor:backgroundColor];
     2544    [self _updateScrollViewBackground];
    25442545}
    25452546
Note: See TracChangeset for help on using the changeset viewer.