Changeset 244113 in webkit
- Timestamp:
- Apr 10, 2019 9:32:30 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r244104 r244113 1 2019-04-10 Brady Eidson <beidson@apple.com> 2 3 Background tabs are not fully reactivated after a link is opened from an external application. 4 <rdar://problem/49533278> and https://bugs.webkit.org/show_bug.cgi?id=196705 5 6 Reviewed by Chris Dumez. 7 8 If an app unparents a WKWebView right after activation but before the "applicationWillEnterForeground" notification 9 is dispatched, then that WKWebView is in a broken state with a frozen layer tree. 10 11 The WKApplicationStateTrackingView logic needs to be a little more resilient. 12 13 * UIProcess/ios/WKApplicationStateTrackingView.mm: 14 (-[WKApplicationStateTrackingView willMoveToWindow:]): When clearing the window, remember the current background state. 15 (-[WKApplicationStateTrackingView didMoveToWindow]): If our last observed background state doesn't match the current 16 background state then fake the relevant notification. 17 (-[WKApplicationStateTrackingView _applicationDidEnterBackground]): Remember that we've observed a backgrounding. 18 (-[WKApplicationStateTrackingView _applicationWillEnterForeground]): Remember that we've observed a foregrounding. 19 1 20 2019-04-10 Diego Pino Garcia <dpino@igalia.com> 2 21 -
trunk/Source/WebKit/UIProcess/ios/WKApplicationStateTrackingView.mm
r237266 r244113 38 38 WeakObjCPtr<WKWebView> _webViewToTrack; 39 39 std::unique_ptr<WebKit::ApplicationStateTracker> _applicationStateTracker; 40 BOOL _lastObservedStateWasBackground; 40 41 } 41 42 … … 54 55 return; 55 56 57 _lastObservedStateWasBackground = [self isBackground]; 58 56 59 ASSERT(_applicationStateTracker); 57 60 _applicationStateTracker = nullptr; … … 65 68 ASSERT(!_applicationStateTracker); 66 69 _applicationStateTracker = std::make_unique<WebKit::ApplicationStateTracker>(self, @selector(_applicationDidEnterBackground), @selector(_applicationDidFinishSnapshottingAfterEnteringBackground), @selector(_applicationWillEnterForeground)); 70 71 if (_lastObservedStateWasBackground && ![self isBackground]) 72 [self _applicationWillEnterForeground]; 73 else if (!_lastObservedStateWasBackground && [self isBackground]) 74 [self _applicationDidEnterBackground]; 67 75 } 68 76 … … 73 81 return; 74 82 83 _lastObservedStateWasBackground = YES; 75 84 page->applicationDidEnterBackground(); 76 85 page->activityStateDidChange(WebCore::ActivityState::allFlags() - WebCore::ActivityState::IsInWindow); … … 89 98 return; 90 99 100 _lastObservedStateWasBackground = NO; 91 101 page->applicationWillEnterForeground(); 92 102 page->activityStateDidChange(WebCore::ActivityState::allFlags() - WebCore::ActivityState::IsInWindow, true, WebKit::WebPageProxy::ActivityStateChangeDispatchMode::Immediate);
Note: See TracChangeset
for help on using the changeset viewer.