Changeset 214391 in webkit
- Timestamp:
- Mar 24, 2017 6:04:32 PM (7 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r214389 r214391 1 2017-03-24 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Move from a pre-commit handler to dispatch_async for visible content rect updates 4 https://bugs.webkit.org/show_bug.cgi?id=170091 5 rdar://problem/30682584 6 7 Reviewed by Tim Horton. 8 9 [CATransaction addCommitHandler:forPhase:] is sometimes not called when running inside another 10 commit callback (rdar://problem/31253952), and we don't yet have a reliable way to detect this. 11 12 So dispatch_async() to postpone the call to [CATransaction addCommitHandler:forPhase:] to a known- 13 good time. 14 15 * UIProcess/API/Cocoa/WKWebView.mm: 16 (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): 17 1 18 2017-03-24 John Wilander <wilander@apple.com> 2 19 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r214113 r214391 289 289 RetainPtr<WKPasswordView> _passwordView; 290 290 291 BOOL _has InstalledPreCommitHandlerForVisibleRectUpdate;291 BOOL _hasScheduledVisibleRectUpdate; 292 292 BOOL _visibleContentRectUpdateScheduledFromScrollViewInStableState; 293 293 Vector<BlockPtr<void ()>> _visibleContentRectUpdateCallbacks; … … 2302 2302 _visibleContentRectUpdateScheduledFromScrollViewInStableState = [self _scrollViewIsInStableState:scrollView]; 2303 2303 2304 if (_has InstalledPreCommitHandlerForVisibleRectUpdate)2304 if (_hasScheduledVisibleRectUpdate) 2305 2305 return; 2306 2306 2307 _hasInstalledPreCommitHandlerForVisibleRectUpdate = YES; 2308 2309 [CATransaction addCommitHandler:[retainedSelf = retainPtr(self)] { 2310 WKWebView *webView = retainedSelf.get(); 2311 [webView _updateVisibleContentRects]; 2312 webView->_hasInstalledPreCommitHandlerForVisibleRectUpdate = NO; 2313 } forPhase:kCATransactionPhasePreCommit]; 2307 _hasScheduledVisibleRectUpdate = YES; 2308 2309 // FIXME: remove the dispatch_async() when we have a fix for rdar://problem/31253952. 2310 dispatch_async(dispatch_get_main_queue(), [retainedSelf = retainPtr(self)] { 2311 [CATransaction addCommitHandler:[retainedSelf] { 2312 WKWebView *webView = retainedSelf.get(); 2313 [webView _updateVisibleContentRects]; 2314 webView->_hasScheduledVisibleRectUpdate = NO; 2315 } forPhase:kCATransactionPhasePreCommit]; 2316 }); 2314 2317 } 2315 2318
Note: See TracChangeset
for help on using the changeset viewer.