Diff
Modified: trunk/LayoutTests/ChangeLog (242978 => 242979)
--- trunk/LayoutTests/ChangeLog 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/LayoutTests/ChangeLog 2019-03-15 01:10:09 UTC (rev 242979)
@@ -1,3 +1,29 @@
+2019-03-14 Simon Fraser <[email protected]>
+
+ Make it possible to test scrolling tree layer manipulation more easily
+ https://bugs.webkit.org/show_bug.cgi?id=195780
+
+ Reviewed by Tim Horton.
+
+ Add a boolean attribute 'scrollUpdatesDisabled' on UIScriptController that
+ cuts off communication of scrolling tree scrolls back to the web process
+ (in RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll()). This
+ allows tests to trigger scrolls which run the scrolling tree layer positioning
+ logic, but never get another commit from the web process that might mask
+ scrolling tree bugs.
+
+ WKWebView's testing protocol get @property _scrollingUpdatesDisabledForTesting,
+ whose getters and setters are overridden by TestRunnerWKWebView. Plumbing
+ via PageClient and WebPageProxy makes this flag reachable by RemoteScrollingCoordinatorProxy.
+
+ * resources/ui-helper.js: Some 'async' functions that awaited promises should just return
+ the promise.
+ (window.UIHelper.immediateScrollTo):
+ (window.UIHelper.immediateUnstableScrollTo):
+ (window.UIHelper.async.delayFor): Deleted.
+ (window.UIHelper.async.immediateScrollTo): Deleted.
+ (window.UIHelper.async.immediateUnstableScrollTo): Deleted.
+
2019-03-14 Justin Fan <[email protected]>
[Web GPU] Updates to GPUCommandBuffer for new GPUCommandEncoder concept
Modified: trunk/LayoutTests/resources/ui-helper.js (242978 => 242979)
--- trunk/LayoutTests/resources/ui-helper.js 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/LayoutTests/resources/ui-helper.js 2019-03-15 01:10:09 UTC (rev 242979)
@@ -222,12 +222,12 @@
});
}
- static async delayFor(ms)
+ static delayFor(ms)
{
return new Promise(resolve => setTimeout(resolve, ms));
}
- static async immediateScrollTo(x, y)
+ static immediateScrollTo(x, y)
{
if (!this.isWebKit2()) {
window.scrollTo(x, y);
@@ -234,13 +234,13 @@
return Promise.resolve();
}
- await new Promise(resolve => {
+ return new Promise(resolve => {
testRunner.runUIScript(`
uiController.immediateScrollToOffset(${x}, ${y});`, resolve);
});
}
- static async immediateUnstableScrollTo(x, y)
+ static immediateUnstableScrollTo(x, y)
{
if (!this.isWebKit2()) {
window.scrollTo(x, y);
@@ -247,7 +247,7 @@
return Promise.resolve();
}
- await new Promise(resolve => {
+ return new Promise(resolve => {
testRunner.runUIScript(`
uiController.stableStateOverride = false;
uiController.immediateScrollToOffset(${x}, ${y});`, resolve);
Modified: trunk/Source/WebKit/ChangeLog (242978 => 242979)
--- trunk/Source/WebKit/ChangeLog 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Source/WebKit/ChangeLog 2019-03-15 01:10:09 UTC (rev 242979)
@@ -1,3 +1,36 @@
+2019-03-14 Simon Fraser <[email protected]>
+
+ Make it possible to test scrolling tree layer manipulation more easily
+ https://bugs.webkit.org/show_bug.cgi?id=195780
+
+ Reviewed by Tim Horton.
+
+ Add a boolean attribute 'scrollUpdatesDisabled' on UIScriptController that
+ cuts off communication of scrolling tree scrolls back to the web process
+ (in RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll()). This
+ allows tests to trigger scrolls which run the scrolling tree layer positioning
+ logic, but never get another commit from the web process that might mask
+ scrolling tree bugs.
+
+ WKWebView's testing protocol get @property _scrollingUpdatesDisabledForTesting,
+ whose getters and setters are overridden by TestRunnerWKWebView. Plumbing
+ via PageClient and WebPageProxy makes this flag reachable by RemoteScrollingCoordinatorProxy.
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView _scrollingUpdatesDisabledForTesting]):
+ (-[WKWebView _setScrollingUpdatesDisabledForTesting:]):
+ * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+ * UIProcess/Cocoa/PageClientImplCocoa.h:
+ * UIProcess/Cocoa/PageClientImplCocoa.mm:
+ (WebKit::PageClientImplCocoa::scrollingUpdatesDisabledForTesting):
+ * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+ (WebKit::WebPageProxy::scrollingUpdatesDisabledForTesting):
+ * UIProcess/PageClient.h:
+ (WebKit::PageClient::scrollingUpdatesDisabledForTesting):
+ * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
+ (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
+ * UIProcess/WebPageProxy.h:
+
2019-03-14 Youenn Fablet <[email protected]>
Move IDB storage in private browsing mode to NetworkProcess
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (242978 => 242979)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm 2019-03-15 01:10:09 UTC (rev 242979)
@@ -7113,6 +7113,16 @@
});
}
+- (BOOL)_scrollingUpdatesDisabledForTesting
+{
+ // For subclasses to override;
+ return NO;
+}
+
+- (void)_setScrollingUpdatesDisabledForTesting:(BOOL)disabled
+{
+}
+
// Execute the supplied block after the next transaction from the WebProcess.
- (void)_doAfterNextPresentationUpdate:(void (^)(void))updateBlock
{
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h (242978 => 242979)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h 2019-03-15 01:10:09 UTC (rev 242979)
@@ -551,6 +551,8 @@
@property (nonatomic, readonly) _WKInspector *_inspector WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
@property (nonatomic, readonly) _WKFrameHandle *_mainFrame WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+@property (nonatomic, setter=_setScrollingUpdatesDisabledForTesting:) BOOL _scrollingUpdatesDisabledForTesting WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+
- (void)_processWillSuspendImminentlyForTesting;
- (void)_processDidResumeForTesting;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.h (242978 => 242979)
--- trunk/Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.h 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.h 2019-03-15 01:10:09 UTC (rev 242979)
@@ -43,6 +43,8 @@
void isPlayingAudioWillChange() final;
void isPlayingAudioDidChange() final;
+ bool scrollingUpdatesDisabledForTesting() final;
+
#if ENABLE(ATTACHMENT_ELEMENT)
void didInsertAttachment(API::Attachment&, const String& source) final;
void didRemoveAttachment(API::Attachment&) final;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm (242978 => 242979)
--- trunk/Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PageClientImplCocoa.mm 2019-03-15 01:10:09 UTC (rev 242979)
@@ -41,6 +41,11 @@
[m_webView didChangeValueForKey:NSStringFromSelector(@selector(_isPlayingAudio))];
}
+bool PageClientImplCocoa::scrollingUpdatesDisabledForTesting()
+{
+ return [m_webView _scrollingUpdatesDisabledForTesting];
+}
+
#if ENABLE(ATTACHMENT_ELEMENT)
void PageClientImplCocoa::didInsertAttachment(API::Attachment& attachment, const String& source)
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm (242978 => 242979)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm 2019-03-15 01:10:09 UTC (rev 242979)
@@ -135,6 +135,11 @@
}
}
+bool WebPageProxy::scrollingUpdatesDisabledForTesting()
+{
+ return pageClient().scrollingUpdatesDisabledForTesting();
+}
+
#if ENABLE(DRAG_SUPPORT)
void WebPageProxy::startDrag(const DragItem& dragItem, const ShareableBitmap::Handle& dragImageHandle)
Modified: trunk/Source/WebKit/UIProcess/PageClient.h (242978 => 242979)
--- trunk/Source/WebKit/UIProcess/PageClient.h 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Source/WebKit/UIProcess/PageClient.h 2019-03-15 01:10:09 UTC (rev 242979)
@@ -423,8 +423,10 @@
virtual void didChangeBackgroundColor() = 0;
virtual void isPlayingAudioWillChange() = 0;
virtual void isPlayingAudioDidChange() = 0;
+
virtual void pinnedStateWillChange() { }
virtual void pinnedStateDidChange() { }
+ virtual bool scrollingUpdatesDisabledForTesting() { return false; }
virtual bool hasSafeBrowsingWarning() const { return false; }
Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp (242978 => 242979)
--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp 2019-03-15 01:10:09 UTC (rev 242979)
@@ -204,6 +204,9 @@
if (!m_propagatesMainFrameScrolls && scrolledNodeID == rootScrollingNodeID())
return;
+ if (m_webPageProxy.scrollingUpdatesDisabledForTesting())
+ return;
+
#if PLATFORM(IOS_FAMILY)
m_webPageProxy.scrollingNodeScrollViewDidScroll();
#endif
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (242978 => 242979)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2019-03-15 01:10:09 UTC (rev 242979)
@@ -1309,6 +1309,8 @@
void setFooterBannerHeightForTesting(int);
#endif
+ bool scrollingUpdatesDisabledForTesting();
+
void installActivityStateChangeCompletionHandler(Function<void()>&&);
#if USE(UNIFIED_TEXT_CHECKING)
Modified: trunk/Tools/ChangeLog (242978 => 242979)
--- trunk/Tools/ChangeLog 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Tools/ChangeLog 2019-03-15 01:10:09 UTC (rev 242979)
@@ -1,3 +1,39 @@
+2019-03-14 Simon Fraser <[email protected]>
+
+ Make it possible to test scrolling tree layer manipulation more easily
+ https://bugs.webkit.org/show_bug.cgi?id=195780
+
+ Reviewed by Tim Horton.
+
+ Add a boolean attribute 'scrollUpdatesDisabled' on UIScriptController that
+ cuts off communication of scrolling tree scrolls back to the web process
+ (in RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll()). This
+ allows tests to trigger scrolls which run the scrolling tree layer positioning
+ logic, but never get another commit from the web process that might mask
+ scrolling tree bugs.
+
+ WKWebView's testing protocol get @property _scrollingUpdatesDisabledForTesting,
+ whose getters and setters are overridden by TestRunnerWKWebView. Plumbing
+ via PageClient and WebPageProxy makes this flag reachable by RemoteScrollingCoordinatorProxy.
+
+ * DumpRenderTree/ios/UIScriptControllerIOS.mm:
+ (WTR::UIScriptController::scrollUpdatesDisabled const):
+ (WTR::UIScriptController::setScrollUpdatesDisabled):
+ * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
+ * TestRunnerShared/UIScriptContext/UIScriptController.cpp:
+ (WTR::UIScriptController::scrollUpdatesDisabled const):
+ (WTR::UIScriptController::setScrollUpdatesDisabled):
+ * TestRunnerShared/UIScriptContext/UIScriptController.h:
+ * WebKitTestRunner/cocoa/TestRunnerWKWebView.h:
+ * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
+ (-[TestRunnerWKWebView _scrollingUpdatesDisabledForTesting]):
+ (-[TestRunnerWKWebView _setScrollingUpdatesDisabledForTesting:]):
+ * WebKitTestRunner/ios/TestControllerIOS.mm:
+ (WTR::TestController::platformResetStateToConsistentValues):
+ * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+ (WTR::UIScriptController::scrollUpdatesDisabled const):
+ (WTR::UIScriptController::setScrollUpdatesDisabled):
+
2019-03-14 Youenn Fablet <[email protected]>
Move IDB storage in private browsing mode to NetworkProcess
Modified: trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm (242978 => 242979)
--- trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm 2019-03-15 01:10:09 UTC (rev 242979)
@@ -238,6 +238,15 @@
return [gWebScrollView contentOffset].y;
}
+bool UIScriptController::scrollUpdatesDisabled() const
+{
+ return false;
+}
+
+void UIScriptController::setScrollUpdatesDisabled(bool)
+{
+}
+
void UIScriptController::scrollToOffset(long x, long y)
{
[gWebScrollView setContentOffset:contentOffsetBoundedInValidRange(gWebScrollView, CGPointMake(x, y)) animated:YES];
Modified: trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl (242978 => 242979)
--- trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl 2019-03-15 01:10:09 UTC (rev 242979)
@@ -244,6 +244,8 @@
readonly attribute double contentOffsetX;
readonly attribute double contentOffsetY;
+ attribute boolean scrollUpdatesDisabled; // Turns off notifications back to the web process after scrolls (used for testing scrolling tree).
+
void scrollToOffset(long x, long y); // Initiate an animated scroll in the UI process.
attribute object didEndScrollingCallback;
Modified: trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp (242978 => 242979)
--- trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp 2019-03-15 01:10:09 UTC (rev 242979)
@@ -385,6 +385,15 @@
return 0;
}
+bool UIScriptController::scrollUpdatesDisabled() const
+{
+ return false;
+}
+
+void UIScriptController::setScrollUpdatesDisabled(bool)
+{
+}
+
void UIScriptController::scrollToOffset(long x, long y)
{
}
Modified: trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h (242978 => 242979)
--- trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h 2019-03-15 01:10:09 UTC (rev 242979)
@@ -125,6 +125,9 @@
double contentOffsetX() const;
double contentOffsetY() const;
+ bool scrollUpdatesDisabled() const;
+ void setScrollUpdatesDisabled(bool);
+
void scrollToOffset(long x, long y);
void immediateScrollToOffset(long x, long y);
Modified: trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.h (242978 => 242979)
--- trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.h 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.h 2019-03-15 01:10:09 UTC (rev 242979)
@@ -61,5 +61,6 @@
#endif
@property (nonatomic, retain, setter=_setStableStateOverride:) NSNumber *_stableStateOverride;
+@property (nonatomic, setter=_setScrollingUpdatesDisabledForTesting:) BOOL _scrollingUpdatesDisabledForTesting;
@end
Modified: trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm (242978 => 242979)
--- trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Tools/WebKitTestRunner/cocoa/TestRunnerWKWebView.mm 2019-03-15 01:10:09 UTC (rev 242979)
@@ -47,7 +47,8 @@
@interface TestRunnerWKWebView () <WKUIDelegatePrivate> {
RetainPtr<NSNumber> m_stableStateOverride;
- BOOL m_isInteractingWithFormControl;
+ BOOL _isInteractingWithFormControl;
+ BOOL _scrollingUpdatesDisabled;
}
@property (nonatomic, copy) void (^zoomToScaleCompletionHandler)(void);
@@ -108,7 +109,7 @@
- (void)didStartFormControlInteraction
{
- m_isInteractingWithFormControl = YES;
+ _isInteractingWithFormControl = YES;
if (self.didStartFormControlInteractionCallback)
self.didStartFormControlInteractionCallback();
@@ -116,7 +117,7 @@
- (void)didEndFormControlInteraction
{
- m_isInteractingWithFormControl = NO;
+ _isInteractingWithFormControl = NO;
if (self.didEndFormControlInteractionCallback)
self.didEndFormControlInteractionCallback();
@@ -124,7 +125,7 @@
- (BOOL)isInteractingWithFormControl
{
- return m_isInteractingWithFormControl;
+ return _isInteractingWithFormControl;
}
- (void)_didShowForcePressPreview
@@ -234,6 +235,16 @@
[self _scheduleVisibleContentRectUpdate];
}
+- (BOOL)_scrollingUpdatesDisabledForTesting
+{
+ return _scrollingUpdatesDisabled;
+}
+
+- (void)_setScrollingUpdatesDisabledForTesting:(BOOL)disabled
+{
+ _scrollingUpdatesDisabled = disabled;
+}
+
- (void)_didEndRotation
{
if (self.rotationDidEndCallback)
Modified: trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm (242978 => 242979)
--- trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Tools/WebKitTestRunner/ios/TestControllerIOS.mm 2019-03-15 01:10:09 UTC (rev 242979)
@@ -146,6 +146,7 @@
if (PlatformWebView* platformWebView = mainWebView()) {
TestRunnerWKWebView *webView = platformWebView->platformView();
webView._stableStateOverride = nil;
+ webView._scrollingUpdatesDisabledForTesting = NO;
webView.usesSafariLikeRotation = NO;
webView.overrideSafeAreaInsets = UIEdgeInsetsZero;
[webView _clearOverrideLayoutParameters];
Modified: trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (242978 => 242979)
--- trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm 2019-03-15 00:15:09 UTC (rev 242978)
+++ trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm 2019-03-15 01:10:09 UTC (rev 242979)
@@ -546,6 +546,18 @@
return webView.scrollView.contentOffset.y;
}
+bool UIScriptController::scrollUpdatesDisabled() const
+{
+ TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
+ return webView._scrollingUpdatesDisabledForTesting;
+}
+
+void UIScriptController::setScrollUpdatesDisabled(bool disabled)
+{
+ TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();
+ webView._scrollingUpdatesDisabledForTesting = disabled;
+}
+
void UIScriptController::scrollToOffset(long x, long y)
{
TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView();