WebKit Bugzilla
Attachment 347853 Details for
Bug 188379
: [macOS] Create a test for scrollbar visibility when 3rd party mouse is used.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188379-20180822150946.patch (text/plain), 15.78 KB, created by
Per Arne Vollan
on 2018-08-22 15:09:47 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Per Arne Vollan
Created:
2018-08-22 15:09:47 PDT
Size:
15.78 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 235185) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,26 @@ >+2018-08-22 Per Arne Vollan <pvollan@apple.com> >+ >+ [macOS] Create a test for scrollbar visibility when 3rd party mouse is used. >+ https://bugs.webkit.org/show_bug.cgi?id=188379 >+ <rdar://problem/43007729> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When a 3rd party mouse is plugged in, the UI process will receive a notification >+ (NSPreferredScrollerStyleDidChangeNotification), where the legacy scrollbar style >+ is the new preferred style. To simulate this in the test framework, a new WK C API >+ function is added which will notify all WebContent processes that the new preferred >+ scroller style is the legacy one. This API function can be invoked from JavaScript. >+ This test will validate that the layout actually changes when receiving this message >+ from the UI process, since it will force scrollbars to become visible. >+ >+ * UIProcess/WebProcessPool.cpp: >+ (WebKit::WebProcessPool::setUseOverlayScrollbarsForTesting): >+ * UIProcess/WebProcessPool.h: >+ * WebKit.xcodeproj/project.pbxproj: >+ * WebProcess/cocoa/WebProcessCocoa.mm: >+ (WebKit::WebProcess::scrollerStylePreferenceChanged): >+ > 2018-08-22 Sihui Liu <sihui_liu@apple.com> > > Try removing defaultSessionParameters from NetworkProcessCreationParameters >Index: Source/WebKit/UIProcess/WebProcessPool.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebProcessPool.cpp (revision 235185) >+++ Source/WebKit/UIProcess/WebProcessPool.cpp (working copy) >@@ -2299,4 +2299,12 @@ void WebProcessPool::sendDisplayConfigur > #endif > } > >+#if PLATFORM(MAC) >+void WebProcessPool::setUseOverlayScrollbarsForTesting(bool useOverlayScrollbars) >+{ >+ for (auto& processPool : WebProcessPool::allProcessPools()) >+ processPool->sendToAllProcesses(Messages::WebProcess::ScrollerStylePreferenceChanged(useOverlayScrollbars)); >+} >+#endif >+ > } // namespace WebKit >Index: Source/WebKit/UIProcess/WebProcessPool.h >=================================================================== >--- Source/WebKit/UIProcess/WebProcessPool.h (revision 235185) >+++ Source/WebKit/UIProcess/WebProcessPool.h (working copy) >@@ -473,6 +473,10 @@ public: > void resetMockMediaDevices(); > > void sendDisplayConfigurationChangedMessageForTesting(); >+ >+#if PLATFORM(MAC) >+ void setUseOverlayScrollbarsForTesting(bool); >+#endif > > private: > void platformInitialize(); >Index: Source/WebKit/WebKit.xcodeproj/project.pbxproj >=================================================================== >--- Source/WebKit/WebKit.xcodeproj/project.pbxproj (revision 235185) >+++ Source/WebKit/WebKit.xcodeproj/project.pbxproj (working copy) >@@ -1971,6 +1971,8 @@ > E1D26A53175964D90095BFD1 /* WebContentProcess.xib in Resources */ = {isa = PBXBuildFile; fileRef = E1D26A4C1759634E0095BFD1 /* WebContentProcess.xib */; }; > E1E552C516AE065F004ED653 /* SandboxInitializationParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E552C316AE065E004ED653 /* SandboxInitializationParameters.h */; }; > E1EE53E311F8CFC000CCBEE4 /* InjectedBundlePageEditorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE53DC11F8CF9F00CCBEE4 /* InjectedBundlePageEditorClient.h */; }; >+ E30C6B71212DE1E500FE0796 /* WKScrollbarStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E30C6B6F212DE1E500FE0796 /* WKScrollbarStyle.cpp */; }; >+ E30C6B72212DE1E500FE0796 /* WKScrollbarStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = E30C6B70212DE1E500FE0796 /* WKScrollbarStyle.h */; settings = {ATTRIBUTES = (Private, ); }; }; > E413F59D1AC1ADC400345360 /* NetworkCacheEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = E413F59B1AC1ADB600345360 /* NetworkCacheEntry.h */; }; > E42E06101AA7523B00B11699 /* NetworkCacheIOChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = E42E060B1AA7440D00B11699 /* NetworkCacheIOChannel.h */; }; > E42E06121AA75ABD00B11699 /* NetworkCacheData.h in Headers */ = {isa = PBXBuildFile; fileRef = E42E06111AA75ABD00B11699 /* NetworkCacheData.h */; }; >@@ -4765,6 +4767,8 @@ > E1EE53E611F8CFFB00CCBEE4 /* InjectedBundlePageEditorClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageEditorClient.cpp; sourceTree = "<group>"; }; > E1FEF39A190F76F300731658 /* com.apple.WebKit.Storage.sb.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = com.apple.WebKit.Storage.sb.in; sourceTree = "<group>"; }; > E1FEF39C190F791C00731658 /* StorageProcessIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StorageProcessIOS.mm; sourceTree = "<group>"; }; >+ E30C6B6F212DE1E500FE0796 /* WKScrollbarStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKScrollbarStyle.cpp; sourceTree = "<group>"; }; >+ E30C6B70212DE1E500FE0796 /* WKScrollbarStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKScrollbarStyle.h; sourceTree = "<group>"; }; > E413F59B1AC1ADB600345360 /* NetworkCacheEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCacheEntry.h; sourceTree = "<group>"; }; > E413F59E1AC1AF9D00345360 /* NetworkCacheEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkCacheEntry.cpp; sourceTree = "<group>"; }; > E42E060B1AA7440D00B11699 /* NetworkCacheIOChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCacheIOChannel.h; sourceTree = "<group>"; }; >@@ -7886,6 +7890,8 @@ > 518ACAE912AEE6BB00B04B83 /* WKProtectionSpaceTypes.h */, > 33367638130C99DC006C9DE2 /* WKResourceCacheManager.cpp */, > 33367639130C99DC006C9DE2 /* WKResourceCacheManager.h */, >+ E30C6B6F212DE1E500FE0796 /* WKScrollbarStyle.cpp */, >+ E30C6B70212DE1E500FE0796 /* WKScrollbarStyle.h */, > 1ADE46B01954EC61000F7985 /* WKSessionStateRef.cpp */, > 1ADE46B11954EC61000F7985 /* WKSessionStateRef.h */, > 51F886A31F2C214A00C193EF /* WKTestingSupport.cpp */, >@@ -10025,6 +10031,7 @@ > 1A7E377918E4A4FE003D0FFF /* WKScriptMessage.h in Headers */, > 1A7E377518E4A33A003D0FFF /* WKScriptMessageHandler.h in Headers */, > 7CC99A3618EF7CBC0048C8B4 /* WKScriptMessageInternal.h in Headers */, >+ E30C6B72212DE1E500FE0796 /* WKScrollbarStyle.h in Headers */, > 0FCB4E5418BBE044000FCFC9 /* WKScrollView.h in Headers */, > 51CD1C651B34B9D400142CA5 /* WKSecurityOrigin.h in Headers */, > 51CD1C671B34B9DF00142CA5 /* WKSecurityOriginInternal.h in Headers */, >@@ -11663,6 +11670,7 @@ > 37608822150414F700FC82C7 /* WKRenderObject.cpp in Sources */, > 3336763A130C99DC006C9DE2 /* WKResourceCacheManager.cpp in Sources */, > 1A7E377818E4A4FE003D0FFF /* WKScriptMessage.mm in Sources */, >+ E30C6B71212DE1E500FE0796 /* WKScrollbarStyle.cpp in Sources */, > 0FCB4E5518BBE044000FCFC9 /* WKScrollView.mm in Sources */, > 51CD1C661B34B9DC00142CA5 /* WKSecurityOrigin.mm in Sources */, > 51CD1C5D1B3493AF00142CA5 /* WKSecurityOriginRef.cpp in Sources */, >Index: Tools/ChangeLog >=================================================================== >--- Tools/ChangeLog (revision 235201) >+++ Tools/ChangeLog (working copy) >@@ -1,3 +1,29 @@ >+2018-08-22 Per Arne Vollan <pvollan@apple.com> >+ >+ [macOS] Create a test for scrollbar visibility when 3rd party mouse is used. >+ https://bugs.webkit.org/show_bug.cgi?id=188379 >+ <rdar://problem/43007729> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When a 3rd party mouse is plugged in, the UI process will receive a notification >+ (NSPreferredScrollerStyleDidChangeNotification), where the legacy scrollbar style >+ is the new preferred style. To simulate this in the test framework, a new WK C API >+ function is added which will notify all WebContent processes that the new preferred >+ scroller style is the legacy one. This API function can be invoked from JavaScript. >+ This test will validate that the layout actually changes when receiving this message >+ from the UI process, since it will force scrollbars to become visible. >+ >+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: >+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp: >+ (WTR::TestRunner::setUseOverlayScrollbarsForTesting): >+ * WebKitTestRunner/InjectedBundle/TestRunner.h: >+ * WebKitTestRunner/TestController.cpp: >+ (WTR::TestController::setUseOverlayScrollbarsForTesting): >+ * WebKitTestRunner/TestController.h: >+ * WebKitTestRunner/TestInvocation.cpp: >+ (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): >+ > 2018-08-22 Aditya Keerthi <akeerthi@apple.com> > > [iOS] Add support for the inputmode attribute >Index: Tools/WebKitTestRunner/TestController.cpp >=================================================================== >--- Tools/WebKitTestRunner/TestController.cpp (revision 235185) >+++ Tools/WebKitTestRunner/TestController.cpp (working copy) >@@ -86,6 +86,10 @@ > #include <WebKit/WKPagePrivateMac.h> > #endif > >+#if PLATFORM(MAC) >+#include <WebKit/WKScrollbarStyle.h> >+#endif >+ > namespace WTR { > > const unsigned TestController::viewWidth = 800; >@@ -2975,4 +2979,11 @@ void TestController::sendDisplayConfigur > WKSendDisplayConfigurationChangedMessageForTesting(platformContext()); > } > >+#if PLATFORM(MAC) >+void TestController::setUseOverlayScrollbarsForTesting(bool useOverlayScrollbars) >+{ >+ WKContextSetUseOverlayScrollbarsForTesting(platformContext(), useOverlayScrollbars); >+} >+#endif >+ > } // namespace WTR >Index: Tools/WebKitTestRunner/TestController.h >=================================================================== >--- Tools/WebKitTestRunner/TestController.h (revision 235185) >+++ Tools/WebKitTestRunner/TestController.h (working copy) >@@ -221,6 +221,10 @@ public: > void injectUserScript(WKStringRef); > > void sendDisplayConfigurationChangedMessageForTesting(); >+ >+#if PLATFORM(MAC) >+ void setUseOverlayScrollbarsForTesting(bool); >+#endif > > private: > WKRetainPtr<WKPageConfigurationRef> generatePageConfiguration(WKContextConfigurationRef); >Index: Tools/WebKitTestRunner/TestInvocation.cpp >=================================================================== >--- Tools/WebKitTestRunner/TestInvocation.cpp (revision 235185) >+++ Tools/WebKitTestRunner/TestInvocation.cpp (working copy) >@@ -1435,6 +1435,15 @@ WKRetainPtr<WKTypeRef> TestInvocation::d > return nullptr; > } > >+#if PLATFORM(MAC) >+ if (WKStringIsEqualToUTF8CString(messageName, "SetUseOverlayScrollbarsForTesting")) { >+ ASSERT(WKGetTypeID(messageBody) == WKBooleanGetTypeID()); >+ WKBooleanRef value = static_cast<WKBooleanRef>(messageBody); >+ TestController::singleton().setUseOverlayScrollbarsForTesting(WKBooleanGetValue(value)); >+ return nullptr; >+ } >+#endif >+ > ASSERT_NOT_REACHED(); > return nullptr; > } >Index: Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >=================================================================== >--- Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (revision 235185) >+++ Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (working copy) >@@ -2328,4 +2328,13 @@ void TestRunner::sendDisplayConfiguratio > WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), nullptr, nullptr); > } > >+void TestRunner::setUseOverlayScrollbarsForTesting(bool useOverlayScrollbars) >+{ >+#if PLATFORM(MAC) >+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("SetUseOverlayScrollbarsForTesting")); >+ WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate(useOverlayScrollbars)); >+ WKBundlePostSynchronousMessage(InjectedBundle::singleton().bundle(), messageName.get(), messageBody.get(), nullptr); >+#endif >+} >+ > } // namespace WTR >Index: Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >=================================================================== >--- Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (revision 235185) >+++ Tools/WebKitTestRunner/InjectedBundle/TestRunner.h (working copy) >@@ -464,6 +464,8 @@ public: > > void sendDisplayConfigurationChangedMessageForTesting(); > >+ void setUseOverlayScrollbarsForTesting(bool); >+ > private: > TestRunner(); > >Index: Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl >=================================================================== >--- Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (revision 235185) >+++ Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl (working copy) >@@ -347,4 +347,6 @@ interface TestRunner { > readonly attribute unsigned long userScriptInjectedCount; > > void sendDisplayConfigurationChangedMessageForTesting(); >+ >+ void setUseOverlayScrollbarsForTesting(boolean useOverlayScrollbars); > }; >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 235202) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,22 @@ >+2018-08-22 Per Arne Vollan <pvollan@apple.com> >+ >+ [macOS] Create a test for scrollbar visibility when 3rd party mouse is used. >+ https://bugs.webkit.org/show_bug.cgi?id=188379 >+ <rdar://problem/43007729> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ When a 3rd party mouse is plugged in, the UI process will receive a notification >+ (NSPreferredScrollerStyleDidChangeNotification), where the legacy scrollbar style >+ is the new preferred style. To simulate this in the test framework, a new WK C API >+ function is added which will notify all WebContent processes that the new preferred >+ scroller style is the legacy one. This API function can be invoked from JavaScript. >+ This test will validate that the layout actually changes when receiving this message >+ from the UI process, since it will force scrollbars to become visible. >+ >+ * fast/scrolling/scrollbar-style-external-mouse-expected.txt: Added. >+ * fast/scrolling/scrollbar-style-external-mouse.html: Added. >+ > 2018-08-22 Aditya Keerthi <akeerthi@apple.com> > > [iOS] Add support for the inputmode attribute >Index: LayoutTests/fast/scrolling/scrollbar-style-external-mouse-expected.txt >=================================================================== >--- LayoutTests/fast/scrolling/scrollbar-style-external-mouse-expected.txt (nonexistent) >+++ LayoutTests/fast/scrolling/scrollbar-style-external-mouse-expected.txt (working copy) >@@ -0,0 +1,8 @@ >+layer at (0,0) size 1008x1016 >+ RenderView at (0,0) size 785x585 >+layer at (0,0) size 785x1016 >+ RenderBlock {HTML} at (0,0) size 785x1016 >+ RenderBody {BODY} at (8,8) size 769x1000 >+ RenderBlock {DIV} at (0,0) size 1000x1000 [bgcolor=#CCCCCC] >+ RenderText {#text} at (0,0) size 51x18 >+ text run at (0,0) width 51: "Test div" >Index: LayoutTests/fast/scrolling/scrollbar-style-external-mouse.html >=================================================================== >--- LayoutTests/fast/scrolling/scrollbar-style-external-mouse.html (nonexistent) >+++ LayoutTests/fast/scrolling/scrollbar-style-external-mouse.html (working copy) >@@ -0,0 +1,29 @@ >+<!DOCTYPE html><!-- webkit-test-runner [ useMockScrollbars=false ] --> >+<html> >+<head> >+<style> >+.div { >+ width: 1000px; >+ height: 1000px; >+ background-color: #ccc; >+} >+</style> >+</head> >+<script> >+if (window.testRunner) { >+ testRunner.waitUntilDone(); >+} >+ >+function onLoad() >+{ >+ if (window.testRunner) { >+ testRunner.setUseOverlayScrollbarsForTesting(false); >+ setTimeout(function(){ testRunner.notifyDone(); }, 10); >+ } >+} >+</script> >+ >+<body onload="onLoad()"> >+<div class="div">Test div</div> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188379
:
347852
|
347853
|
347857
|
347864
|
347865
|
347867
|
347874
|
347890
|
347891
|
347892
|
347917
|
347930
|
348030
|
348152
|
348830
|
348863
|
348945
|
349479