Diff
Modified: trunk/Source/WebCore/ChangeLog (233086 => 233087)
--- trunk/Source/WebCore/ChangeLog 2018-06-22 18:29:46 UTC (rev 233086)
+++ trunk/Source/WebCore/ChangeLog 2018-06-22 18:32:45 UTC (rev 233087)
@@ -1,3 +1,18 @@
+2018-06-22 Timothy Hatcher <[email protected]>
+
+ Recalc styles every time defaultAppearance changes.
+ https://bugs.webkit.org/show_bug.cgi?id=186866
+ rdar://problem/41309805
+
+ Reviewed by Tim Horton.
+
+ * page/Page.cpp:
+ (WebCore::Page::setUseSystemAppearance): Added. Recalc styles and update system colors.
+ (WebCore::Page::setDefaultAppearance): Added. Ditto.
+ * page/Page.h:
+ (WebCore::Page::setUseSystemAppearance): Deleted impl.
+ (WebCore::Page::setDefaultAppearance): Deleted impl.
+
2018-06-22 Thibault Saunier <[email protected]>
[GStreamer] Avoid sending SELECT_STREAM events when nothing changed
Modified: trunk/Source/WebCore/page/Page.cpp (233086 => 233087)
--- trunk/Source/WebCore/page/Page.cpp 2018-06-22 18:29:46 UTC (rev 233086)
+++ trunk/Source/WebCore/page/Page.cpp 2018-06-22 18:32:45 UTC (rev 233087)
@@ -2369,6 +2369,17 @@
}
}
+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();
@@ -2377,6 +2388,17 @@
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)
Modified: trunk/Source/WebCore/page/Page.h (233086 => 233087)
--- trunk/Source/WebCore/page/Page.h 2018-06-22 18:29:46 UTC (rev 233086)
+++ trunk/Source/WebCore/page/Page.h 2018-06-22 18:32:45 UTC (rev 233087)
@@ -338,12 +338,12 @@
bool enclosedInScrollableAncestorView() const { return m_enclosedInScrollableAncestorView; }
void setEnclosedInScrollableAncestorView(bool f) { m_enclosedInScrollableAncestorView = f; }
#endif
-
+
bool useSystemAppearance() const { return m_useSystemAppearance; }
- void setUseSystemAppearance(bool a) { m_useSystemAppearance = a; }
+ WEBCORE_EXPORT void setUseSystemAppearance(bool);
bool defaultAppearance() const;
- void setDefaultAppearance(bool a) { m_defaultAppearance = a; }
+ WEBCORE_EXPORT void setDefaultAppearance(bool);
#if ENABLE(TEXT_AUTOSIZING)
float textAutosizingWidth() const { return m_textAutosizingWidth; }
Modified: trunk/Source/WebKit/ChangeLog (233086 => 233087)
--- trunk/Source/WebKit/ChangeLog 2018-06-22 18:29:46 UTC (rev 233086)
+++ trunk/Source/WebKit/ChangeLog 2018-06-22 18:32:45 UTC (rev 233087)
@@ -1,3 +1,16 @@
+2018-06-22 Timothy Hatcher <[email protected]>
+
+ Recalc styles every time defaultAppearance changes.
+ https://bugs.webkit.org/show_bug.cgi?id=186866
+ rdar://problem/41309805
+
+ Reviewed by Tim Horton.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::setDefaultAppearance):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::setDefaultAppearance):
+
2018-06-22 Sihui Liu <[email protected]>
REGRESSION (r231850): Cookie file cannot be read or written by network process
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (233086 => 233087)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2018-06-22 18:29:46 UTC (rev 233086)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2018-06-22 18:32:45 UTC (rev 233087)
@@ -7303,10 +7303,10 @@
{
if (!isValid())
return;
-
- if (defaultAppearance == m_defaultAppearance)
- return;
-
+
+ // Don't return early, even if m_defaultAppearance == defaultAppearance.
+ // The system appearance might have changed under us, like for accessibility.
+
m_defaultAppearance = defaultAppearance;
m_process->send(Messages::WebPage::SetDefaultAppearance(defaultAppearance), m_pageID);
}
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (233086 => 233087)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2018-06-22 18:29:46 UTC (rev 233086)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2018-06-22 18:32:45 UTC (rev 233087)
@@ -4193,12 +4193,10 @@
{
corePage()->setUseSystemAppearance(useSystemAppearance);
}
-
+
void WebPage::setDefaultAppearance(bool defaultAppearance)
{
corePage()->setDefaultAppearance(defaultAppearance);
- RenderTheme::singleton().platformColorsDidChange();
- corePage()->setNeedsRecalcStyleInAllFrames();
}
#endif
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (233086 => 233087)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2018-06-22 18:29:46 UTC (rev 233086)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2018-06-22 18:32:45 UTC (rev 233087)
@@ -1,3 +1,16 @@
+2018-06-22 Timothy Hatcher <[email protected]>
+
+ Recalc styles every time defaultAppearance changes.
+ https://bugs.webkit.org/show_bug.cgi?id=186866
+ rdar://problem/41309805
+
+ Reviewed by Tim Horton.
+
+ * WebView/WebView.mm:
+ (-[WebView _updateDefaultAppearance]):
+ (-[WebView _setUseSystemAppearance:]):
+ (-[WebView _useSystemAppearance]):
+
2018-06-20 Darin Adler <[email protected]>
[Cocoa] Use the isDirectory: variants of NSURL methods more to eliminate unnecessary file system activity
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (233086 => 233087)
--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2018-06-22 18:29:46 UTC (rev 233086)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2018-06-22 18:32:45 UTC (rev 233087)
@@ -5288,16 +5288,12 @@
- (void)_updateDefaultAppearance
{
_private->page->setDefaultAppearance([self _defaultAppearance]);
- RenderTheme::singleton().platformColorsDidChange();
- _private->page->setNeedsRecalcStyleInAllFrames();
}
- (void)_setUseSystemAppearance:(BOOL)useSystemAppearance
{
- if (auto page = _private->page) {
- page->setUseSystemAppearance(useSystemAppearance);
- [self _updateDefaultAppearance];
- }
+ if (_private && _private->page)
+ _private->page->setUseSystemAppearance(useSystemAppearance);
}
- (BOOL)_useSystemAppearance
@@ -5304,7 +5300,7 @@
{
if (!_private->page)
return NO;
-
+
return _private->page->useSystemAppearance();
}