+2014-07-15 Timothy Horton <timothy_horton@apple.com>
+
+ Dispatch top content inset changes immediately if synchronously waiting for view state changes
+ https://bugs.webkit.org/show_bug.cgi?id=134942
+ <rdar://problem/17666800>
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView endDeferringViewInWindowChanges]):
+ (-[WKView endDeferringViewInWindowChangesSync]):
+ (-[WKView _dispatchSetTopContentInset]):
+ (-[WKView _setTopContentInset:]):
+ Send top content inset changes immediately before sync-waiting for new tiles from the Web Process.
+ This will ensure that the incoming contents have the right top content inset, and we don't
+ flash between the wrong inset and the right one.
+
2014-07-15 Enrica Casucci <enrica@apple.com>
REGRESSION(WK2 iOS): Safari hangs when switching focus from a field using the Tab key.
_data->_shouldDeferViewInWindowChanges = NO;
if (_data->_viewInWindowChangeWasDeferred) {
+ [self _dispatchSetTopContentInset];
_data->_page->viewStateDidChange(ViewState::IsInWindow);
_data->_viewInWindowChangeWasDeferred = NO;
}
_data->_shouldDeferViewInWindowChanges = NO;
if (_data->_viewInWindowChangeWasDeferred) {
+ [self _dispatchSetTopContentInset];
_data->_page->viewStateDidChange(ViewState::IsInWindow);
_data->_viewInWindowChangeWasDeferred = NO;
}
return _data->_allowsBackForwardNavigationGestures;
}
+- (void)_dispatchSetTopContentInset
+{
+ _data->_didScheduleSetTopContentInset = NO;
+ _data->_page->setTopContentInset(_data->_topContentInset);
+}
+
- (void)_setTopContentInset:(CGFloat)contentInset
{
_data->_topContentInset = contentInset;
_data->_didScheduleSetTopContentInset = YES;
dispatch_async(dispatch_get_main_queue(), ^{
- _data->_didScheduleSetTopContentInset = NO;
-
- _data->_page->setTopContentInset(_data->_topContentInset);
+ if (_data->_didScheduleSetTopContentInset)
+ [self _dispatchSetTopContentInset];
});
}