WebKit Bugzilla
Attachment 346809 Details for
Bug 188427
: Yet more crashes in MobileSafari under -[WKFormInputSession setSuggestions:]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188427-20180808184118.patch (text/plain), 4.10 KB, created by
Tim Horton
on 2018-08-08 18:41:19 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tim Horton
Created:
2018-08-08 18:41:19 PDT
Size:
4.10 KB
patch
obsolete
>Subversion Revision: 234713 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index b854c601526f4042875433994e5781d73e4bb17a..b29b06d035ef5f91b80ff0cfe5fc3a8a6b31a862 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,25 @@ >+2018-08-08 Tim Horton <timothy_horton@apple.com> >+ >+ Yet more crashes in MobileSafari under -[WKFormInputSession setSuggestions:] >+ https://bugs.webkit.org/show_bug.cgi?id=188427 >+ <rdar://problem/43064672> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Speculatively fix more crashes seen under setSuggestions. >+ >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKFormInputSession isValid]): >+ (-[WKFormInputSession setSuggestions:]): >+ (-[WKFormInputSession invalidate]): >+ Belt-and-suspenders fix: use ObjCWeakPtr for WKFormInputSession's WKContentView reference. >+ >+ (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]): >+ Invalidate the WKFormInputSession before replacing it; we theorize that >+ there is a path in which we get here without having previously called stopAssistingNode. >+ Most of the code is OK with this, but this leaves WKFormInputSession >+ with a raw reference to WKContentView which can later become stale. >+ > 2018-08-08 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r234314, r234320, and r234321. >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index 8cee7b7f699c0f45f47a27064d9569e20f3cc2ad..c0912c28d3d3505fcd1d5dc29e32548108255846 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -291,7 +291,7 @@ - (void)invalidate; > @end > > @implementation WKFormInputSession { >- WKContentView *_contentView; >+ WeakObjCPtr<WKContentView> _contentView; > RetainPtr<WKFocusedElementInfo> _focusedElementInfo; > RetainPtr<UIView> _customInputView; > RetainPtr<NSArray<UITextSuggestion *>> _suggestions; >@@ -324,7 +324,7 @@ - (NSObject <NSSecureCoding> *)userObject > > - (BOOL)isValid > { >- return _contentView != nil; >+ return !!_contentView; > } > > - (NSString *)accessoryViewCustomButtonTitle >@@ -391,7 +391,7 @@ - (NSArray<UITextSuggestion *> *)suggestions > > - (void)setSuggestions:(NSArray<UITextSuggestion *> *)suggestions > { >- id <UITextInputSuggestionDelegate> suggestionDelegate = (id <UITextInputSuggestionDelegate>)_contentView.inputDelegate; >+ id <UITextInputSuggestionDelegate> suggestionDelegate = (id <UITextInputSuggestionDelegate>)[_contentView inputDelegate]; > _suggestions = adoptNS([suggestions copy]); > [suggestionDelegate setSuggestions:suggestions]; > } >@@ -403,7 +403,7 @@ - (BOOL)requiresStrongPasswordAssistance > > - (void)invalidate > { >- id <UITextInputSuggestionDelegate> suggestionDelegate = (id <UITextInputSuggestionDelegate>)_contentView.inputDelegate; >+ id <UITextInputSuggestionDelegate> suggestionDelegate = (id <UITextInputSuggestionDelegate>)[_contentView inputDelegate]; > [suggestionDelegate setSuggestions:nil]; > _contentView = nil; > } >@@ -4121,8 +4121,10 @@ - (void)_startAssistingNode:(const AssistedNodeInformation&)information userIsIn > bool delegateImplementsWillStartInputSession = [inputDelegate respondsToSelector:@selector(_webView:willStartInputSession:)]; > bool delegateImplementsDidStartInputSession = [inputDelegate respondsToSelector:@selector(_webView:didStartInputSession:)]; > >- if (delegateImplementsWillStartInputSession || delegateImplementsDidStartInputSession) >+ if (delegateImplementsWillStartInputSession || delegateImplementsDidStartInputSession) { >+ [_formInputSession invalidate]; > _formInputSession = adoptNS([[WKFormInputSession alloc] initWithContentView:self focusedElementInfo:focusedElementInfo.get() requiresStrongPasswordAssistance:_focusRequiresStrongPasswordAssistance]); >+ } > > if (delegateImplementsWillStartInputSession) > [inputDelegate _webView:_webView willStartInputSession:_formInputSession.get()];
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
wenson_hsieh
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188427
: 346809