Title: [229719] tags/Safari-606.1.9.4/Source/WebKit
- Revision
- 229719
- Author
- jmarc...@apple.com
- Date
- 2018-03-19 14:27:26 -0700 (Mon, 19 Mar 2018)
Log Message
Cherry-pick r229684. rdar://problem/38516584
Modified Paths
Diff
Modified: tags/Safari-606.1.9.4/Source/WebKit/ChangeLog (229718 => 229719)
--- tags/Safari-606.1.9.4/Source/WebKit/ChangeLog 2018-03-19 21:27:23 UTC (rev 229718)
+++ tags/Safari-606.1.9.4/Source/WebKit/ChangeLog 2018-03-19 21:27:26 UTC (rev 229719)
@@ -1,5 +1,36 @@
2018-03-19 Jason Marcell <jmarc...@apple.com>
+ Cherry-pick r229684. rdar://problem/38516584
+
+ 2018-03-16 Megan Gardner <megan_gard...@apple.com>
+
+ 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-03-19 Jason Marcell <jmarc...@apple.com>
+
Cherry-pick r229679. rdar://problem/38385900
2018-03-16 Megan Gardner <megan_gard...@apple.com>
Modified: tags/Safari-606.1.9.4/Source/WebKit/UIProcess/API/Cocoa/WKViewPrivate.h (229718 => 229719)
--- tags/Safari-606.1.9.4/Source/WebKit/UIProcess/API/Cocoa/WKViewPrivate.h 2018-03-19 21:27:23 UTC (rev 229718)
+++ tags/Safari-606.1.9.4/Source/WebKit/UIProcess/API/Cocoa/WKViewPrivate.h 2018-03-19 21:27:26 UTC (rev 229719)
@@ -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.9.4/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (229718 => 229719)
--- tags/Safari-606.1.9.4/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2018-03-19 21:27:23 UTC (rev 229718)
+++ tags/Safari-606.1.9.4/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2018-03-19 21:27:26 UTC (rev 229719)
@@ -684,8 +684,6 @@
_impl->setAutomaticallyAdjustsContentInsets(true);
_impl->setRequiresUserActionForEditingControlsManager([configuration _requiresUserActionForEditingControlsManager]);
-
- _page->setDefaultAppearance([self _defaultAppearance]);
#endif
_page->setBackgroundExtendsBeyondPage(true);
@@ -6158,18 +6156,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.9.4/Source/WebKit/UIProcess/API/mac/WKView.mm (229718 => 229719)
--- tags/Safari-606.1.9.4/Source/WebKit/UIProcess/API/mac/WKView.mm 2018-03-19 21:27:23 UTC (rev 229718)
+++ tags/Safari-606.1.9.4/Source/WebKit/UIProcess/API/mac/WKView.mm 2018-03-19 21:27:26 UTC (rev 229719)
@@ -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.9.4/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h (229718 => 229719)
--- tags/Safari-606.1.9.4/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h 2018-03-19 21:27:23 UTC (rev 229718)
+++ tags/Safari-606.1.9.4/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h 2018-03-19 21:27:26 UTC (rev 229719)
@@ -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.9.4/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (229718 => 229719)
--- tags/Safari-606.1.9.4/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2018-03-19 21:27:23 UTC (rev 229718)
+++ tags/Safari-606.1.9.4/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm 2018-03-19 21:27:26 UTC (rev 229719)
@@ -4973,7 +4973,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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes