Title: [230186] tags/Safari-606.1.7.4/Source/WebKit
Revision
230186
Author
[email protected]
Date
2018-04-02 14:06:30 -0700 (Mon, 02 Apr 2018)

Log Message

Cherry-pick r229684. rdar://problem/38516584

    Add _useSystemAppearance to WKView
    https://bugs.webkit.org/show_bug.cgi?id=183706
    <rdar://problem/38516584>

    Reviewed by Tim Horton.

    Plumb useSystemAppearance and other supporting functions to WKView

    * UIProcess/API/Cocoa/WKViewPrivate.h:
    * UIProcess/API/Cocoa/WKWebView.mm:
    (-[WKWebView _initializeWithConfiguration:]):
    (-[WKWebView _useSystemAppearance]):
    (-[WKWebView _setUseSystemAppearance:]):
    (-[WKWebView effectiveAppearanceDidChange]):
    * UIProcess/API/mac/WKView.mm:
    (-[WKView effectiveAppearanceDidChange]):
    (-[WKView _setUseSystemAppearance:]):
    (-[WKView _useSystemAppearance]):
    (-[WKView _setDefaultAppearance:]):
    * UIProcess/Cocoa/WebViewImpl.h:
    * UIProcess/Cocoa/WebViewImpl.mm:
    (WebKit::WebViewImpl::setUseSystemAppearance):
    (WebKit::WebViewImpl::useSystemAppearance):
    (WebKit::WebViewImpl::setDefaultAppearance):

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

Modified Paths

Diff

Modified: tags/Safari-606.1.7.4/Source/WebKit/ChangeLog (230185 => 230186)


--- tags/Safari-606.1.7.4/Source/WebKit/ChangeLog	2018-04-02 21:06:26 UTC (rev 230185)
+++ tags/Safari-606.1.7.4/Source/WebKit/ChangeLog	2018-04-02 21:06:30 UTC (rev 230186)
@@ -1,5 +1,65 @@
 2018-04-02  Jason Marcell  <[email protected]>
 
+        Cherry-pick r229684. rdar://problem/38516584
+
+    Add _useSystemAppearance to WKView
+    https://bugs.webkit.org/show_bug.cgi?id=183706
+    <rdar://problem/38516584>
+    
+    Reviewed by Tim Horton.
+    
+    Plumb useSystemAppearance and other supporting functions to WKView
+    
+    * UIProcess/API/Cocoa/WKViewPrivate.h:
+    * UIProcess/API/Cocoa/WKWebView.mm:
+    (-[WKWebView _initializeWithConfiguration:]):
+    (-[WKWebView _useSystemAppearance]):
+    (-[WKWebView _setUseSystemAppearance:]):
+    (-[WKWebView effectiveAppearanceDidChange]):
+    * UIProcess/API/mac/WKView.mm:
+    (-[WKView effectiveAppearanceDidChange]):
+    (-[WKView _setUseSystemAppearance:]):
+    (-[WKView _useSystemAppearance]):
+    (-[WKView _setDefaultAppearance:]):
+    * UIProcess/Cocoa/WebViewImpl.h:
+    * UIProcess/Cocoa/WebViewImpl.mm:
+    (WebKit::WebViewImpl::setUseSystemAppearance):
+    (WebKit::WebViewImpl::useSystemAppearance):
+    (WebKit::WebViewImpl::setDefaultAppearance):
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-03-16  Megan Gardner  <[email protected]>
+
+            Add _useSystemAppearance to WKView
+            https://bugs.webkit.org/show_bug.cgi?id=183706
+            <rdar://problem/38516584>
+
+            Reviewed by Tim Horton.
+
+            Plumb useSystemAppearance and other supporting functions to WKView
+
+            * UIProcess/API/Cocoa/WKViewPrivate.h:
+            * UIProcess/API/Cocoa/WKWebView.mm:
+            (-[WKWebView _initializeWithConfiguration:]):
+            (-[WKWebView _useSystemAppearance]):
+            (-[WKWebView _setUseSystemAppearance:]):
+            (-[WKWebView effectiveAppearanceDidChange]):
+            * UIProcess/API/mac/WKView.mm:
+            (-[WKView effectiveAppearanceDidChange]):
+            (-[WKView _setUseSystemAppearance:]):
+            (-[WKView _useSystemAppearance]):
+            (-[WKView _setDefaultAppearance:]):
+            * UIProcess/Cocoa/WebViewImpl.h:
+            * UIProcess/Cocoa/WebViewImpl.mm:
+            (WebKit::WebViewImpl::setUseSystemAppearance):
+            (WebKit::WebViewImpl::useSystemAppearance):
+            (WebKit::WebViewImpl::setDefaultAppearance):
+
+2018-04-02  Jason Marcell  <[email protected]>
+
         Cherry-pick r229679. rdar://problem/38385900
 
     Ensure that style is updated when the effective appearance changes

Modified: tags/Safari-606.1.7.4/Source/WebKit/UIProcess/API/Cocoa/WKViewPrivate.h (230185 => 230186)


