Title: [226911] trunk/Source/WebKit
- Revision
- 226911
- Author
- [email protected]
- Date
- 2018-01-12 13:32:17 -0800 (Fri, 12 Jan 2018)
Log Message
Implement MultiDocument protocol for restoring focus to a WKWebView
https://bugs.webkit.org/show_bug.cgi?id=181510
Reviewed by Dan Bernstein.
Support the UIKit protocol for restoring focus to a what previously had focus.
WebKit already knows what node was previously being focused by the DOM, we merely
need to be asked to turn the focus on again.
Resubmitting https://trac.webkit.org/changeset/226826 as it broke internal builds
* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _restoreFocusWithToken:]):
(-[WKContentView _preserveFocusWithToken:destructively:]):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (226910 => 226911)
--- trunk/Source/WebKit/ChangeLog 2018-01-12 21:30:37 UTC (rev 226910)
+++ trunk/Source/WebKit/ChangeLog 2018-01-12 21:32:17 UTC (rev 226911)
@@ -1,3 +1,21 @@
+2018-01-12 Megan Gardner <[email protected]>
+
+ Implement MultiDocument protocol for restoring focus to a WKWebView
+ https://bugs.webkit.org/show_bug.cgi?id=181510
+
+ Reviewed by Dan Bernstein.
+
+ Support the UIKit protocol for restoring focus to a what previously had focus.
+ WebKit already knows what node was previously being focused by the DOM, we merely
+ need to be asked to turn the focus on again.
+ Resubmitting https://trac.webkit.org/changeset/226826 as it broke internal builds
+
+ * Platform/spi/ios/UIKitSPI.h:
+ * UIProcess/ios/WKContentViewInteraction.h:
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _restoreFocusWithToken:]):
+ (-[WKContentView _preserveFocusWithToken:destructively:]):
+
2018-01-12 Youenn Fablet <[email protected]>
WebProcess should pass the registration identifier and not the worker identifier for fetch events
Modified: trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h (226910 => 226911)
--- trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h 2018-01-12 21:30:37 UTC (rev 226910)
+++ trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h 2018-01-12 21:32:17 UTC (rev 226911)
@@ -967,6 +967,16 @@
- (void)forceReloadInputViews;
@end
+#if __has_include(<UIKit/UITextInputMultiDocument.h>)
+#import <UIKit/UITextAutofillSuggestion.h>
+#else
+@protocol UITextAutofillSuggestion <NSObject>
+@optional
+- (void)_restoreFocusWithToken:(id <NSCopying, NSSecureCoding>)token completion:(void (^)(BOOL didRestore))completion;
+- (void)_preserveFocusWithToken:(id <NSCopying, NSSecureCoding>)token destructively:(BOOL)destructively;
+@end
+#endif
+
@interface UIResponder ()
- (UIResponder *)firstResponder;
@end
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (226910 => 226911)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2018-01-12 21:30:37 UTC (rev 226910)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2018-01-12 21:32:17 UTC (rev 226911)
@@ -242,7 +242,7 @@
@end
-@interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UIWebTouchEventsGestureRecognizerDelegate, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWKInteractionViewProtocol, WKFileUploadPanelDelegate, WKActionSheetAssistantDelegate, UITextAutoscrolling
+@interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UITextAutoscrolling, UITextInputMultiDocument, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWebTouchEventsGestureRecognizerDelegate, UIWKInteractionViewProtocol, WKActionSheetAssistantDelegate, WKFileUploadPanelDelegate
#if ENABLE(DATA_INTERACTION)
, UIDragInteractionDelegate, UIDropInteractionDelegate
#endif
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (226910 => 226911)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-01-12 21:30:37 UTC (rev 226910)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2018-01-12 21:32:17 UTC (rev 226911)
@@ -4127,6 +4127,18 @@
_fileUploadPanel = nil;
}
+#pragma mark - UITextInputMultiDocument
+
+- (void)_restoreFocusWithToken:(id <NSCopying, NSSecureCoding>)token
+{
+ --_webView->_activeFocusedStateRetainCount;
+}
+
+- (void)_preserveFocusWithToken:(id <NSCopying, NSSecureCoding>)token destructively:(BOOL)destructively
+{
+ ++_webView->_activeFocusedStateRetainCount;
+}
+
#pragma mark - Implementation of UIWebTouchEventsGestureRecognizerDelegate.
// FIXME: Remove once -gestureRecognizer:shouldIgnoreWebTouchWithEvent: is in UIWebTouchEventsGestureRecognizer.h. Refer to <rdar://problem/33217525> for more details.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes