Diff
Modified: trunk/LayoutTests/ChangeLog (200601 => 200602)
--- trunk/LayoutTests/ChangeLog 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/LayoutTests/ChangeLog 2016-05-10 00:20:27 UTC (rev 200602)
@@ -1,3 +1,18 @@
+2016-05-09 Simon Fraser <[email protected]>
+
+ [iOS] visibility:hidden -webkit-overflow-scrolling: touch divs can interfere with page scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=157496
+ rdar://problem/22963278
+
+ Reviewed by Tim Horton.
+
+ Add a fast/scrolling/ios directory, disable it everywhere except on iOS.
+
+ * TestExpectations:
+ * fast/scrolling/ios/touch-scroll-visibility-hidden-expected.txt: Added.
+ * fast/scrolling/ios/touch-scroll-visibility-hidden.html: Added.
+ * platform/ios-simulator-wk2/TestExpectations:
+
2016-05-09 Myles C. Maxfield <[email protected]>
Web Font is downloaded even when all the characters in the document are outside its unicode-range
Modified: trunk/LayoutTests/TestExpectations (200601 => 200602)
--- trunk/LayoutTests/TestExpectations 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/LayoutTests/TestExpectations 2016-05-10 00:20:27 UTC (rev 200602)
@@ -20,6 +20,7 @@
fast/viewport/ios [ Skip ]
fast/events/ios [ Skip ]
fast/events/touch/ios [ Skip ]
+fast/scrolling/ios [ Skip ]
fast/forms/attributed-strings.html [ Skip ]
fast/scrolling/latching [ Skip ]
Added: trunk/LayoutTests/fast/scrolling/ios/touch-scroll-visibility-hidden-expected.txt (0 => 200602)
--- trunk/LayoutTests/fast/scrolling/ios/touch-scroll-visibility-hidden-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/scrolling/ios/touch-scroll-visibility-hidden-expected.txt 2016-05-10 00:20:27 UTC (rev 200602)
@@ -0,0 +1,9 @@
+PASS hitElement.id is "under-target"
+PASS scroller.scrollTop is 0
+swipe complete
+PASS scroller.scrollTop is 0
+PASS document.scrollingElement.scrollTop is 90
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/scrolling/ios/touch-scroll-visibility-hidden.html (0 => 200602)
--- trunk/LayoutTests/fast/scrolling/ios/touch-scroll-visibility-hidden.html (rev 0)
+++ trunk/LayoutTests/fast/scrolling/ios/touch-scroll-visibility-hidden.html 2016-05-10 00:20:27 UTC (rev 200602)
@@ -0,0 +1,91 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <meta name="viewport" content="initial-scale=1.0">
+ <style>
+ body {
+ margin: 0;
+ height: 2000px;
+ }
+
+ .box {
+ height: 100px;
+ width: 100px;
+ background-color: blue;
+ }
+
+ .outer {
+ position: absolute;
+ top: 0;
+ }
+
+ .box:hover {
+ background-color: green;
+ }
+
+ .container {
+ position: absolute;
+ top: 50px;
+ left: 50px;
+ height: 300px;
+ width: 300px;
+ overflow: scroll;
+ -webkit-overflow-scrolling: touch;
+ border: 1px solid black;
+ visibility: hidden;
+ }
+
+ .content {
+ height: 600px;
+ }
+ </style>
+ <script src=""
+ <script>
+ window.jsTestIsAsync = true;
+
+ function getUIScript()
+ {
+ return `
+ (function() {
+ uiController.dragFromPointToPoint(60, 200, 60, 100, 0.5, function() {
+ uiController.uiScriptComplete("");
+ });
+ })();`
+ }
+
+ var hitElement;
+ function runTest()
+ {
+ hitElement = document.elementFromPoint(20, 20);
+ shouldBeEqualToString("hitElement.id", "under-target");
+
+ var scroller = document.getElementById('scroller');
+ shouldBe("scroller.scrollTop", "0");
+
+ if (testRunner.runUIScript) {
+ testRunner.runUIScript(getUIScript(), function() {
+ debug("swipe complete");
+ shouldBe("scroller.scrollTop", "0");
+ shouldBe("document.scrollingElement.scrollTop", "90");
+ finishJSTest();
+ });
+ }
+ }
+ window.addEventListener('load', runTest, false);
+ </script>
+</head>
+<body _onscroll_="debug('body scroll')">
+<div class="outer box" id="under-target">
+</div>
+
+<div id="scroller" class="container" _onscroll_="debug('overflow scroll')">
+ <div class="content">
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ <div class="inner box" style="visibility: visible">
+ </div>
+ </div>
+</div>
+<script src=""
+</body>
+</html>
Modified: trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations (200601 => 200602)
--- trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations 2016-05-10 00:20:27 UTC (rev 200602)
@@ -9,6 +9,7 @@
fast/harness/ui-side-scripts.html [ Pass ]
fast/harness/concurrent-ui-side-scripts.html [ Pass ]
fast/zooming/ios [ Pass ]
+fast/scrolling/ios [ Pass ]
#//////////////////////////////////////////////////////////////////////////////////////////
# End platform-specific directories.
Modified: trunk/Source/WebCore/ChangeLog (200601 => 200602)
--- trunk/Source/WebCore/ChangeLog 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Source/WebCore/ChangeLog 2016-05-10 00:20:27 UTC (rev 200602)
@@ -1,3 +1,29 @@
+2016-05-09 Simon Fraser <[email protected]>
+
+ [iOS] visibility:hidden -webkit-overflow-scrolling: touch divs can interfere with page scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=157496
+
+ Reviewed by Tim Horton.
+
+ UIScrollViews are constructed in the UI process for visibility:hidden scrollable elements
+ with -webkit-overflow-scrolling: touch, and these intercept user events when they should not.
+
+ Fix by propagating a "contentsHidden" flag from the web process which is used to turn off
+ user interaction on these views.
+
+ Test: fast/scrolling/ios/touch-scroll-visibility-hidden.html
+
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::updateContentsVisibility): We have to tell the scrolling layer
+ if we have visibility:hidden.
+ * platform/graphics/ca/PlatformCALayer.h:
+ * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
+ * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
+ (PlatformCALayerCocoa::contentsHidden):
+ (PlatformCALayerCocoa::setContentsHidden):
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateAfterDescendants):
+
2016-05-09 Myles C. Maxfield <[email protected]>
Web Font is downloaded even when all the characters in the document are outside its unicode-range
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (200601 => 200602)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2016-05-10 00:20:27 UTC (rev 200602)
@@ -1877,6 +1877,8 @@
if (m_backdropLayer)
m_backdropLayer->setHidden(true);
}
+
+ m_layer->setContentsHidden(!m_contentsVisible);
}
void GraphicsLayerCA::updateContentsOpaque(float pageScaleFactor)
Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h (200601 => 200602)
--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h 2016-05-10 00:20:27 UTC (rev 200602)
@@ -158,6 +158,9 @@
virtual bool isHidden() const = 0;
virtual void setHidden(bool) = 0;
+ virtual bool contentsHidden() const = 0;
+ virtual void setContentsHidden(bool) = 0;
+
virtual bool geometryFlipped() const = 0;
virtual void setGeometryFlipped(bool) = 0;
Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h (200601 => 200602)
--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.h 2016-05-10 00:20:27 UTC (rev 200602)
@@ -90,6 +90,9 @@
bool isHidden() const override;
void setHidden(bool) override;
+ bool contentsHidden() const override;
+ void setContentsHidden(bool) override;
+
void setBackingStoreAttached(bool) override;
bool backingStoreAttached() const override;
Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (200601 => 200602)
--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm 2016-05-10 00:20:27 UTC (rev 200602)
@@ -616,6 +616,17 @@
END_BLOCK_OBJC_EXCEPTIONS
}
+bool PlatformCALayerCocoa::contentsHidden() const
+{
+ // Used to disable user interaction for some platforms.
+ return true;
+}
+
+void PlatformCALayerCocoa::setContentsHidden(bool)
+{
+ // Used to disable user interaction for some platforms.
+}
+
void PlatformCALayerCocoa::setBackingStoreAttached(bool)
{
// We could throw away backing store here with setContents:nil.
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (200601 => 200602)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2016-05-10 00:20:27 UTC (rev 200602)
@@ -1066,6 +1066,8 @@
updateDrawsContent(isSimpleContainer);
m_graphicsLayer->setContentsVisible(m_owningLayer.hasVisibleContent() || isPaintDestinationForDescendantLayers());
+ if (m_scrollingLayer)
+ m_scrollingLayer->setContentsVisible(renderer().style().visibility() == VISIBLE);
}
// FIXME: Avoid repaints when clip path changes.
Modified: trunk/Source/WebKit2/ChangeLog (200601 => 200602)
--- trunk/Source/WebKit2/ChangeLog 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Source/WebKit2/ChangeLog 2016-05-10 00:20:27 UTC (rev 200602)
@@ -1,3 +1,34 @@
+2016-05-09 Simon Fraser <[email protected]>
+
+ [iOS] visibility:hidden -webkit-overflow-scrolling: touch divs can interfere with page scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=157496
+ rdar://problem/22963278
+
+ Reviewed by Tim Horton.
+
+ UIScrollViews are constructed in the UI process for visibility:hidden scrollable elements
+ with -webkit-overflow-scrolling: touch, and these intercept user events when they should not.
+
+ Fix by propagating a "contentsHidden" flag from the web process which is used to turn off
+ user interaction on these views.
+
+ * Shared/mac/RemoteLayerTreePropertyApplier.mm:
+ (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
+ * Shared/mac/RemoteLayerTreeTransaction.h:
+ * Shared/mac/RemoteLayerTreeTransaction.mm:
+ (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
+ (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
+ (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
+ (WebKit::dumpChangedLayers):
+ * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
+ (-[UIView _recursiveFindDescendantScrollViewAtPoint:withEvent:]): Our custom hit
+ test needs to take view.isUserInteractionEnabled into account.
+ * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+ (WebKit::PlatformCALayerRemote::setHidden):
+ (WebKit::PlatformCALayerRemote::contentsHidden):
+ (WebKit::PlatformCALayerRemote::setContentsHidden):
+ * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
+
2016-05-09 Ada Chan <[email protected]>
Introduce WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen() and use it in WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen()
Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm (200601 => 200602)
--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm 2016-05-10 00:20:27 UTC (rev 200602)
@@ -312,7 +312,6 @@
}
if (properties.changedProperties & RemoteLayerTreeTransaction::MaskLayerChanged) {
-
CALayer *maskOwnerLayer = view.layer;
if (properties.customAppearance == GraphicsLayer::LightBackdropAppearance || properties.customAppearance == GraphicsLayer::DarkBackdropAppearance) {
@@ -332,6 +331,10 @@
maskOwnerLayer.mask = maskView.layer;
}
}
+
+ if (properties.changedProperties & RemoteLayerTreeTransaction::ContentsHiddenChanged)
+ view.userInteractionEnabled = !properties.contentsHidden;
+
END_BLOCK_OBJC_EXCEPTIONS;
}
#endif
Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (200601 => 200602)
--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h 2016-05-10 00:20:27 UTC (rev 200602)
@@ -69,25 +69,26 @@
DoubleSidedChanged = 1LLU << 14,
MasksToBoundsChanged = 1LLU << 15,
OpaqueChanged = 1LLU << 16,
- MaskLayerChanged = 1LLU << 17,
- ClonedContentsChanged = 1LLU << 18,
- ContentsRectChanged = 1LLU << 19,
- ContentsScaleChanged = 1LLU << 20,
- CornerRadiusChanged = 1LLU << 21,
- ShapeRoundedRectChanged = 1LLU << 22,
- ShapePathChanged = 1LLU << 23,
- MinificationFilterChanged = 1LLU << 24,
- MagnificationFilterChanged = 1LLU << 25,
- BlendModeChanged = 1LLU << 26,
- WindRuleChanged = 1LLU << 27,
- SpeedChanged = 1LLU << 28,
- TimeOffsetChanged = 1LLU << 29,
- BackingStoreChanged = 1LLU << 30,
- BackingStoreAttachmentChanged = 1LLU << 31,
- FiltersChanged = 1LLU << 32,
- AnimationsChanged = 1LLU << 33,
- EdgeAntialiasingMaskChanged = 1LLU << 34,
- CustomAppearanceChanged = 1LLU << 35,
+ ContentsHiddenChanged = 1LLU << 17,
+ MaskLayerChanged = 1LLU << 18,
+ ClonedContentsChanged = 1LLU << 19,
+ ContentsRectChanged = 1LLU << 20,
+ ContentsScaleChanged = 1LLU << 21,
+ CornerRadiusChanged = 1LLU << 22,
+ ShapeRoundedRectChanged = 1LLU << 23,
+ ShapePathChanged = 1LLU << 24,
+ MinificationFilterChanged = 1LLU << 25,
+ MagnificationFilterChanged = 1LLU << 26,
+ BlendModeChanged = 1LLU << 27,
+ WindRuleChanged = 1LLU << 28,
+ SpeedChanged = 1LLU << 29,
+ TimeOffsetChanged = 1LLU << 30,
+ BackingStoreChanged = 1LLU << 31,
+ BackingStoreAttachmentChanged = 1LLU << 32,
+ FiltersChanged = 1LLU << 33,
+ AnimationsChanged = 1LLU << 34,
+ EdgeAntialiasingMaskChanged = 1LLU << 35,
+ CustomAppearanceChanged = 1LLU << 36,
};
typedef uint64_t LayerChange;
@@ -164,6 +165,7 @@
bool doubleSided;
bool masksToBounds;
bool opaque;
+ bool contentsHidden;
};
explicit RemoteLayerTreeTransaction();
Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (200601 => 200602)
--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm 2016-05-10 00:20:27 UTC (rev 200602)
@@ -103,6 +103,7 @@
, doubleSided(true)
, masksToBounds(false)
, opaque(false)
+ , contentsHidden(false)
{
}
@@ -140,6 +141,7 @@
, doubleSided(other.doubleSided)
, masksToBounds(other.masksToBounds)
, opaque(other.opaque)
+ , contentsHidden(other.contentsHidden)
{
// FIXME: LayerProperties should reference backing store by ID, so that two layers can have the same backing store (for clones).
// FIXME: LayerProperties shouldn't be copyable; PlatformCALayerRemote::clone should copy the relevant properties.
@@ -211,6 +213,9 @@
if (changedProperties & OpaqueChanged)
encoder << opaque;
+ if (changedProperties & ContentsHiddenChanged)
+ encoder << contentsHidden;
+
if (changedProperties & MaskLayerChanged)
encoder << maskLayerID;
@@ -374,6 +379,11 @@
return false;
}
+ if (result.changedProperties & ContentsHiddenChanged) {
+ if (!decoder.decode(result.contentsHidden))
+ return false;
+ }
+
if (result.changedProperties & MaskLayerChanged) {
if (!decoder.decode(result.maskLayerID))
return false;
@@ -742,6 +752,9 @@
if (layerProperties.changedProperties & RemoteLayerTreeTransaction::OpaqueChanged)
ts.dumpProperty("opaque", layerProperties.opaque);
+ if (layerProperties.changedProperties & RemoteLayerTreeTransaction::ContentsHiddenChanged)
+ ts.dumpProperty("contentsHidden", layerProperties.contentsHidden);
+
if (layerProperties.changedProperties & RemoteLayerTreeTransaction::MaskLayerChanged)
ts.dumpProperty("maskLayer", layerProperties.maskLayerID);
Modified: trunk/Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm (200601 => 200602)
--- trunk/Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm 2016-05-10 00:20:27 UTC (rev 200602)
@@ -60,7 +60,7 @@
[[self subviews] enumerateObjectsUsingBlock:^(UIView *view, NSUInteger idx, BOOL *stop) {
CGPoint subviewPoint = [view convertPoint:point fromView:self];
- if ([view pointInside:subviewPoint withEvent:event] && [view isKindOfClass:[UIScrollView class]])
+ if ([view pointInside:subviewPoint withEvent:event] && [view isKindOfClass:[UIScrollView class]] && view.isUserInteractionEnabled)
foundView = view;
if (![view subviews])
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (200601 => 200602)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp 2016-05-10 00:20:27 UTC (rev 200602)
@@ -503,10 +503,27 @@
void PlatformCALayerRemote::setHidden(bool value)
{
+ if (m_properties.hidden == value)
+ return;
+
m_properties.hidden = value;
m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::HiddenChanged);
}
+bool PlatformCALayerRemote::contentsHidden() const
+{
+ return m_properties.contentsHidden;
+}
+
+void PlatformCALayerRemote::setContentsHidden(bool value)
+{
+ if (m_properties.contentsHidden == value)
+ return;
+
+ m_properties.contentsHidden = value;
+ m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::ContentsHiddenChanged);
+}
+
void PlatformCALayerRemote::setBackingStoreAttached(bool value)
{
if (m_properties.backingStoreAttached == value)
Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h (200601 => 200602)
--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h 2016-05-10 00:20:27 UTC (rev 200602)
@@ -94,6 +94,9 @@
bool isHidden() const override;
void setHidden(bool) override;
+ bool contentsHidden() const override;
+ void setContentsHidden(bool) override;
+
void setBackingStoreAttached(bool) override;
bool backingStoreAttached() const override;
bool backingContributesToMemoryEstimate() const override { return backingStoreAttached(); }
Modified: trunk/Tools/ChangeLog (200601 => 200602)
--- trunk/Tools/ChangeLog 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Tools/ChangeLog 2016-05-10 00:20:27 UTC (rev 200602)
@@ -1,5 +1,25 @@
2016-05-09 Simon Fraser <[email protected]>
+ [iOS] visibility:hidden -webkit-overflow-scrolling: touch divs can interfere with page scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=157496
+ rdar://problem/22963278
+
+ Reviewed by Tim Horton.
+
+ Enhance UIScriptController to generate a drag, which is useful for scrolling.
+
+ * WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl:
+ * WebKitTestRunner/UIScriptContext/UIScriptController.cpp:
+ (WTR::UIScriptController::dragFromPointToPoint):
+ * WebKitTestRunner/UIScriptContext/UIScriptController.h:
+ * WebKitTestRunner/ios/HIDEventGenerator.h:
+ * WebKitTestRunner/ios/HIDEventGenerator.mm:
+ (-[HIDEventGenerator dragWithStartPoint:endPoint:duration:completionBlock:]):
+ * WebKitTestRunner/ios/UIScriptControllerIOS.mm:
+ (WTR::UIScriptController::dragFromPointToPoint):
+
+2016-05-09 Simon Fraser <[email protected]>
+
Remove testRunner.setTextAutosizingEnabled and migrate the one test that uses it
https://bugs.webkit.org/show_bug.cgi?id=157480
Modified: trunk/Tools/WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl (200601 => 200602)
--- trunk/Tools/WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Tools/WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl 2016-05-10 00:20:27 UTC (rev 200602)
@@ -36,6 +36,7 @@
void liftUpAtPoint(long x, long y, long touchCount, object callback);
void singleTapAtPoint(long x, long y, object callback);
void doubleTapAtPoint(long x, long y, object callback);
+ void dragFromPointToPoint(long startX, long startY, long endX, long endY, double durationSeconds, object callback);
void typeCharacterUsingHardwareKeyboard(DOMString character, object callback);
void keyDownUsingHardwareKeyboard(DOMString character, object callback);
Modified: trunk/Tools/WebKitTestRunner/UIScriptContext/UIScriptController.cpp (200601 => 200602)
--- trunk/Tools/WebKitTestRunner/UIScriptContext/UIScriptController.cpp 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Tools/WebKitTestRunner/UIScriptContext/UIScriptController.cpp 2016-05-10 00:20:27 UTC (rev 200602)
@@ -134,6 +134,10 @@
{
}
+void UIScriptController::dragFromPointToPoint(long startX, long startY, long endX, long endY, double durationSeconds, JSValueRef callback)
+{
+}
+
void UIScriptController::typeCharacterUsingHardwareKeyboard(JSStringRef, JSValueRef)
{
}
Modified: trunk/Tools/WebKitTestRunner/UIScriptContext/UIScriptController.h (200601 => 200602)
--- trunk/Tools/WebKitTestRunner/UIScriptContext/UIScriptController.h 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Tools/WebKitTestRunner/UIScriptContext/UIScriptController.h 2016-05-10 00:20:27 UTC (rev 200602)
@@ -51,6 +51,7 @@
void liftUpAtPoint(long x, long y, long touchCount, JSValueRef callback);
void singleTapAtPoint(long x, long y, JSValueRef callback);
void doubleTapAtPoint(long x, long y, JSValueRef callback);
+ void dragFromPointToPoint(long startX, long startY, long endX, long endY, double durationSeconds, JSValueRef callback);
void typeCharacterUsingHardwareKeyboard(JSStringRef character, JSValueRef callback);
void keyDownUsingHardwareKeyboard(JSStringRef character, JSValueRef callback);
Modified: trunk/Tools/WebKitTestRunner/ios/HIDEventGenerator.h (200601 => 200602)
--- trunk/Tools/WebKitTestRunner/ios/HIDEventGenerator.h 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Tools/WebKitTestRunner/ios/HIDEventGenerator.h 2016-05-10 00:20:27 UTC (rev 200602)
@@ -32,9 +32,6 @@
+ (HIDEventGenerator *)sharedHIDEventGenerator;
// Touches
-- (void)touchDown:(CGPoint)location;
-- (void)liftUp:(CGPoint)location;
-- (void)moveToPoints:(CGPoint*)locations touchCount:(NSUInteger)count duration:(NSTimeInterval)seconds;
- (void)touchDown:(CGPoint)location touchCount:(NSUInteger)count completionBlock:(void (^)(void))completionBlock;
- (void)liftUp:(CGPoint)location touchCount:(NSUInteger)count completionBlock:(void (^)(void))completionBlock;
Modified: trunk/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm (200601 => 200602)
--- trunk/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm 2016-05-10 00:20:27 UTC (rev 200602)
@@ -415,6 +415,10 @@
- (void)dragWithStartPoint:(CGPoint)startLocation endPoint:(CGPoint)endLocation duration:(double)seconds completionBlock:(void (^)(void))completionBlock
{
+ [self touchDown:startLocation touchCount:1];
+ [self moveToPoints:&endLocation touchCount:1 duration:seconds];
+ [self liftUp:endLocation];
+ [self _sendMarkerHIDEventWithCompletionBlock:completionBlock];
}
- (void)pinchCloseWithStartPoint:(CGPoint)startLocation endPoint:(CGPoint)endLocation duration:(double)seconds completionBlock:(void (^)(void))completionBlock
Modified: trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm (200601 => 200602)
--- trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm 2016-05-10 00:13:01 UTC (rev 200601)
+++ trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm 2016-05-10 00:20:27 UTC (rev 200602)
@@ -125,6 +125,20 @@
}];
}
+void UIScriptController::dragFromPointToPoint(long startX, long startY, long endX, long endY, double durationSeconds, JSValueRef callback)
+{
+ unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);
+
+ CGPoint startPoint = globalToContentCoordinates(TestController::singleton().mainWebView()->platformView(), startX, startY);
+ CGPoint endPoint = globalToContentCoordinates(TestController::singleton().mainWebView()->platformView(), endX, endY);
+
+ [[HIDEventGenerator sharedHIDEventGenerator] dragWithStartPoint:startPoint endPoint:endPoint duration:durationSeconds completionBlock:^{
+ if (!m_context)
+ return;
+ m_context->asyncTaskComplete(callbackID);
+ }];
+}
+
void UIScriptController::typeCharacterUsingHardwareKeyboard(JSStringRef character, JSValueRef callback)
{
unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent);