- Revision
- 213036
- Author
- [email protected]
- Date
- 2017-02-27 00:07:57 -0800 (Mon, 27 Feb 2017)
Log Message
Links cannot be activated when running Mobile Safari with external SDK build of WebKit for iOS Simulator
https://bugs.webkit.org/show_bug.cgi?id=141906
Reviewed by Tim Horton.
Source/WebKit2:
Even if Touch Events are disabled, we still need to register a
UIWebTouchEventsGestureRecognizer to record the layer tree transaction ID when a touch
begins. Click events are only generated for touches that occur after the current frame's
load has committed, and we use the transaction ID from when the touch began to implement
this check.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleTouchEventSynchronously):
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h: Declared _layerTreeTransactionIdAtLastTouchStart.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]): Register a UIWebTouchEventsGestureRecognizer even if
Touch Events are disabled.
(-[WKContentView cleanupInteraction]): Reset _layerTreeTransactionIdAtLastTouchStart to 0.
(-[WKContentView _webTouchEventsRecognized:]): Update _layerTreeTransactionIdAtLastTouchStart
when a touch begins, even if Touch Events are disabled.
(-[WKContentView _singleTapCommited:]): Passed _layerTreeTransactionIdAtLastTouchStart to
WebPageProxy::commitPotentialTap().
(-[WKContentView _attemptClickAtLocation:]): Ditto for WebPageProxy::handleTap().
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::commitPotentialTap):
(WebKit::WebPageProxy::handleTap):
LayoutTests:
Unskipped tests that now pass. Rewrote a test to use UIHelper so that it works on both
DumpRenderTree and WebKitTestRunner.
* fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html:
Rewrote to use UIHelper.activateAt().
* platform/ios-simulator-wk2/TestExpectations:
* platform/ios-simulator/TestExpectations:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (213035 => 213036)
--- trunk/LayoutTests/ChangeLog 2017-02-27 07:59:12 UTC (rev 213035)
+++ trunk/LayoutTests/ChangeLog 2017-02-27 08:07:57 UTC (rev 213036)
@@ -1,3 +1,18 @@
+2017-02-27 Andy Estes <[email protected]>
+
+ Links cannot be activated when running Mobile Safari with external SDK build of WebKit for iOS Simulator
+ https://bugs.webkit.org/show_bug.cgi?id=141906
+
+ Reviewed by Tim Horton.
+
+ Unskipped tests that now pass. Rewrote a test to use UIHelper so that it works on both
+ DumpRenderTree and WebKitTestRunner.
+
+ * fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html:
+ Rewrote to use UIHelper.activateAt().
+ * platform/ios-simulator-wk2/TestExpectations:
+ * platform/ios-simulator/TestExpectations:
+
2017-02-26 Commit Queue <[email protected]>
Unreviewed, rolling out r212942.
Modified: trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html (213035 => 213036)
--- trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html 2017-02-27 07:59:12 UTC (rev 213035)
+++ trunk/LayoutTests/fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html 2017-02-27 08:07:57 UTC (rev 213036)
@@ -2,6 +2,7 @@
<html>
<head>
<script src=""
+<script src=""
<style>
body:active {
/* Must be non-empty. */
@@ -28,13 +29,7 @@
var square = iframe.contentDocument.getElementById("square");
var x = iframe.offsetLeft + square.offsetLeft + Math.floor(square.offsetWidth / 2);
var y = iframe.offsetTop + square.offsetTop + Math.floor(square.offsetHeight / 2);
- if (testRunner.runUIScript && window.TouchEvent)
- testRunner.runUIScript("(function() { uiController.singleTapAtPoint(" + x + ", " + y + "); })()");
- else if (window.eventSender) {
- eventSender.mouseMoveTo(x, y);
- eventSender.mouseDown();
- eventSender.mouseUp();
- }
+ UIHelper.activateAt(x, y);
}
</script>
</head>
Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (213035 => 213036)
--- trunk/LayoutTests/platform/ios-simulator/TestExpectations 2017-02-27 07:59:12 UTC (rev 213035)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations 2017-02-27 08:07:57 UTC (rev 213036)
@@ -2430,8 +2430,6 @@
webkit.org/b/152442 fast/scrolling/rtl-point-in-iframe.html [ Skip ]
-webkit.org/b/152449 fast/events/can-click-element-on-page-with-active-pseudo-class-and-search-field.html [ Skip ]
-
webkit.org/b/152701 fast/animation/request-animation-frame-disabled.html [ Skip ]
webkit.org/b/152282 css3/filters/composited-during-animation-layertree.html [ Failure ]
Modified: trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations (213035 => 213036)
--- trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations 2017-02-27 07:59:12 UTC (rev 213035)
+++ trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations 2017-02-27 08:07:57 UTC (rev 213036)
@@ -1759,13 +1759,10 @@
webkit.org/b/123431 http/tests/css/link-css-disabled-value-with-slow-loading-sheet.html [ Pass Failure ]
# eventSender.mouseDown is not implemented
-fast/events/focusing-element-with-tabindex-by-tap-or-click.html [ Skip ]
fast/loader/location-hash-user-gesture.html [ Skip ]
imported/blink/editing/selection/selectstart-event-crash.html [ Skip ]
fast/dom/Window/post-message-user-action.html [ Skip ]
fast/images/image-usemap-parsing.html [ Skip ]
-fast/shadow-dom/click-on-slotted-anchor-with-hover.html [ Skip ]
-fast/shadow-dom/click-text-inside-linked-slot.html [ Skip ]
fast/shadow-dom/fullscreen-in-shadow-fullscreenElement.html [ Skip ]
fast/shadow-dom/fullscreen-in-shadow-webkitCurrentFullScreenElement.html [ Skip ]
fast/shadow-dom/fullscreen-in-slot-fullscreenElement.html [ Skip ]
Modified: trunk/Source/WebKit2/ChangeLog (213035 => 213036)
--- trunk/Source/WebKit2/ChangeLog 2017-02-27 07:59:12 UTC (rev 213035)
+++ trunk/Source/WebKit2/ChangeLog 2017-02-27 08:07:57 UTC (rev 213036)
@@ -1,3 +1,34 @@
+2017-02-27 Andy Estes <[email protected]>
+
+ Links cannot be activated when running Mobile Safari with external SDK build of WebKit for iOS Simulator
+ https://bugs.webkit.org/show_bug.cgi?id=141906
+
+ Reviewed by Tim Horton.
+
+ Even if Touch Events are disabled, we still need to register a
+ UIWebTouchEventsGestureRecognizer to record the layer tree transaction ID when a touch
+ begins. Click events are only generated for touches that occur after the current frame's
+ load has committed, and we use the transaction ID from when the touch began to implement
+ this check.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::handleTouchEventSynchronously):
+ (WebKit::WebPageProxy::resetState):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/ios/WKContentViewInteraction.h: Declared _layerTreeTransactionIdAtLastTouchStart.
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView setupInteraction]): Register a UIWebTouchEventsGestureRecognizer even if
+ Touch Events are disabled.
+ (-[WKContentView cleanupInteraction]): Reset _layerTreeTransactionIdAtLastTouchStart to 0.
+ (-[WKContentView _webTouchEventsRecognized:]): Update _layerTreeTransactionIdAtLastTouchStart
+ when a touch begins, even if Touch Events are disabled.
+ (-[WKContentView _singleTapCommited:]): Passed _layerTreeTransactionIdAtLastTouchStart to
+ WebPageProxy::commitPotentialTap().
+ (-[WKContentView _attemptClickAtLocation:]): Ditto for WebPageProxy::handleTap().
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::commitPotentialTap):
+ (WebKit::WebPageProxy::handleTap):
+
2017-02-26 Zan Dobersek <[email protected]>
[CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (213035 => 213036)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2017-02-27 07:59:12 UTC (rev 213035)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2017-02-27 08:07:57 UTC (rev 213036)
@@ -2154,10 +2154,8 @@
if (!isValid())
return;
- if (event.type() == WebEvent::TouchStart) {
+ if (event.type() == WebEvent::TouchStart)
updateTouchEventTracking(event);
- m_layerTreeTransactionIdAtLastTouchStart = downcast<RemoteLayerTreeDrawingAreaProxy>(*drawingArea()).lastCommittedLayerTreeTransactionID();
- }
TrackingType touchEventsTrackingType = touchEventTrackingType(event);
if (touchEventsTrackingType == TrackingType::NotTracking)
@@ -5401,7 +5399,6 @@
m_dynamicViewportSizeUpdateWaitingForTarget = false;
m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit = false;
m_dynamicViewportSizeUpdateLayerTreeTransactionID = 0;
- m_layerTreeTransactionIdAtLastTouchStart = 0;
m_hasNetworkRequestsOnSuspended = false;
m_isKeyboardAnimatingIn = false;
m_isScrollingOrZooming = false;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (213035 => 213036)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2017-02-27 07:59:12 UTC (rev 213035)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2017-02-27 08:07:57 UTC (rev 213036)
@@ -990,10 +990,10 @@
void willStartUserTriggeredZooming();
void potentialTapAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
- void commitPotentialTap();
+ void commitPotentialTap(uint64_t layerTreeTransactionIdAtLastTouchStart);
void cancelPotentialTap();
void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID);
- void handleTap(const WebCore::FloatPoint&);
+ void handleTap(const WebCore::FloatPoint&, uint64_t layerTreeTransactionIdAtLastTouchStart);
void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&);
void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&);
@@ -1664,7 +1664,6 @@
bool m_dynamicViewportSizeUpdateWaitingForTarget { false };
bool m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit { false };
uint64_t m_dynamicViewportSizeUpdateLayerTreeTransactionID { 0 };
- uint64_t m_layerTreeTransactionIdAtLastTouchStart { 0 };
uint64_t m_currentDynamicViewportSizeUpdateID { 0 };
bool m_hasNetworkRequestsOnSuspended { false };
bool m_isKeyboardAnimatingIn { false };
Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (213035 => 213036)
--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h 2017-02-27 07:59:12 UTC (rev 213035)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h 2017-02-27 08:07:57 UTC (rev 213036)
@@ -160,6 +160,7 @@
UIWKKeyWebEventCompletionHandler _keyWebEventHandler;
CGPoint _lastInteractionLocation;
+ uint64_t _layerTreeTransactionIdAtLastTouchStart;
WebKit::WKSelectionDrawingInfo _lastSelectionDrawingInfo;
Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (213035 => 213036)
--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm 2017-02-27 07:59:12 UTC (rev 213035)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm 2017-02-27 08:07:57 UTC (rev 213036)
@@ -34,6 +34,7 @@
#import "ManagedConfigurationSPI.h"
#import "NativeWebKeyboardEvent.h"
#import "NativeWebTouchEvent.h"
+#import "RemoteLayerTreeDrawingAreaProxy.h"
#import "SmartMagnificationController.h"
#import "TextInputSPI.h"
#import "UIKitSPI.h"
@@ -524,11 +525,9 @@
[self.layer addObserver:self forKeyPath:@"transform" options:NSKeyValueObservingOptionInitial context:nil];
-#if ENABLE(TOUCH_EVENTS)
_touchEventGestureRecognizer = adoptNS([[UIWebTouchEventsGestureRecognizer alloc] initWithTarget:self action:@selector(_webTouchEventsRecognized:) touchDelegate:self]);
[_touchEventGestureRecognizer setDelegate:self];
[self addGestureRecognizer:_touchEventGestureRecognizer.get()];
-#endif
_singleTapGestureRecognizer = adoptNS([[WKSyntheticClickTapGestureRecognizer alloc] initWithTarget:self action:@selector(_singleTapCommited:)]);
[_singleTapGestureRecognizer setDelegate:self];
@@ -636,6 +635,8 @@
[_twoFingerSingleTapGestureRecognizer setDelegate:nil];
[self removeGestureRecognizer:_twoFingerSingleTapGestureRecognizer.get()];
+ _layerTreeTransactionIdAtLastTouchStart = 0;
+
#if ENABLE(DATA_INTERACTION)
[self teardownDataInteractionDelegates];
_isPerformingDataInteractionOperation = NO;
@@ -858,13 +859,16 @@
return superDidResign;
}
-#if ENABLE(TOUCH_EVENTS)
- (void)_webTouchEventsRecognized:(UIWebTouchEventsGestureRecognizer *)gestureRecognizer
{
const _UIWebTouchEvent* lastTouchEvent = gestureRecognizer.lastTouchEvent;
- NativeWebTouchEvent nativeWebTouchEvent(lastTouchEvent);
_lastInteractionLocation = lastTouchEvent->locationInDocumentCoordinates;
+ if (lastTouchEvent->type == UIWebTouchEventTouchBegin)
+ _layerTreeTransactionIdAtLastTouchStart = downcast<RemoteLayerTreeDrawingAreaProxy>(*_page->drawingArea()).lastCommittedLayerTreeTransactionID();
+
+#if ENABLE(TOUCH_EVENTS)
+ NativeWebTouchEvent nativeWebTouchEvent(lastTouchEvent);
nativeWebTouchEvent.setCanPreventNativeGestures(!_canSendTouchEventsAsynchronously || [gestureRecognizer isDefaultPrevented]);
if (_canSendTouchEventsAsynchronously)
@@ -874,8 +878,8 @@
if (nativeWebTouchEvent.allTouchPointsAreReleased())
_canSendTouchEventsAsynchronously = NO;
+#endif
}
-#endif
- (void)_inspectorNodeSearchRecognized:(UIGestureRecognizer *)gestureRecognizer
{
@@ -1637,7 +1641,7 @@
}
[_inputPeripheral endEditing];
- _page->commitPotentialTap();
+ _page->commitPotentialTap(_layerTreeTransactionIdAtLastTouchStart);
if (!_isExpectingFastSingleTapCommit)
[self _finishInteraction];
@@ -1676,7 +1680,7 @@
[self becomeFirstResponder];
[_inputPeripheral endEditing];
- _page->handleTap(location);
+ _page->handleTap(location, _layerTreeTransactionIdAtLastTouchStart);
}
- (void)useSelectionAssistantWithMode:(UIWebSelectionMode)selectionMode
Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (213035 => 213036)
--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2017-02-27 07:59:12 UTC (rev 213035)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm 2017-02-27 08:07:57 UTC (rev 213036)
@@ -839,9 +839,9 @@
process().send(Messages::WebPage::PotentialTapAtPosition(requestID, position), m_pageID);
}
-void WebPageProxy::commitPotentialTap()
+void WebPageProxy::commitPotentialTap(uint64_t layerTreeTransactionIdAtLastTouchStart)
{
- process().send(Messages::WebPage::CommitPotentialTap(m_layerTreeTransactionIdAtLastTouchStart), m_pageID);
+ process().send(Messages::WebPage::CommitPotentialTap(layerTreeTransactionIdAtLastTouchStart), m_pageID);
}
void WebPageProxy::cancelPotentialTap()
@@ -854,9 +854,9 @@
process().send(Messages::WebPage::TapHighlightAtPosition(requestID, position), m_pageID);
}
-void WebPageProxy::handleTap(const FloatPoint& location)
+void WebPageProxy::handleTap(const FloatPoint& location, uint64_t layerTreeTransactionIdAtLastTouchStart)
{
- process().send(Messages::WebPage::HandleTap(roundedIntPoint(location), m_layerTreeTransactionIdAtLastTouchStart), m_pageID);
+ process().send(Messages::WebPage::HandleTap(roundedIntPoint(location), layerTreeTransactionIdAtLastTouchStart), m_pageID);
}
void WebPageProxy::inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint& position)