Title: [248575] branches/safari-608-branch/Source/WebKit
- Revision
- 248575
- Author
- [email protected]
- Date
- 2019-08-12 16:42:36 -0700 (Mon, 12 Aug 2019)
Log Message
Cherry-pick r248481. rdar://problem/54130658
[iOS WK2] Remove context menu hints on navigation
https://bugs.webkit.org/show_bug.cgi?id=200588
rdar://problem/54061796
Reviewed by Tim Horton.
Make sure the context menu hint doesn't linger across navigations by hosting it in its
own container view (shared with drag previews), and hiding that view on navigation (unparenting
may have bad consequences). We remove the view when the animation ends.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _didCommitLoadForMainFrame]):
(-[WKContentView containerViewForTargetedPreviews]):
(-[WKContentView _hideContextMenu]):
(-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-608-branch/Source/WebKit/ChangeLog (248574 => 248575)
--- branches/safari-608-branch/Source/WebKit/ChangeLog 2019-08-12 23:42:34 UTC (rev 248574)
+++ branches/safari-608-branch/Source/WebKit/ChangeLog 2019-08-12 23:42:36 UTC (rev 248575)
@@ -1,5 +1,48 @@
2019-08-12 Alan Coon <[email protected]>
+ Cherry-pick r248481. rdar://problem/54130658
+
+ [iOS WK2] Remove context menu hints on navigation
+ https://bugs.webkit.org/show_bug.cgi?id=200588
+ rdar://problem/54061796
+
+ Reviewed by Tim Horton.
+
+ Make sure the context menu hint doesn't linger across navigations by hosting it in its
+ own container view (shared with drag previews), and hiding that view on navigation (unparenting
+ may have bad consequences). We remove the view when the animation ends.
+
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _didCommitLoadForMainFrame]):
+ (-[WKContentView containerViewForTargetedPreviews]):
+ (-[WKContentView _hideContextMenu]):
+ (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-08-09 Simon Fraser <[email protected]>
+
+ [iOS WK2] Remove context menu hints on navigation
+ https://bugs.webkit.org/show_bug.cgi?id=200588
+ rdar://problem/54061796
+
+ Reviewed by Tim Horton.
+
+ Make sure the context menu hint doesn't linger across navigations by hosting it in its
+ own container view (shared with drag previews), and hiding that view on navigation (unparenting
+ may have bad consequences). We remove the view when the animation ends.
+
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _didCommitLoadForMainFrame]):
+ (-[WKContentView containerViewForTargetedPreviews]):
+ (-[WKContentView _hideContextMenu]):
+ (-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
+
+2019-08-12 Alan Coon <[email protected]>
+
Cherry-pick r248471. rdar://problem/54130624
Disable CSSOM View Scrolling API for IMDb iOS app
Modified: branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (248574 => 248575)
--- branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2019-08-12 23:42:34 UTC (rev 248574)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2019-08-12 23:42:36 UTC (rev 248575)
@@ -239,6 +239,7 @@
RetainPtr<UIWebFormAccessory> _formAccessoryView;
RetainPtr<_UIHighlightView> _highlightView;
RetainPtr<UIView> _interactionViewsContainerView;
+ RetainPtr<UIView> _contextMenuHintContainerView;
RetainPtr<NSString> _markedText;
RetainPtr<WKActionSheetAssistant> _actionSheetAssistant;
#if ENABLE(AIRPLAY_PICKER)
@@ -456,6 +457,7 @@
- (void)_handleSmartMagnificationInformationForPotentialTap:(uint64_t)requestID renderRect:(const WebCore::FloatRect&)renderRect fitEntireRect:(BOOL)fitEntireRect viewportMinimumScale:(double)viewportMinimumScale viewportMaximumScale:(double)viewportMaximumScale;
- (void)_elementDidFocus:(const WebKit::FocusedElementInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode activityStateChanges:(OptionSet<WebCore::ActivityState::Flag>)activityStateChanges userObject:(NSObject <NSSecureCoding> *)userObject;
- (void)_elementDidBlur;
+- (void)_hideContextMenuHintContainer;
- (void)_didUpdateInputMode:(WebCore::InputMode)mode;
- (void)_didReceiveEditorStateUpdateAfterFocus;
- (void)_hardwareKeyboardAvailabilityChanged;
Modified: branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (248574 => 248575)
--- branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-08-12 23:42:34 UTC (rev 248574)
+++ branches/safari-608-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-08-12 23:42:36 UTC (rev 248575)
@@ -3945,6 +3945,7 @@
#endif
[self _elementDidBlur];
[self _cancelLongPressGestureRecognizer];
+ [self _hideContextMenuHintContainer];
[_webView _didCommitLoadForMainFrame];
}
@@ -6378,11 +6379,28 @@
return _focusedElementInformation.shouldAvoidScrollingWhenFocusedContentIsVisible;
}
+// FIXME: This is used for drag previews and context menu hints; it needs a better name.
- (UIView *)containerViewForTargetedPreviews
{
- return self.unscaledView ?: self;
+ if (_contextMenuHintContainerView) {
+ ASSERT([_contextMenuHintContainerView superview]);
+ [_contextMenuHintContainerView setHidden:NO];
+ return _contextMenuHintContainerView.get();
+ }
+
+ _contextMenuHintContainerView = adoptNS([[UIView alloc] init]);
+ [_contextMenuHintContainerView layer].anchorPoint = CGPointZero;
+ [_contextMenuHintContainerView layer].name = @"Context Menu Container";
+ [_interactionViewsContainerView addSubview:_contextMenuHintContainerView.get()];
+
+ return _contextMenuHintContainerView.get();
}
+- (void)_hideContextMenuHintContainer
+{
+ [_contextMenuHintContainerView setHidden:YES];
+}
+
#if ENABLE(DRAG_SUPPORT)
static BOOL shouldEnableDragInteractionForPolicy(_WKDragInteractionPolicy policy)
@@ -8347,6 +8365,11 @@
_contextMenuLegacyMenu = nullptr;
_contextMenuHasRequestedLegacyData = NO;
_contextMenuElementInfo = nullptr;
+
+ [animator addCompletion:[weakSelf = WeakObjCPtr<WKContentView>(self)] () {
+ if (auto strongSelf = weakSelf.get())
+ [std::exchange(strongSelf->_contextMenuHintContainerView, nil) removeFromSuperview];
+ }];
}
#endif // USE(UICONTEXTMENU)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes