Changeset 181511 in webkit
- Timestamp:
- Mar 15, 2015, 12:30:09 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r181505 r181511 1 2015-03-15 Dan Bernstein <mitz@apple.com> 2 3 [iOS] Presenting a modal sheet on top of a WKWebView causes it to lose focused, active state 4 https://bugs.webkit.org/show_bug.cgi?id=142702 5 6 Reviewed by Anders Carlsson. 7 8 * UIProcess/API/Cocoa/WKWebView.mm: 9 (-[WKWebView becomeFirstResponder]): Override to delegate first responder status to the 10 WKContentView if possible. 11 (-[WKWebView _retainActiveFocusedState]): New SPI that prevents view hierarchy changes from 12 affecting the active and focused state of the view. Increments a counter ivar and returns a 13 completion block (which callers must call when they’re done) that decrements it back. 14 * UIProcess/API/Cocoa/WKWebViewInternal.h: Declared new _activeFocusedStateRetainCount ivar 15 with @package access. 16 * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new method. 17 18 * UIProcess/ios/PageClientImplIOS.mm: 19 (WebKit::PageClientImpl::isViewWindowActive): Return true if active/focused state is to be 20 maintained despite not being visible. 21 (WebKit::PageClientImpl::isViewFocused): Return true if active/focused state is to be 22 maintained despite not being active. 23 24 * UIProcess/ios/WKContentViewInteraction.mm: 25 (-[WKContentView resignFirstResponder]): Don’t blur the assisted node if active/focused 26 state is to be maintained. 27 1 28 2015-03-14 Simon Fraser <simon.fraser@apple.com> 2 29 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r181504 r181511 651 651 } 652 652 653 - (BOOL)becomeFirstResponder 654 { 655 return [_contentView becomeFirstResponder] || [super becomeFirstResponder]; 656 } 657 653 658 static inline CGFloat floorToDevicePixel(CGFloat input, float deviceScaleFactor) 654 659 { … … 1771 1776 return webView->_overridesInterfaceOrientation ? deviceOrientationForUIInterfaceOrientation(webView->_interfaceOrientationOverride) : webView->_page->deviceOrientation(); 1772 1777 } 1778 1779 - (void (^)(void))_retainActiveFocusedState 1780 { 1781 ++_activeFocusedStateRetainCount; 1782 1783 // FIXME: Use something like CompletionHandlerCallChecker to ensure that the returned block is called before it's released. 1784 return [[[self] { 1785 --_activeFocusedStateRetainCount; 1786 } copy] autorelease]; 1787 } 1788 1773 1789 #endif 1774 1790 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h
r180361 r181511 61 61 62 62 RefPtr<WebKit::WebPageProxy> _page; 63 64 #if PLATFORM(IOS) 65 NSUInteger _activeFocusedStateRetainCount; 66 #endif 63 67 } 64 68 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
r179752 r181511 152 152 - (void)_didRelaunchProcess; 153 153 154 // Puts the view into a state where being taken out of the view hierarchy and resigning first responder 155 // will not count as becoming inactive and unfocused. The returned block must be called to exit the state. 156 - (void (^)(void))_retainActiveFocusedState WK_AVAILABLE(NA, WK_IOS_TBA); 157 154 158 #else 155 159 @property (readonly) NSColor *_pageExtendedBackgroundColor; -
trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
r181023 r181511 172 172 { 173 173 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098 174 return isViewVisible() ;174 return isViewVisible() || m_webView->_activeFocusedStateRetainCount; 175 175 } 176 176 … … 178 178 { 179 179 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098 180 return isViewWindowActive() ;180 return isViewWindowActive() || m_webView->_activeFocusedStateRetainCount; 181 181 } 182 182 -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r181448 r181511 518 518 // FIXME: Maybe we should call resignFirstResponder on the superclass 519 519 // and do nothing if the return value is NO. 520 // We need to complete the editing operation before we blur the element. 521 [_inputPeripheral endEditing]; 522 _page->blurAssistedNode(); 520 521 if (!_webView->_activeFocusedStateRetainCount) { 522 // We need to complete the editing operation before we blur the element. 523 [_inputPeripheral endEditing]; 524 _page->blurAssistedNode(); 525 } 526 523 527 [self _cancelInteraction]; 524 528 [_webSelectionAssistant resignedFirstResponder];
Note:
See TracChangeset
for help on using the changeset viewer.