Title: [229679] trunk/Source
Revision
229679
Author
[email protected]
Date
2018-03-16 11:47:44 -0700 (Fri, 16 Mar 2018)

Log Message

Ensure that style is updated when the effective appearance changes
https://bugs.webkit.org/show_bug.cgi?id=183690
<rdar://problem/38385900>

Reviewed by Tim Horton and Wenson Hsieh.

Source/WebCore:

Only exposing a function to outside WebCore, no tests needed.

* page/Page.h:

Source/WebKit:

Respond to and respect the effective appearance changing.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView effectiveAppearanceDidChange]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setDefaultAppearance):

Source/WebKitLegacy/mac:

Respond to and respect the effective appearance changing.

* WebView/WebView.mm:
(-[WebView _setUseSystemAppearance:]):
(-[WebView effectiveAppearanceDidChange]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (229678 => 229679)


--- trunk/Source/WebCore/ChangeLog	2018-03-16 18:38:18 UTC (rev 229678)
+++ trunk/Source/WebCore/ChangeLog	2018-03-16 18:47:44 UTC (rev 229679)
@@ -1,3 +1,15 @@
+2018-03-16  Megan Gardner  <[email protected]>
+
+        Ensure that style is updated when the effective appearance changes
+        https://bugs.webkit.org/show_bug.cgi?id=183690
+        <rdar://problem/38385900>
+
+        Reviewed by Tim Horton and Wenson Hsieh.
+
+        Only exposing a function to outside WebCore, no tests needed.
+
+        * page/Page.h:
+
 2018-03-16  Chris Dumez  <[email protected]>
 
         WebKit.RestoreSessionStateContainingScrollRestorationDefault API test is failing with async policy delegates

Modified: trunk/Source/WebCore/page/Page.h (229678 => 229679)


--- trunk/Source/WebCore/page/Page.h	2018-03-16 18:38:18 UTC (rev 229678)
+++ trunk/Source/WebCore/page/Page.h	2018-03-16 18:47:44 UTC (rev 229679)
@@ -160,7 +160,7 @@
 
     WEBCORE_EXPORT uint64_t renderTreeSize() const;
 
-    void setNeedsRecalcStyleInAllFrames();
+    WEBCORE_EXPORT void setNeedsRecalcStyleInAllFrames();
 
     WEBCORE_EXPORT ViewportArguments viewportArguments() const;
 

Modified: trunk/Source/WebKit/ChangeLog (229678 => 229679)


--- trunk/Source/WebKit/ChangeLog	2018-03-16 18:38:18 UTC (rev 229678)
+++ trunk/Source/WebKit/ChangeLog	2018-03-16 18:47:44 UTC (rev 229679)
@@ -1,3 +1,18 @@
+2018-03-16  Megan Gardner  <[email protected]>
+
+        Ensure that style is updated when the effective appearance changes
+        https://bugs.webkit.org/show_bug.cgi?id=183690
+        <rdar://problem/38385900>
+
+        Reviewed by Tim Horton and Wenson Hsieh.
+
+        Respond to and respect the effective appearance changing.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView effectiveAppearanceDidChange]):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::setDefaultAppearance):
+
 2018-03-16  Chris Dumez  <[email protected]>
 
         URLSchemeHandler.Basic API test fails with async policy delegates

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (229678 => 229679)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2018-03-16 18:38:18 UTC (rev 229678)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2018-03-16 18:47:44 UTC (rev 229679)
@@ -6181,6 +6181,11 @@
     _page->setDefaultAppearance([self _defaultAppearance]);
 }
 
+- (void)effectiveAppearanceDidChange
+{
+    _page->setDefaultAppearance([self _defaultAppearance]);
+}
+
 - (void)_setHeaderBannerHeight:(int)height
 {
     _page->setHeaderBannerHeightForTesting(height);

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (229678 => 229679)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2018-03-16 18:38:18 UTC (rev 229678)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2018-03-16 18:47:44 UTC (rev 229679)
@@ -4130,6 +4130,7 @@
 void WebPage::setDefaultAppearance(bool defaultAppearance)
 {
     corePage()->setDefaultAppearance(defaultAppearance);
+    corePage()->setNeedsRecalcStyleInAllFrames();
 }
 #endif
 

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (229678 => 229679)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2018-03-16 18:38:18 UTC (rev 229678)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2018-03-16 18:47:44 UTC (rev 229679)
@@ -1,3 +1,17 @@
+2018-03-16  Megan Gardner  <[email protected]>
+
+        Ensure that style is updated when the effective appearance changes
+        https://bugs.webkit.org/show_bug.cgi?id=183690
+        <rdar://problem/38385900>
+
+        Reviewed by Tim Horton and Wenson Hsieh.
+
+        Respond to and respect the effective appearance changing.
+
+        * WebView/WebView.mm:
+        (-[WebView _setUseSystemAppearance:]):
+        (-[WebView effectiveAppearanceDidChange]):
+
 2018-03-15  Megan Gardner  <[email protected]>
 
         Create MediaQueryParserContext to provide additional context for the evaluation of media queries

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (229678 => 229679)


--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2018-03-16 18:38:18 UTC (rev 229678)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2018-03-16 18:47:44 UTC (rev 229679)
@@ -5202,16 +5202,27 @@
     if (auto page = _private->page) {
         page->setUseSystemAppearance(useSystemAppearance);
         page->setDefaultAppearance([self _defaultAppearance]);
+        page->setNeedsRecalcStyleInAllFrames();
     }
 }
 
 - (BOOL)_useSystemAppearance
 {
-    if (auto page = _private->page)
-        return page->useSystemAppearance();
-    return NO;
+    if (!_private->page)
+        return NO;
+    
+    return _private->page->useSystemAppearance();
 }
 
+- (void)effectiveAppearanceDidChange
+{
+    if (!_private->page)
+        return;
+    
+    _private->page->setDefaultAppearance([self _defaultAppearance]);
+    _private->page->setNeedsRecalcStyleInAllFrames();
+}
+
 - (void)_setSourceApplicationAuditData:(NSData *)sourceApplicationAuditData
 {
     if (_private->sourceApplicationAuditData == sourceApplicationAuditData)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to