Title: [229837] trunk/Source/WebKit
- Revision
- 229837
- Author
- [email protected]
- Date
- 2018-03-21 17:22:37 -0700 (Wed, 21 Mar 2018)
Log Message
[Extra zoom mode] Add new SPI hooks for clients to vend an input session context view
https://bugs.webkit.org/show_bug.cgi?id=183866
<rdar://problem/38692256>
Reviewed by Tim Horton.
Add new SPI hooks to _WKInputDelegate allowing internal clients to provide a view that gives additional context
when editing form controls, on top of the default label or placeholder text displayed by WebKit. The height
delegate is invoked first, giving the client an opportunity to lay out the context view to fit the given size;
the actual view is then queried.
If the view changes, clients may tell WebKit to reload the context view via SPI on WKFormInputSession; this call
to reload is plumbed through to the currently presented list view controller (at the moment, this is only the
text input list view controller).
* UIProcess/API/Cocoa/_WKFormInputSession.h:
* UIProcess/API/Cocoa/_WKInputDelegate.h:
Add the new SPI hooks, described above.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFormInputSession reloadFocusedElementContextView]):
Plumb the context view reload hook through WKContentView to WKTextInputListViewController.
(-[WKContentView setupInteraction]):
(-[WKContentView _stopAssistingNode]):
(-[WKContentView reloadContextViewForPresentedListViewController]):
(-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
Slight tweak to only reload text suggestions if we are not blurring the focused element. Without this extra
condition, the list view controller's inner table view would get reloaded when the form input session's text
suggestions are set to nil when the list view controller is dismissed, causing a visible stutter in the
dismissal animation of view controller.
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (229836 => 229837)
--- trunk/Source/WebKit/ChangeLog 2018-03-22 00:05:44 UTC (rev 229836)
+++ trunk/Source/WebKit/ChangeLog 2018-03-22 00:22:37 UTC (rev 229837)
@@ -1,3 +1,41 @@
+2018-03-21 Wenson Hsieh <[email protected]>
+
+ [Extra zoom mode] Add new SPI hooks for clients to vend an input session context view
+ https://bugs.webkit.org/show_bug.cgi?id=183866
+ <rdar://problem/38692256>
+
+ Reviewed by Tim Horton.
+
+ Add new SPI hooks to _WKInputDelegate allowing internal clients to provide a view that gives additional context
+ when editing form controls, on top of the default label or placeholder text displayed by WebKit. The height
+ delegate is invoked first, giving the client an opportunity to lay out the context view to fit the given size;
+ the actual view is then queried.
+
+ If the view changes, clients may tell WebKit to reload the context view via SPI on WKFormInputSession; this call
+ to reload is plumbed through to the currently presented list view controller (at the moment, this is only the
+ text input list view controller).
+
+ * UIProcess/API/Cocoa/_WKFormInputSession.h:
+ * UIProcess/API/Cocoa/_WKInputDelegate.h:
+
+ Add the new SPI hooks, described above.
+
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKFormInputSession reloadFocusedElementContextView]):
+
+ Plumb the context view reload hook through WKContentView to WKTextInputListViewController.
+
+ (-[WKContentView setupInteraction]):
+ (-[WKContentView _stopAssistingNode]):
+ (-[WKContentView reloadContextViewForPresentedListViewController]):
+ (-[WKContentView focusedFormControllerDidUpdateSuggestions:]):
+
+ Slight tweak to only reload text suggestions if we are not blurring the focused element. Without this extra
+ condition, the list view controller's inner table view would get reloaded when the form input session's text
+ suggestions are set to nil when the list view controller is dismissed, causing a visible stutter in the
+ dismissal animation of view controller.
+
2018-03-21 Chris Dumez <[email protected]>
WebKitTestRunner crashed in com.apple.WebKit: WebKit::WebProcessPool::terminateServiceWorkerProcesses
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKFormInputSession.h (229836 => 229837)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKFormInputSession.h 2018-03-22 00:05:44 UTC (rev 229836)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKFormInputSession.h 2018-03-22 00:22:37 UTC (rev 229837)
@@ -45,6 +45,8 @@
@property (nonatomic) BOOL accessoryViewShouldNotShow WK_API_AVAILABLE(ios(10.0));
@property (nonatomic) BOOL forceSecureTextEntry WK_API_AVAILABLE(ios(10.0));
@property (nonatomic, readonly) BOOL requiresStrongPasswordAssistance WK_API_AVAILABLE(ios(WK_IOS_TBA));
+
+- (void)reloadFocusedElementContextView WK_API_AVAILABLE(ios(WK_IOS_TBA));
#endif
@end
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInputDelegate.h (229836 => 229837)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInputDelegate.h 2018-03-22 00:05:44 UTC (rev 229836)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKInputDelegate.h 2018-03-22 00:22:37 UTC (rev 229837)
@@ -46,6 +46,9 @@
- (void)_webView:(WKWebView *)webView accessoryViewCustomButtonTappedInFormInputSession:(id <_WKFormInputSession>)inputSession;
- (void)_webView:(WKWebView *)webView insertTextSuggestion:(UITextSuggestion *)suggestion inInputSession:(id <_WKFormInputSession>)inputSession WK_API_AVAILABLE(ios(10.0));
- (BOOL)_webView:(WKWebView *)webView focusRequiresStrongPasswordAssistance:(id <_WKFocusedElementInfo>)info WK_API_AVAILABLE(ios(WK_IOS_TBA));
+
+- (CGFloat)_webView:(WKWebView *)webView focusedElementContextViewHeightForFittingSize:(CGSize)fittingSize inputSession:(id <_WKFormInputSession>)inputSession WK_API_AVAILABLE(ios(WK_IOS_TBA));
+- (UIView *)_webView:(WKWebView *)webView focusedElementContextViewForInputSession:(id <_WKFormInputSession>)inputSession WK_API_AVAILABLE(ios(WK_IOS_TBA));
#endif
@end
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (229836 => 229837)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2018-03-22 00:05:44 UTC (rev 229836)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2018-03-22 00:22:37 UTC (rev 229837)
@@ -235,6 +235,7 @@
BOOL _resigningFirstResponder;
BOOL _needsDeferredEndScrollingSelectionUpdate;
BOOL _isChangingFocus;
+ BOOL _isBlurringFocusedNode;
BOOL _focusRequiresStrongPasswordAssistance;
@@ -352,6 +353,8 @@
- (void)_didChangeDataInteractionCaretRect:(CGRect)previousRect currentRect:(CGRect)rect;
#endif
+- (void)reloadContextViewForPresentedListViewController;
+
@end
@interface WKContentView (WKTesting)
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (229836 => 229837)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-03-22 00:05:44 UTC (rev 229836)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-03-22 00:22:37 UTC (rev 229837)
@@ -400,6 +400,11 @@
_contentView = nil;
}
+- (void)reloadFocusedElementContextView
+{
+ [_contentView reloadContextViewForPresentedListViewController];
+}
+
@end
@implementation WKFocusedElementInfo {
@@ -664,6 +669,7 @@
_showDebugTapHighlightsForFastClicking = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitShowFastClickDebugTapHighlights"];
_needsDeferredEndScrollingSelectionUpdate = NO;
_isChangingFocus = NO;
+ _isBlurringFocusedNode = NO;
}
- (void)cleanupInteraction
@@ -4103,6 +4109,8 @@
- (void)_stopAssistingNode
{
+ SetForScope<BOOL> isBlurringFocusedNodeForScope { _isBlurringFocusedNode, YES };
+
[_formInputSession invalidate];
_formInputSession = nil;
@@ -4148,8 +4156,15 @@
});
}
+- (void)reloadContextViewForPresentedListViewController
+{
#if ENABLE(EXTRA_ZOOM_MODE)
+ [_textInputListViewController reloadContextView];
+#endif
+}
+#if ENABLE(EXTRA_ZOOM_MODE)
+
- (void)dismissAllInputViewControllers
{
[self dismissTextInputViewController:YES];
@@ -4408,7 +4423,8 @@
- (void)focusedFormControllerDidUpdateSuggestions:(WKFocusedFormControlViewController *)controller
{
- [_textInputListViewController reloadTextSuggestions];
+ if (!_isBlurringFocusedNode)
+ [_textInputListViewController reloadTextSuggestions];
}
#pragma mark - WKSelectMenuViewControllerDelegate
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes