Title: [234673] branches/safari-606.1.36.1-branch/Source
Revision
234673
Author
[email protected]
Date
2018-08-07 14:29:28 -0700 (Tue, 07 Aug 2018)

Log Message

Cherry-pick r234652. rdar://problem/43009927

    [macOS] Scrollbars are not visible when using 3rd party mouse
    https://bugs.webkit.org/show_bug.cgi?id=188372

    Reviewed by Simon Fraser.

    Source/WebCore/PAL:

    Added declaration of NSScrollerImpPair class method. This method updates all NSScrollerImpPairs
    with a new recommended scroller style.

    * pal/spi/mac/NSScrollerImpSPI.h:

    Source/WebKit:

    The scrollbars are not visible because they are not updated with the recommended scroller style
    when a 3rd party mouse is used. They still have the overlay style, but the system is
    recommending the legacy style in this case. The UI process is currently notifying the WebProcess
    about changes in the scroller style, but the current style is not set in the WebProcess on
    startup. This patch sets the initial scroller style in the WebProcess by passing it as part of
    the WebProcess creation parameters. Also, to make sure hot-plugging of a 3rd party mouse is
    is visually changing the scroller style of the current page, a class method in NSScrollerImpPair
    is called to update all NSScrollerImpPairs with the new recommended style. This method was
    previously called by AppKit, but after blocking WindowServer access, AppKit is no longer calling
    this method. This has been manually tested by using a 3rd party mouse.

    * Shared/WebProcessCreationParameters.cpp:
    (WebKit::WebProcessCreationParameters::encode const):
    (WebKit::WebProcessCreationParameters::decode):
    * Shared/WebProcessCreationParameters.h:
    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
    (WebKit::WebProcessPool::platformInitializeWebProcess):
    * WebProcess/cocoa/WebProcessCocoa.mm:
    (WebKit::WebProcess::platformInitializeWebProcess):
    (WebKit::WebProcess::scrollerStylePreferenceChanged):

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

Modified Paths

Diff

Modified: branches/safari-606.1.36.1-branch/Source/WebCore/PAL/ChangeLog (234672 => 234673)


--- branches/safari-606.1.36.1-branch/Source/WebCore/PAL/ChangeLog	2018-08-07 21:29:25 UTC (rev 234672)
+++ branches/safari-606.1.36.1-branch/Source/WebCore/PAL/ChangeLog	2018-08-07 21:29:28 UTC (rev 234673)
@@ -1,3 +1,57 @@
+2018-08-07  Kocsen Chung  <[email protected]>
+
+        Cherry-pick r234652. rdar://problem/43009927
+
+    [macOS] Scrollbars are not visible when using 3rd party mouse
+    https://bugs.webkit.org/show_bug.cgi?id=188372
+    
+    Reviewed by Simon Fraser.
+    
+    Source/WebCore/PAL:
+    
+    Added declaration of NSScrollerImpPair class method. This method updates all NSScrollerImpPairs
+    with a new recommended scroller style.
+    
+    * pal/spi/mac/NSScrollerImpSPI.h:
+    
+    Source/WebKit:
+    
+    The scrollbars are not visible because they are not updated with the recommended scroller style
+    when a 3rd party mouse is used. They still have the overlay style, but the system is
+    recommending the legacy style in this case. The UI process is currently notifying the WebProcess
+    about changes in the scroller style, but the current style is not set in the WebProcess on
+    startup. This patch sets the initial scroller style in the WebProcess by passing it as part of
+    the WebProcess creation parameters. Also, to make sure hot-plugging of a 3rd party mouse is
+    is visually changing the scroller style of the current page, a class method in NSScrollerImpPair
+    is called to update all NSScrollerImpPairs with the new recommended style. This method was
+    previously called by AppKit, but after blocking WindowServer access, AppKit is no longer calling
+    this method. This has been manually tested by using a 3rd party mouse.
+    
+    * Shared/WebProcessCreationParameters.cpp:
+    (WebKit::WebProcessCreationParameters::encode const):
+    (WebKit::WebProcessCreationParameters::decode):
+    * Shared/WebProcessCreationParameters.h:
+    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+    (WebKit::WebProcessPool::platformInitializeWebProcess):
+    * WebProcess/cocoa/WebProcessCocoa.mm:
+    (WebKit::WebProcess::platformInitializeWebProcess):
+    (WebKit::WebProcess::scrollerStylePreferenceChanged):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-08-07  Per Arne Vollan  <[email protected]>
+
+            [macOS] Scrollbars are not visible when using 3rd party mouse
+            https://bugs.webkit.org/show_bug.cgi?id=188372
+
+            Reviewed by Simon Fraser.
+
+            Added declaration of NSScrollerImpPair class method. This method updates all NSScrollerImpPairs
+            with a new recommended scroller style.
+
+            * pal/spi/mac/NSScrollerImpSPI.h:
+
 2018-07-30  Babak Shafiei  <[email protected]>
 
         Revert r233926. rdar://problem/42354941

