Unreviewed, rolling out r233087.
authorkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2018 22:34:49 +0000 (22:34 +0000)
committerkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jun 2018 22:34:49 +0000 (22:34 +0000)
Causes 5% Mac PLT regression.

Reverted changeset:

"Recalc styles every time defaultAppearance changes."
https://bugs.webkit.org/show_bug.cgi?id=186866
https://trac.webkit.org/changeset/233087

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

Source/WebCore/ChangeLog
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/mac/WebView/WebView.mm

index 4cb3fc5..603df1c 100644 (file)
@@ -1,3 +1,14 @@
+2018-06-25  Keith Rollin  <krollin@apple.com>
+        Unreviewed, rolling out r233087.
+
+        Causes 5% Mac PLT regression.
+
+        Reverted changeset:
+
+        "Recalc styles every time defaultAppearance changes."
+        https://bugs.webkit.org/show_bug.cgi?id=186866
+        https://trac.webkit.org/changeset/233087
+
 2018-06-25  Brent Fulgham  <bfulgham@apple.com>
 
         REGRESSION(r229722): WebKitLegacy clients can crash when loading alternate page
index 68e05bc..851ebb8 100644 (file)
@@ -2369,17 +2369,6 @@ void Page::setUnobscuredSafeAreaInsets(const FloatBoxExtent& insets)
     }
 }
 
-void Page::setUseSystemAppearance(bool useSystemAppearance)
-{
-    if (m_useSystemAppearance == useSystemAppearance)
-        return;
-
-    m_useSystemAppearance = useSystemAppearance;
-
-    RenderTheme::singleton().platformColorsDidChange();
-    setNeedsRecalcStyleInAllFrames();
-}
-
 bool Page::defaultAppearance() const
 {
     FrameView* view = mainFrame().view();
@@ -2388,17 +2377,6 @@ bool Page::defaultAppearance() const
     return m_defaultAppearance;
 }
 
-void Page::setDefaultAppearance(bool defaultAppearance)
-{
-    // Don't return early, even if m_defaultAppearance == defaultAppearance.
-    // The system appearance might have changed under us, like for accessibility.
-
-    m_defaultAppearance = defaultAppearance;
-
-    RenderTheme::singleton().platformColorsDidChange();
-    setNeedsRecalcStyleInAllFrames();
-}
-
 void Page::setFullscreenInsets(const FloatBoxExtent& insets)
 {
     if (insets == m_fullscreenInsets)
index f8f42d6..9e909cb 100644 (file)
@@ -338,12 +338,12 @@ public:
     bool enclosedInScrollableAncestorView() const { return m_enclosedInScrollableAncestorView; }
     void setEnclosedInScrollableAncestorView(bool f) { m_enclosedInScrollableAncestorView = f; }
 #endif
-
+    
     bool useSystemAppearance() const { return m_useSystemAppearance; }
-    WEBCORE_EXPORT void setUseSystemAppearance(bool);
+    void setUseSystemAppearance(bool a) { m_useSystemAppearance = a; }
     
     WEBCORE_EXPORT bool defaultAppearance() const;
-    WEBCORE_EXPORT void setDefaultAppearance(bool);
+    void setDefaultAppearance(bool a) { m_defaultAppearance = a; }
 
 #if ENABLE(TEXT_AUTOSIZING)
     float textAutosizingWidth() const { return m_textAutosizingWidth; }
index ff60c5f..c75c8c9 100644 (file)
@@ -1,3 +1,14 @@
+2018-06-25  Keith Rollin  <krollin@apple.com>
+        Unreviewed, rolling out r233087.
+
+        Causes 5% Mac PLT regression.
+
+        Reverted changeset:
+
+        "Recalc styles every time defaultAppearance changes."
+        https://bugs.webkit.org/show_bug.cgi?id=186866
+        https://trac.webkit.org/changeset/233087
+
 2018-06-25  Youenn Fablet  <youenn@apple.com>
 
         Add a sandbox profile to Hangout plug-in
index 27d75c0..f76d7aa 100644 (file)
@@ -7303,10 +7303,10 @@ void WebPageProxy::setDefaultAppearance(bool defaultAppearance)
 {
     if (!isValid())
         return;
-
-    // Don't return early, even if m_defaultAppearance == defaultAppearance.
-    // The system appearance might have changed under us, like for accessibility.
-
+    
+    if (defaultAppearance == m_defaultAppearance)
+        return;
+    
     m_defaultAppearance = defaultAppearance;
     m_process->send(Messages::WebPage::SetDefaultAppearance(defaultAppearance), m_pageID);
 }
index 87150b8..fdd4dbe 100644 (file)
@@ -4201,10 +4201,12 @@ void WebPage::setUseSystemAppearance(bool useSystemAppearance)
 {
     corePage()->setUseSystemAppearance(useSystemAppearance);
 }
-
+    
 void WebPage::setDefaultAppearance(bool defaultAppearance)
 {
     corePage()->setDefaultAppearance(defaultAppearance);
+    RenderTheme::singleton().platformColorsDidChange();
+    corePage()->setNeedsRecalcStyleInAllFrames();
 }
 #endif
 
index 49d2209..412e401 100644 (file)
@@ -1,3 +1,14 @@
+2018-06-25  Keith Rollin  <krollin@apple.com>
+        Unreviewed, rolling out r233087.
+
+        Causes 5% Mac PLT regression.
+
+        Reverted changeset:
+
+        "Recalc styles every time defaultAppearance changes."
+        https://bugs.webkit.org/show_bug.cgi?id=186866
+        https://trac.webkit.org/changeset/233087
+
 2018-06-23  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         [WTF] Add user-defined literal for ASCIILiteral
index b5c8450..57310f7 100644 (file)
@@ -5288,19 +5288,23 @@ static Vector<String> toStringVector(NSArray* patterns)
 - (void)_updateDefaultAppearance
 {
     _private->page->setDefaultAppearance([self _defaultAppearance]);
+    RenderTheme::singleton().platformColorsDidChange();
+    _private->page->setNeedsRecalcStyleInAllFrames();
 }
 
 - (void)_setUseSystemAppearance:(BOOL)useSystemAppearance
 {
-    if (_private && _private->page)
-        _private->page->setUseSystemAppearance(useSystemAppearance);
+    if (auto page = _private->page) {
+        page->setUseSystemAppearance(useSystemAppearance);
+        [self _updateDefaultAppearance];
+    }
 }
 
 - (BOOL)_useSystemAppearance
 {
     if (!_private->page)
         return NO;
-
+    
     return _private->page->useSystemAppearance();
 }