+2014-07-21 Simon Fraser <simon.fraser@apple.com>
+
+ REGRESSION (r170361): In landscape with UI hidden, fixed position elements at top of screen are too low
+ https://bugs.webkit.org/show_bug.cgi?id=135141
+ <rdar://problem/17627525>
+
+ Reviewed by Benjamin Poulain.
+
+ We can't use the WKWebView's UIScrollView contentInsets to determine the unobscured rect
+ in MobileSafari, because contentInsets can't be changed dynamically while scrolling.
+ To get around this, MobileSafari sets obscured insets instead (but also sets a fixed
+ contentInset).
+
+ So if the client calls _setObscuredInsets:, always use _obscuredInsets to compute the
+ content insets.
+
+ * UIProcess/API/Cocoa/WKWebView.mm:
+ (-[WKWebView _computedContentInset]):
+ (-[WKWebView _setObscuredInsets:]):
+
2014-07-21 Oliver Hunt <oliver@apple.com>
Remove global cookie workaround from sandbox profiles
CGFloat _viewportMetaTagWidth;
UIEdgeInsets _obscuredInsets;
- bool _isChangingObscuredInsetsInteractively;
+ BOOL _haveSetObscuredInsets;
+ BOOL _isChangingObscuredInsetsInteractively;
UIInterfaceOrientation _interfaceOrientationOverride;
BOOL _overridesInterfaceOrientation;
- (UIEdgeInsets)_computedContentInset
{
- if (!UIEdgeInsetsEqualToEdgeInsets(_obscuredInsets, UIEdgeInsetsZero))
+ if (_haveSetObscuredInsets)
return _obscuredInsets;
return [_scrollView contentInset];
ASSERT(obscuredInsets.left >= 0);
ASSERT(obscuredInsets.bottom >= 0);
ASSERT(obscuredInsets.right >= 0);
+
+ _haveSetObscuredInsets = YES;
if (UIEdgeInsetsEqualToEdgeInsets(_obscuredInsets, obscuredInsets))
return;