Modified: branches/safari-606.1.36.1-branch/Source/WebCore/PAL/pal/spi/mac/NSScrollerImpSPI.h (234672 => 234673)


--- branches/safari-606.1.36.1-branch/Source/WebCore/PAL/pal/spi/mac/NSScrollerImpSPI.h	2018-08-07 21:29:25 UTC (rev 234672)
+++ branches/safari-606.1.36.1-branch/Source/WebCore/PAL/pal/spi/mac/NSScrollerImpSPI.h	2018-08-07 21:29:28 UTC (rev 234673)
@@ -38,6 +38,7 @@
 
 @interface NSScrollerImpPair ()
 + (NSUserInterfaceLayoutDirection)scrollerLayoutDirection;
++ (void)_updateAllScrollerImpPairsForNewRecommendedScrollerStyle:(NSScrollerStyle)newRecommendedScrollerStyle;
 @end
 
 #else
@@ -133,6 +134,7 @@
 - (void)endLiveResize;
 - (void)beginScrollGesture;
 - (void)endScrollGesture;
++ (void)_updateAllScrollerImpPairsForNewRecommendedScrollerStyle:(NSScrollerStyle)newRecommendedScrollerStyle;
 @end
 
 @protocol NSScrollerImpPairDelegate

Modified: branches/safari-606.1.36.1-branch/Source/WebKit/ChangeLog (234672 => 234673)


--- branches/safari-606.1.36.1-branch/Source/WebKit/ChangeLog	2018-08-07 21:29:25 UTC (rev 234672)
+++ branches/safari-606.1.36.1-branch/Source/WebKit/ChangeLog	2018-08-07 21:29:28 UTC (rev 234673)
@@ -1,5 +1,75 @@
 2018-08-07  Kocsen Chung  <[email protected]>
 
+        Cherry-pick r234652. rdar://problem/43009927
+
+    [macOS] Scrollbars are not visible when using 3rd party mouse
+    https://bugs.webkit.org/show_bug.cgi?id=188372
+    
+    Reviewed by Simon Fraser.
+    
+    Source/WebCore/PAL:
+    
+    Added declaration of NSScrollerImpPair class method. This method updates all NSScrollerImpPairs
+    with a new recommended scroller style.
+    
+    * pal/spi/mac/NSScrollerImpSPI.h:
+    
+    Source/WebKit:
+    
+    The scrollbars are not visible because they are not updated with the recommended scroller style
+    when a 3rd party mouse is used. They still have the overlay style, but the system is
+    recommending the legacy style in this case. The UI process is currently notifying the WebProcess
+    about changes in the scroller style, but the current style is not set in the WebProcess on
+    startup. This patch sets the initial scroller style in the WebProcess by passing it as part of
+    the WebProcess creation parameters. Also, to make sure hot-plugging of a 3rd party mouse is
+    is visually changing the scroller style of the current page, a class method in NSScrollerImpPair
+    is called to update all NSScrollerImpPairs with the new recommended style. This method was
+    previously called by AppKit, but after blocking WindowServer access, AppKit is no longer calling
+    this method. This has been manually tested by using a 3rd party mouse.
+    
+    * Shared/WebProcessCreationParameters.cpp:
+    (WebKit::WebProcessCreationParameters::encode const):
+    (WebKit::WebProcessCreationParameters::decode):
+    * Shared/WebProcessCreationParameters.h:
+    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+    (WebKit::WebProcessPool::platformInitializeWebProcess):
+    * WebProcess/cocoa/WebProcessCocoa.mm:
+    (WebKit::WebProcess::platformInitializeWebProcess):
+    (WebKit::WebProcess::scrollerStylePreferenceChanged):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-08-07  Per Arne Vollan  <[email protected]>
+
+            [macOS] Scrollbars are not visible when using 3rd party mouse
+            https://bugs.webkit.org/show_bug.cgi?id=188372
+
+            Reviewed by Simon Fraser.
+
+            The scrollbars are not visible because they are not updated with the recommended scroller style
+            when a 3rd party mouse is used. They still have the overlay style, but the system is
+            recommending the legacy style in this case. The UI process is currently notifying the WebProcess
+            about changes in the scroller style, but the current style is not set in the WebProcess on
+            startup. This patch sets the initial scroller style in the WebProcess by passing it as part of
+            the WebProcess creation parameters. Also, to make sure hot-plugging of a 3rd party mouse is
+            is visually changing the scroller style of the current page, a class method in NSScrollerImpPair
+            is called to update all NSScrollerImpPairs with the new recommended style. This method was
+            previously called by AppKit, but after blocking WindowServer access, AppKit is no longer calling
+            this method. This has been manually tested by using a 3rd party mouse.
+
+            * Shared/WebProcessCreationParameters.cpp:
+            (WebKit::WebProcessCreationParameters::encode const):
+            (WebKit::WebProcessCreationParameters::decode):
+            * Shared/WebProcessCreationParameters.h:
+            * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+            (WebKit::WebProcessPool::platformInitializeWebProcess):
+            * WebProcess/cocoa/WebProcessCocoa.mm:
+            (WebKit::WebProcess::platformInitializeWebProcess):
+            (WebKit::WebProcess::scrollerStylePreferenceChanged):
+
+2018-08-07  Kocsen Chung  <[email protected]>
+
         Cherry-pick r234626. rdar://problem/43009894
 
     Regression(NetworkLoadChecker): CORS preflights are no longer able to deal with client certificate authentication