--- tags/Safari-606.1.7.4/Source/WebKit/UIProcess/API/Cocoa/WKViewPrivate.h	2018-04-02 21:06:26 UTC (rev 230185)
+++ tags/Safari-606.1.7.4/Source/WebKit/UIProcess/API/Cocoa/WKViewPrivate.h	2018-04-02 21:06:30 UTC (rev 230186)
@@ -140,6 +140,8 @@
 
 - (void)_doAfterNextPresentationUpdate:(void (^)(void))updateBlock WK_API_AVAILABLE(macosx(WK_MAC_TBA));
 
+@property (nonatomic, readwrite, setter=_setUseSystemAppearance:) BOOL _useSystemAppearance WK_API_AVAILABLE(macosx(WK_MAC_TBA));
+
 @end
 
 #endif // !TARGET_OS_IPHONE

Modified: tags/Safari-606.1.7.4/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (230185 => 230186)


--- tags/Safari-606.1.7.4/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2018-04-02 21:06:26 UTC (rev 230185)
+++ tags/Safari-606.1.7.4/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2018-04-02 21:06:30 UTC (rev 230186)
@@ -684,8 +684,6 @@
 
     _impl->setAutomaticallyAdjustsContentInsets(true);
     _impl->setRequiresUserActionForEditingControlsManager([configuration _requiresUserActionForEditingControlsManager]);
-    
-    _page->setDefaultAppearance([self _defaultAppearance]);
 #endif
 
     _page->setBackgroundExtendsBeyondPage(true);
@@ -6150,18 +6148,18 @@
 
 - (BOOL)_useSystemAppearance
 {
-    return _page->useSystemAppearance();
+    return _impl->useSystemAppearance();
 }
 
 - (void)_setUseSystemAppearance:(BOOL)useSystemAppearance
 {
-    _page->setUseSystemAppearance(useSystemAppearance);
-    _page->setDefaultAppearance([self _defaultAppearance]);
+    _impl->setUseSystemAppearance(useSystemAppearance);
+    _impl->setDefaultAppearance([self _defaultAppearance]);
 }
 
 - (void)effectiveAppearanceDidChange
 {
-    _page->setDefaultAppearance([self _defaultAppearance]);
+    _impl->setDefaultAppearance([self _defaultAppearance]);
 }
 
 - (void)_setHeaderBannerHeight:(int)height

Modified: tags/Safari-606.1.7.4/Source/WebKit/UIProcess/API/mac/WKView.mm (230185 => 230186)


--- tags/Safari-606.1.7.4/Source/WebKit/UIProcess/API/mac/WKView.mm	2018-04-02 21:06:26 UTC (rev 230185)
+++ tags/Safari-606.1.7.4/Source/WebKit/UIProcess/API/mac/WKView.mm	2018-04-02 21:06:30 UTC (rev 230186)
@@ -1609,6 +1609,35 @@
 {
     _data->_impl->setShouldSuppressFirstResponderChanges(shouldSuppress);
 }
+
+#if USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/WebViewAndWKWebViewAdditions.mm>
+#else
+- (bool)_defaultAppearance { return true; }
+#endif
+
+- (void)effectiveAppearanceDidChange
+{
+    _data->_impl->setDefaultAppearance([self _defaultAppearance]);
+}
+
+- (void)_setUseSystemAppearance:(BOOL)useSystemAppearance
+{
+    _data->_impl->setUseSystemAppearance(useSystemAppearance);
+    _data->_impl->setDefaultAppearance([self _defaultAppearance]);
+}
+
+- (BOOL)_useSystemAppearance
+{
+    return _data->_impl->useSystemAppearance();
+}
+
+- (void)_setDefaultAppearance:(BOOL)defaultAppearance
+{
+    _data->_impl->setDefaultAppearance(defaultAppearance);
+}
+
+
 @end
 
 #endif // PLATFORM(MAC)

Modified: tags/Safari-606.1.7.4/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h (230185 => 230186)


--- tags/Safari-606.1.7.4/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h	2018-04-02 21:06:26 UTC (rev 230185)
+++ tags/Safari-606.1.7.4/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h	2018-04-02 21:06:30 UTC (rev 230186)
@@ -533,6 +533,10 @@
 
     bool beginBackSwipeForTesting();
     bool completeBackSwipeForTesting();
+    
+    void setUseSystemAppearance(bool);
+    bool useSystemAppearance();
+    void setDefaultAppearance(bool);
 
 private:
 #if HAVE(TOUCH_BAR)

Modified: tags/Safari-606.1.7.4/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (230185 => 230186)


--- tags/Safari-606.1.7.4/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm	2018-04-02 21:06:26 UTC (rev 230185)
+++ tags/Safari-606.1.7.4/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm	2018-04-02 21:06:30 UTC (rev 230186)
@@ -4961,7 +4961,22 @@
         return false;
     return m_gestureController->completeSimulatedSwipeInDirectionForTesting(ViewGestureController::SwipeDirection::Back);
 }
+    
+void WebViewImpl::setUseSystemAppearance(bool useSystemAppearance)
+{
+    m_page->setUseSystemAppearance(useSystemAppearance);
+}
 
+bool WebViewImpl::useSystemAppearance()
+{
+    return m_page->useSystemAppearance();
+}
+
+void WebViewImpl::setDefaultAppearance(bool defaultAppearance)
+{
+    m_page->setDefaultAppearance(defaultAppearance);
+}
+
 } // namespace WebKit
 
 #endif // PLATFORM(MAC)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to