+2018-03-27 Wenson Hsieh <wenson_hsieh@apple.com>
+
+ [Extra zoom mode] Add support for new focused form control overlay behaviors
+ https://bugs.webkit.org/show_bug.cgi?id=184043
+ <rdar://problem/38758727>
+
+ Reviewed by Tim Horton.
+
+ See below for more details.
+
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _willStartScrollingOrZooming]):
+ (-[WKContentView _didEndScrollingOrZooming]):
+
+ Suppress focused form control navigation while the scroll view is undergoing a scroll or zoom animation (e.g.,
+ when moving from one focused form control to another).
+
+ (-[WKContentView textInputController:didCommitText:withSuggestion:]):
+
+ When dismissing an input view controller, allow focused form control navigation only after updating assisted
+ node information to ensure that focus rects aren't stale as the user begins to navigate between forms.
+
+ (-[WKContentView rectForFocusedFormControlController:inCoordinateSpace:]):
+ (-[WKContentView nextRectForFocusedFormControlController:inCoordinateSpace:]):
+ (-[WKContentView previousRectForFocusedFormControlController:inCoordinateSpace:]):
+ (-[WKContentView scrollViewForFocusedFormControlController:]):
+ (-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]): Deleted.
+
+ Implement some new focused form overlay delegate hooks to vend the scroll view, as well as the rects of next and
+ previous focusable form controls.
+
2018-03-27 Brent Fulgham <bfulgham@apple.com>
Further refine cookie read/write logging
[_webSelectionAssistant willStartScrollingOrZoomingPage];
[_textSelectionAssistant willStartScrollingOverflow];
_page->setIsScrollingOrZooming(true);
+
+#if ENABLE(EXTRA_ZOOM_MODE)
+ [_focusedFormControlViewController disengageFocusedFormControlNavigation];
+#endif
}
- (void)scrollViewWillStartPanOrPinchGesture
[_textSelectionAssistant didEndScrollingOverflow];
}
_page->setIsScrollingOrZooming(false);
+
+#if ENABLE(EXTRA_ZOOM_MODE)
+ [_focusedFormControlViewController engageFocusedFormControlNavigation];
+#endif
}
- (BOOL)requiresAccessoryView
[_focusedFormControlViewController show:NO];
[self dismissAllInputViewControllers];
[self updateCurrentAssistedNodeInformation:[weakSelf = WeakObjCPtr<WKContentView>(self)] (bool didUpdate) {
- if (didUpdate)
- [weakSelf.get()->_focusedFormControlViewController reloadData:YES];
+ if (didUpdate) {
+ auto focusedFormController = weakSelf.get()->_focusedFormControlViewController;
+ [focusedFormController reloadData:YES];
+ [focusedFormController engageFocusedFormControlNavigation];
+ }
}];
}
}];
}
-- (CGRect)highlightedRectForFocusedFormControlController:(WKFocusedFormControlViewController *)controller inCoordinateSpace:(id <UICoordinateSpace>)coordinateSpace
+- (CGRect)rectForFocusedFormControlController:(WKFocusedFormControlViewController *)controller inCoordinateSpace:(id <UICoordinateSpace>)coordinateSpace
{
return [self convertRect:_assistedNodeInformation.elementRect toCoordinateSpace:coordinateSpace];
}
+- (CGRect)nextRectForFocusedFormControlController:(WKFocusedFormControlViewController *)controller inCoordinateSpace:(id <UICoordinateSpace>)coordinateSpace
+{
+ if (!_assistedNodeInformation.hasNextNode)
+ return CGRectNull;
+
+ return [self convertRect:_assistedNodeInformation.nextNodeRect toCoordinateSpace:coordinateSpace];
+}
+
+- (CGRect)previousRectForFocusedFormControlController:(WKFocusedFormControlViewController *)controller inCoordinateSpace:(id <UICoordinateSpace>)coordinateSpace
+{
+ if (!_assistedNodeInformation.hasPreviousNode)
+ return CGRectNull;
+
+ return [self convertRect:_assistedNodeInformation.previousNodeRect toCoordinateSpace:coordinateSpace];
+}
+
+- (UIScrollView *)scrollViewForFocusedFormControlController:(WKFocusedFormControlViewController *)controller
+{
+ return self._scroller;
+}
+
- (NSString *)actionNameForFocusedFormControlController:(WKFocusedFormControlViewController *)controller
{
if (_assistedNodeInformation.formAction.isEmpty())