Modified: branches/safari-606.1.36.1-branch/Source/WebKit/Shared/WebProcessCreationParameters.cpp (234672 => 234673)


--- branches/safari-606.1.36.1-branch/Source/WebKit/Shared/WebProcessCreationParameters.cpp	2018-08-07 21:29:25 UTC (rev 234672)
+++ branches/safari-606.1.36.1-branch/Source/WebKit/Shared/WebProcessCreationParameters.cpp	2018-08-07 21:29:28 UTC (rev 234673)
@@ -158,6 +158,7 @@
 
 #if PLATFORM(MAC)
     encoder << screenProperties;
+    encoder << useOverlayScrollbars;
 #endif
 }
 
@@ -414,6 +415,8 @@
     if (!screenProperties)
         return false;
     parameters.screenProperties = WTFMove(*screenProperties);
+    if (!decoder.decode(parameters.useOverlayScrollbars))
+        return false;
 #endif
 
     return true;

Modified: branches/safari-606.1.36.1-branch/Source/WebKit/Shared/WebProcessCreationParameters.h (234672 => 234673)


--- branches/safari-606.1.36.1-branch/Source/WebKit/Shared/WebProcessCreationParameters.h	2018-08-07 21:29:25 UTC (rev 234672)
+++ branches/safari-606.1.36.1-branch/Source/WebKit/Shared/WebProcessCreationParameters.h	2018-08-07 21:29:28 UTC (rev 234673)
@@ -197,6 +197,7 @@
 
 #if PLATFORM(MAC)
     WebCore::ScreenProperties screenProperties;
+    bool useOverlayScrollbars { true };
 #endif
 };
 

Modified: branches/safari-606.1.36.1-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (234672 => 234673)


--- branches/safari-606.1.36.1-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2018-08-07 21:29:25 UTC (rev 234672)
+++ branches/safari-606.1.36.1-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2018-08-07 21:29:28 UTC (rev 234673)
@@ -286,6 +286,7 @@
 #if PLATFORM(MAC)
     auto screenProperties = WebCore::collectScreenProperties();
     parameters.screenProperties = WTFMove(screenProperties);
+    parameters.useOverlayScrollbars = ([NSScroller preferredScrollerStyle] == NSScrollerStyleOverlay);
 #endif
 }
 

Modified: branches/safari-606.1.36.1-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (234672 => 234673)


--- branches/safari-606.1.36.1-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2018-08-07 21:29:25 UTC (rev 234672)
+++ branches/safari-606.1.36.1-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2018-08-07 21:29:28 UTC (rev 234673)
@@ -86,6 +86,7 @@
 
 #if PLATFORM(MAC)
 #import <WebCore/ScrollbarThemeMac.h>
+#import <pal/spi/mac/NSScrollerImpSPI.h>
 #endif
 
 #if USE(OS_STATE)
@@ -196,7 +197,10 @@
 
 #if PLATFORM(MAC)
     WebCore::setScreenProperties(parameters.screenProperties);
+#if ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING)
+    scrollerStylePreferenceChanged(parameters.useOverlayScrollbars);
 #endif
+#endif
 }
 
 void WebProcess::initializeProcessName(const ChildProcessInitializationParameters& parameters)
@@ -591,6 +595,9 @@
         return;
 
     static_cast<ScrollbarThemeMac&>(theme).preferencesChanged();
+    
+    NSScrollerStyle style = useOverlayScrollbars ? NSScrollerStyleOverlay : NSScrollerStyleLegacy;
+    [NSScrollerImpPair _updateAllScrollerImpPairsForNewRecommendedScrollerStyle:style];
 }
 #endif    
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to