Changeset 246343 in webkit


Ignore:
Timestamp:
Jun 11, 2019 5:44:40 PM (5 years ago)
Author:
timothy@apple.com
Message:

Flash when tapping compose button after switching to/from dark mode without restarting Mail.
https://bugs.webkit.org/show_bug.cgi?id=198769
rdar://problem/51370037

Reviewed by Tim Horton.

Source/WebCore:

  • WebCore.xcodeproj/project.pbxproj: Make LocalCurrentTraitCollection.h a private header.

Source/WebKit:

Accessing a dynamic color outside a normal UIView choke point without setting
UITraitCollection.currentTraitCollection first can cause undefined results.
Use LocalCurrentTraitCollection inside scrollViewBackgroundColor when accessing
the dynamic system UIColors. Also use systemBackgroundColor instead of white.

  • UIProcess/API/Cocoa/WKWebView.mm:

(scrollViewBackgroundColor):

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r246340 r246343  
     12019-06-11  Timothy Hatcher  <timothy@apple.com>
     2
     3        Flash when tapping compose button after switching to/from dark mode without restarting Mail.
     4        https://bugs.webkit.org/show_bug.cgi?id=198769
     5        rdar://problem/51370037
     6
     7        Reviewed by Tim Horton.
     8
     9        * WebCore.xcodeproj/project.pbxproj: Make LocalCurrentTraitCollection.h a private header.
     10
    1112019-06-11  Commit Queue  <commit-queue@webkit.org>
    212
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r246285 r246343  
    622622                1C24EEA51C729CE40080F8FC /* FontFaceSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C24EEA31C729CE40080F8FC /* FontFaceSet.h */; };
    623623                1C24EEA91C72A7B40080F8FC /* JSFontFaceSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C24EEA71C72A7B40080F8FC /* JSFontFaceSet.h */; };
    624                 1C43DE6B22AB4B8A001527D9 /* LocalCurrentTraitCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C43DE6822AB4B8A001527D9 /* LocalCurrentTraitCollection.h */; };
     624                1C43DE6B22AB4B8A001527D9 /* LocalCurrentTraitCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C43DE6822AB4B8A001527D9 /* LocalCurrentTraitCollection.h */; settings = {ATTRIBUTES = (Private, ); }; };
    625625                1C6626111C6E7CA600AB527C /* FontFace.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C66260F1C6E7CA600AB527C /* FontFace.h */; };
    626626                1C73A7132185757E004CCEA5 /* TextUnderlineOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CB6B4FB217B83940093B9CD /* TextUnderlineOffset.h */; settings = {ATTRIBUTES = (Private, ); }; };
  • trunk/Source/WebKit/ChangeLog

    r246342 r246343  
     12019-06-11  Timothy Hatcher  <timothy@apple.com>
     2
     3        Flash when tapping compose button after switching to/from dark mode without restarting Mail.
     4        https://bugs.webkit.org/show_bug.cgi?id=198769
     5        rdar://problem/51370037
     6
     7        Reviewed by Tim Horton.
     8
     9        Accessing a dynamic color outside a normal UIView choke point without setting
     10        UITraitCollection.currentTraitCollection first can cause undefined results.
     11        Use LocalCurrentTraitCollection inside scrollViewBackgroundColor when accessing
     12        the dynamic system UIColors. Also use systemBackgroundColor instead of white.
     13
     14        * UIProcess/API/Cocoa/WKWebView.mm:
     15        (scrollViewBackgroundColor):
     16
    1172019-06-11  Megan Gardner  <megan_gardner@apple.com>
    218
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r246341 r246343  
    156156#import <WebCore/FrameLoaderTypes.h>
    157157#import <WebCore/InspectorOverlay.h>
     158#import <WebCore/LocalCurrentTraitCollection.h>
    158159#import <WebCore/ScrollableArea.h>
    159160#import <WebCore/WebBackgroundTaskController.h>
     
    17031704        return WebCore::Color::transparent;
    17041705
     1706#if HAVE(OS_DARK_MODE_SUPPORT)
     1707    WebCore::LocalCurrentTraitCollection localTraitCollection(webView.traitCollection);
     1708#endif
     1709
    17051710    WebCore::Color color = baseScrollViewBackgroundColor(webView);
    17061711
    1707     if (!color.isValid())
    1708         color = webView->_contentView ? [webView->_contentView backgroundColor].CGColor : UIColor.whiteColor.CGColor;
     1712    if (!color.isValid() && webView->_contentView)
     1713        color = [webView->_contentView backgroundColor].CGColor;
     1714
     1715    if (!color.isValid()) {
     1716#if HAVE(OS_DARK_MODE_SUPPORT)
     1717        color = UIColor.systemBackgroundColor.CGColor;
     1718#else
     1719        color = WebCore::Color::white;
     1720#endif
     1721    }
    17091722
    17101723    CGFloat zoomScale = contentZoomScale(webView);
Note: See TracChangeset for help on using the changeset viewer.