Changeset 195602 in webkit
- Timestamp:
- Jan 26, 2016 11:12:37 AM (8 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r195600 r195602 1 2016-01-26 Tim Horton <timothy_horton@apple.com> 2 3 REGRESSION (r194557): Keyboard shortcuts stop working after the WKWebView is unparented and reparented 4 https://bugs.webkit.org/show_bug.cgi?id=153492 5 <rdar://problem/24138989> 6 7 Reviewed by Dan Bernstein. 8 9 * UIProcess/ios/WKContentViewInteraction.h: 10 * UIProcess/ios/WKContentViewInteraction.mm: 11 (-[WKContentView canBecomeFirstResponder]): 12 (-[WKContentView becomeFirstResponder]): 13 (-[WKContentView resignFirstResponder]): 14 When WKWebView is unparented, WKContentView will attempt to resignFirstResponder upwards, 15 first asking WKWebView. After r194557, WKWebView will accept first responder and forward 16 it on to the WKContentView, which will happily accept it again, despite being the view 17 that's trying to resign. This will cause us to completely lose first responder, 18 where it was actually supposed to propagate up above WKWebView to the client. 19 20 Keep track of when WKContentView is resigning first responder, and don't 21 let it become first responder while it is doing so, breaking the cycle. 22 1 23 2016-01-25 Ada Chan <adachan@apple.com> 2 24 -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h
r192432 r195602 162 162 BOOL _isExpectingFastSingleTapCommit; 163 163 BOOL _showDebugTapHighlightsForFastClicking; 164 165 BOOL _isResigningFirstResponder; 164 166 } 165 167 -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r195574 r195602 670 670 - (BOOL)canBecomeFirstResponder 671 671 { 672 if (_isResigningFirstResponder) 673 return NO; 672 674 // We might want to return something else 673 675 // if we decide to enable/disable interaction programmatically. … … 677 679 - (BOOL)becomeFirstResponder 678 680 { 681 if (_isResigningFirstResponder) 682 return NO; 679 683 BOOL didBecomeFirstResponder = [super becomeFirstResponder]; 680 684 if (didBecomeFirstResponder) … … 688 692 // FIXME: Maybe we should call resignFirstResponder on the superclass 689 693 // and do nothing if the return value is NO. 694 695 _isResigningFirstResponder = YES; 690 696 691 697 if (!_webView->_activeFocusedStateRetainCount) { … … 699 705 [_textSelectionAssistant deactivateSelection]; 700 706 701 return [super resignFirstResponder]; 707 bool superDidResign = [super resignFirstResponder]; 708 709 _isResigningFirstResponder = NO; 710 711 return superDidResign; 702 712 } 703 713
Note: See TracChangeset
for help on using the changeset viewer.