REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Feb 2019 16:59:08 +0000 (16:59 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Feb 2019 16:59:08 +0000 (16:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195086
rdar://problem/48419124

Reviewed by Tim Horton.

Source/WebCore:

* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.

Source/WebKit:

* UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
(-[WKScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242128 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/RemoteLayerTree/mac/ScrollerMac.mm

index e30a4e0..833bb81 100644 (file)
@@ -1,3 +1,14 @@
+2019-02-27  Timothy Hatcher  <timothy@apple.com>
+
+        REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
+        https://bugs.webkit.org/show_bug.cgi?id=195086
+        rdar://problem/48419124
+
+        Reviewed by Tim Horton.
+
+        * platform/mac/ScrollAnimatorMac.mm:
+        (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
+
 2019-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Remove conditional compile guard for InsertIntoTextNodeCommand::doReapply
index e4efb5b..a831751 100644 (file)
@@ -536,8 +536,11 @@ enum FeatureToAnimate {
         return [NSAppearance currentAppearance];
 
     // Keep this in sync with FrameView::paintScrollCorner.
+    // The base system does not support dark Aqua, so we might get a null result.
     bool useDarkAppearance = _scrollbar->scrollableArea().useDarkAppearanceForScrollbars();
-    return [NSAppearance appearanceNamed:useDarkAppearance ? NSAppearanceNameDarkAqua : NSAppearanceNameAqua];
+    if (auto *appearance = [NSAppearance appearanceNamed:useDarkAppearance ? NSAppearanceNameDarkAqua : NSAppearanceNameAqua])
+        return appearance;
+    return [NSAppearance currentAppearance];
 }
 #endif
 
index 71723f9..d76c352 100644 (file)
@@ -1,3 +1,14 @@
+2019-02-27  Timothy Hatcher  <timothy@apple.com>
+
+        REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
+        https://bugs.webkit.org/show_bug.cgi?id=195086
+        rdar://problem/48419124
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:
+        (-[WKScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
+
 2019-02-26  Chris Dumez  <cdumez@apple.com>
 
         [PSON] Add mechanism to clear suspended pages while bypassing the WebProcess cache
index daf9c9b..ac828b2 100644 (file)
@@ -203,7 +203,10 @@ enum class FeatureToAnimate {
     if (!_scroller)
         return [NSAppearance currentAppearance];
 
-    return [NSAppearance appearanceNamed:_scroller->pair().useDarkAppearance() ? NSAppearanceNameDarkAqua : NSAppearanceNameAqua];
+    // The base system does not support dark Aqua, so we might get a null result.
+    if (auto *appearance = [NSAppearance appearanceNamed:_scroller->pair().useDarkAppearance() ? NSAppearanceNameDarkAqua : NSAppearanceNameAqua])
+        return appearance;
+    return [NSAppearance currentAppearance];
 }
 #endif