Title: [231790] branches/safari-606.1.17-branch/Source/WebKit
Revision
231790
Author
[email protected]
Date
2018-05-15 01:06:54 -0700 (Tue, 15 May 2018)

Log Message

Cherry-pick r231648. rdar://problem/39627764

    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:

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

Modified Paths

Diff

Modified: branches/safari-606.1.17-branch/Source/WebKit/ChangeLog (231789 => 231790)


--- branches/safari-606.1.17-branch/Source/WebKit/ChangeLog	2018-05-15 05:35:25 UTC (rev 231789)
+++ branches/safari-606.1.17-branch/Source/WebKit/ChangeLog	2018-05-15 08:06:54 UTC (rev 231790)
@@ -1,3 +1,54 @@
+2018-05-15  Babak Shafiei  <[email protected]>
+
+        Cherry-pick r231648. rdar://problem/39627764
+
+    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:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    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-13  Babak Shafiei  <[email protected]>
 
         Cherry-pick r231744. rdar://problem/40196581

Modified: branches/safari-606.1.17-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (231789 => 231790)


--- branches/safari-606.1.17-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2018-05-15 05:35:25 UTC (rev 231789)
+++ branches/safari-606.1.17-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2018-05-15 08:06:54 UTC (rev 231790)
@@ -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: branches/safari-606.1.17-branch/Source/WebKit/UIProcess/WebProcessPool.cpp (231789 => 231790)


--- branches/safari-606.1.17-branch/Source/WebKit/UIProcess/WebProcessPool.cpp	2018-05-15 05:35:25 UTC (rev 231789)
+++ branches/safari-606.1.17-branch/Source/WebKit/UIProcess/WebProcessPool.cpp	2018-05-15 08:06:54 UTC (rev 231790)
@@ -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: branches/safari-606.1.17-branch/Source/WebKit/UIProcess/WebProcessPool.h (231789 => 231790)


--- branches/safari-606.1.17-branch/Source/WebKit/UIProcess/WebProcessPool.h	2018-05-15 05:35:25 UTC (rev 231789)
+++ branches/safari-606.1.17-branch/Source/WebKit/UIProcess/WebProcessPool.h	2018-05-15 08:06:54 UTC (rev 231790)
@@ -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

Reply via email to