Title: [191409] trunk/Source/WebKit2
- Revision
- 191409
- Author
- wenson_hs...@apple.com
- Date
- 2015-10-21 15:30:59 -0700 (Wed, 21 Oct 2015)
Log Message
Single tapping clickable elements in unscalable pages should show a tap highlight
https://bugs.webkit.org/show_bug.cgi?id=150382
Reviewed by Simon Fraser.
When the double tap gesture recognizer is disabled ahead of time (as in the case of unscalable pages) the tap is
committed before the geometries come in. To fix this, we introduce a flag that allows the single tap to be
committed before the tap highlight arrives. This allows the tap highlight to be immediately animated when receiving
the tap highlight geometries only in the case where double tapping is disabled when recognizing the single tap.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
(-[WKContentView _singleTapRecognized:]):
(-[WKContentView _singleTapCommited:]):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (191408 => 191409)
--- trunk/Source/WebKit2/ChangeLog 2015-10-21 22:30:01 UTC (rev 191408)
+++ trunk/Source/WebKit2/ChangeLog 2015-10-21 22:30:59 UTC (rev 191409)
@@ -1,3 +1,23 @@
+2015-10-21 Wenson Hsieh <wenson_hs...@apple.com>
+
+ Single tapping clickable elements in unscalable pages should show a tap highlight
+ https://bugs.webkit.org/show_bug.cgi?id=150382
+
+ Reviewed by Simon Fraser.
+
+ When the double tap gesture recognizer is disabled ahead of time (as in the case of unscalable pages) the tap is
+ committed before the geometries come in. To fix this, we introduce a flag that allows the single tap to be
+ committed before the tap highlight arrives. This allows the tap highlight to be immediately animated when receiving
+ the tap highlight geometries only in the case where double tapping is disabled when recognizing the single tap.
+
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView setupInteraction]):
+ (-[WKContentView cleanupInteraction]):
+ (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
+ (-[WKContentView _singleTapRecognized:]):
+ (-[WKContentView _singleTapCommited:]):
+
2015-10-21 Anders Carlsson <ander...@apple.com>
Get rid of useBinaryEncoding from WKPageGetContentsAsMHTMLData
Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (191408 => 191409)
--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h 2015-10-21 22:30:01 UTC (rev 191408)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h 2015-10-21 22:30:59 UTC (rev 191409)
@@ -158,6 +158,7 @@
BOOL _usingGestureForSelection;
BOOL _inspectorNodeSearchEnabled;
BOOL _didAccessoryTabInitiateFocus;
+ BOOL _isExpectingFastSingleTapCommit;
}
@end
Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (191408 => 191409)
--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm 2015-10-21 22:30:01 UTC (rev 191408)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm 2015-10-21 22:30:59 UTC (rev 191409)
@@ -453,6 +453,7 @@
_actionSheetAssistant = adoptNS([[WKActionSheetAssistant alloc] initWithView:self]);
[_actionSheetAssistant setDelegate:self];
_smartMagnificationController = std::make_unique<SmartMagnificationController>(self);
+ _isExpectingFastSingleTapCommit = NO;
}
- (void)cleanupInteraction
@@ -462,6 +463,7 @@
_actionSheetAssistant = nil;
_smartMagnificationController = nil;
_didAccessoryTabInitiateFocus = NO;
+ _isExpectingFastSingleTapCommit = NO;
[_formInputSession invalidate];
_formInputSession = nil;
[_highlightView removeFromSuperview];
@@ -849,6 +851,11 @@
}
[self _showTapHighlight];
+ if (_isExpectingFastSingleTapCommit) {
+ [self _finishInteraction];
+ if (!_potentialTapInProgress)
+ _isExpectingFastSingleTapCommit = NO;
+ }
}
- (CGFloat)_fastClickZoomThreshold
@@ -1244,6 +1251,7 @@
_page->potentialTapAtPosition(gestureRecognizer.location, ++_latestTapID);
_potentialTapInProgress = YES;
_isTapHighlightIDValid = YES;
+ _isExpectingFastSingleTapCommit = !_doubleTapGestureRecognizer.get().enabled;
}
static void cancelPotentialTapIfNecessary(WKContentView* contentView)
@@ -1297,7 +1305,8 @@
_page->commitPotentialTap();
- [self _finishInteraction];
+ if (!_isExpectingFastSingleTapCommit)
+ [self _finishInteraction];
}
- (void)_doubleTapRecognized:(UITapGestureRecognizer *)gestureRecognizer
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes