Title: [231648] trunk/Source/WebKit
- Revision
- 231648
- Author
- [email protected]
- Date
- 2018-05-10 11:31:59 -0700 (Thu, 10 May 2018)
Log Message
REGRESSION(r230323): UIProcess needs to notify WebContent process of Accessibility setting changes
https://bugs.webkit.org/show_bug.cgi?id=185515
<rdar://problem/39627764>
Reviewed by Chris Fleizach.
The UIProcess needs to register for relevant Accessibility preference updates so that it can notify the
WebContent processes that screen properties have changed.
This is represented by NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification.
Tested manually with the Accessibility preferences pane.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::registerNotificationObservers): Add notification observer. When the notification
is received, call 'screenPropertiesStateChanged' to message the information to the WebContent processes.
(WebKit::WebProcessPool::unregisterNotificationObservers): Clean up observer.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::screenPropertiesStateChanged): Added helper function.
* UIProcess/WebProcessPool.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (231647 => 231648)
--- trunk/Source/WebKit/ChangeLog 2018-05-10 17:58:20 UTC (rev 231647)
+++ trunk/Source/WebKit/ChangeLog 2018-05-10 18:31:59 UTC (rev 231648)
@@ -1,3 +1,26 @@
+2018-05-10 Brent Fulgham <[email protected]>
+
+ REGRESSION(r230323): UIProcess needs to notify WebContent process of Accessibility setting changes
+ https://bugs.webkit.org/show_bug.cgi?id=185515
+ <rdar://problem/39627764>
+
+ Reviewed by Chris Fleizach.
+
+ The UIProcess needs to register for relevant Accessibility preference updates so that it can notify the
+ WebContent processes that screen properties have changed.
+
+ This is represented by NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification.
+
+ Tested manually with the Accessibility preferences pane.
+
+ * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+ (WebKit::WebProcessPool::registerNotificationObservers): Add notification observer. When the notification
+ is received, call 'screenPropertiesStateChanged' to message the information to the WebContent processes.
+ (WebKit::WebProcessPool::unregisterNotificationObservers): Clean up observer.
+ * UIProcess/WebProcessPool.cpp:
+ (WebKit::WebProcessPool::screenPropertiesStateChanged): Added helper function.
+ * UIProcess/WebProcessPool.h:
+
2018-05-09 Carlos Garcia Campos <[email protected]>
WebDriver: implement advance user interactions
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (231647 => 231648)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2018-05-10 17:58:20 UTC (rev 231647)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2018-05-10 18:31:59 UTC (rev 231648)
@@ -561,11 +561,14 @@
textCheckerStateChanged();
}];
+ m_accessibilityDisplayOptionsNotificationObserver = [[NSWorkspace.sharedWorkspace notificationCenter] addObserverForName:NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) {
+ screenPropertiesStateChanged();
+ }];
+
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
m_scrollerStyleNotificationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSPreferredScrollerStyleDidChangeNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) {
auto scrollbarStyle = [NSScroller preferredScrollerStyle];
- for (auto& processPool : WebKit::WebProcessPool::allProcessPools())
- processPool->sendToAllProcesses(Messages::WebProcess::ScrollerStylePreferenceChanged(scrollbarStyle));
+ sendToAllProcesses(Messages::WebProcess::ScrollerStylePreferenceChanged(scrollbarStyle));
}];
#endif
@@ -580,6 +583,7 @@
[[NSNotificationCenter defaultCenter] removeObserver:m_automaticSpellingCorrectionNotificationObserver.get()];
[[NSNotificationCenter defaultCenter] removeObserver:m_automaticQuoteSubstitutionNotificationObserver.get()];
[[NSNotificationCenter defaultCenter] removeObserver:m_automaticDashSubstitutionNotificationObserver.get()];
+ [[NSWorkspace.sharedWorkspace notificationCenter] removeObserver:m_accessibilityDisplayOptionsNotificationObserver.get()];
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
[[NSNotificationCenter defaultCenter] removeObserver:m_scrollerStyleNotificationObserver.get()];
#endif
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (231647 => 231648)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2018-05-10 17:58:20 UTC (rev 231647)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2018-05-10 18:31:59 UTC (rev 231648)
@@ -416,6 +416,14 @@
sendToAllProcesses(Messages::WebProcess::SetTextCheckerState(TextChecker::state()));
}
+void WebProcessPool::screenPropertiesStateChanged()
+{
+#if PLATFORM(MAC)
+ auto screenProperties = WebCore::getScreenProperties();
+ sendToAllProcesses(Messages::WebProcess::SetScreenProperties(screenProperties.first, screenProperties.second));
+#endif
+}
+
NetworkProcessProxy& WebProcessPool::ensureNetworkProcess(WebsiteDataStore* withWebsiteDataStore)
{
if (m_networkProcess) {
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (231647 => 231648)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.h 2018-05-10 17:58:20 UTC (rev 231647)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h 2018-05-10 18:31:59 UTC (rev 231648)
@@ -453,6 +453,8 @@
void unregisterSuspendedPageProxy(SuspendedPageProxy&);
void didReachGoodTimeToPrewarm();
+ void screenPropertiesStateChanged();
+
private:
void platformInitialize();
@@ -603,6 +605,7 @@
RetainPtr<NSObject> m_automaticSpellingCorrectionNotificationObserver;
RetainPtr<NSObject> m_automaticQuoteSubstitutionNotificationObserver;
RetainPtr<NSObject> m_automaticDashSubstitutionNotificationObserver;
+ RetainPtr<NSObject> m_accessibilityDisplayOptionsNotificationObserver;
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
RetainPtr<NSObject> m_scrollerStyleNotificationObserver;
#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes