Changeset 248436 in webkit


Ignore:
Timestamp:
Aug 8, 2019 12:04:36 PM (5 years ago)
Author:
timothy@apple.com
Message:

Set WKWebView opaque based on drawsBackground in PageConfiguration.
https://bugs.webkit.org/show_bug.cgi?id=200528

Reviewed by Tim Horton.

  • UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]): Set self.opaque = NO when !self.opaque
!pageConfiguration->drawsBackground().

It is almost impossible to have !self.opaque be NO at this point, since we are still inside initWithFrame:. A subclass could
override opaque and return NO, but checking pageConfiguration's drawsBackground is a good alternative.

  • WebProcess/WebPage/WebPage.h: Remove unused m_drawsBackground member.
Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r248433 r248436  
     12019-08-08  Timothy Hatcher  <timothy@apple.com>
     2
     3        Set WKWebView opaque based on drawsBackground in PageConfiguration.
     4        https://bugs.webkit.org/show_bug.cgi?id=200528
     5
     6        Reviewed by Tim Horton.
     7
     8        * UIProcess/API/Cocoa/WKWebView.mm:
     9        (-[WKWebView _initializeWithConfiguration:]): Set self.opaque = NO when !self.opaque || !pageConfiguration->drawsBackground().
     10        It is almost impossible to have !self.opaque be NO at this point, since we are still inside initWithFrame:. A subclass could
     11        override opaque and return NO, but checking pageConfiguration's drawsBackground is a good alternative.
     12        * WebProcess/WebPage/WebPage.h: Remove unused m_drawsBackground member.
     13
    1142019-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
    215
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r248281 r248436  
    711711    _page = [_contentView page];
    712712    [self _dispatchSetDeviceOrientation:deviceOrientation()];
    713     if (!self.opaque)
    714         _page->setBackgroundColor(WebCore::Color(WebCore::Color::transparent));
     713
     714    if (!self.opaque || !pageConfiguration->drawsBackground())
     715        self.opaque = NO;
    715716
    716717    [_contentView layer].anchorPoint = CGPointZero;
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r247926 r248436  
    16321632
    16331633    bool m_useFixedLayout { false };
    1634     bool m_drawsBackground { true };
    16351634
    16361635    WebCore::Color m_underlayColor;
Note: See TracChangeset for help on using the changeset viewer.