Changeset 171329 in webkit


Ignore:
Timestamp:
Jul 21, 2014 5:58:40 PM (10 years ago)
Author:
Simon Fraser
Message:

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:]):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r171326 r171329  
     12014-07-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r170361): In landscape with UI hidden, fixed position elements at top of screen are too low
     4        https://bugs.webkit.org/show_bug.cgi?id=135141
     5        <rdar://problem/17627525>
     6
     7        Reviewed by Benjamin Poulain.
     8       
     9        We can't use the WKWebView's UIScrollView contentInsets to determine the unobscured rect
     10        in MobileSafari, because contentInsets can't be changed dynamically while scrolling.
     11        To get around this, MobileSafari sets obscured insets instead (but also sets a fixed
     12        contentInset).
     13       
     14        So if the client calls _setObscuredInsets:, always use _obscuredInsets to compute the
     15        content insets.
     16
     17        * UIProcess/API/Cocoa/WKWebView.mm:
     18        (-[WKWebView _computedContentInset]):
     19        (-[WKWebView _setObscuredInsets:]):
     20
    1212014-07-21  Oliver Hunt  <oliver@apple.com>
    222
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r171219 r171329  
    169169
    170170    UIEdgeInsets _obscuredInsets;
    171     bool _isChangingObscuredInsetsInteractively;
     171    BOOL _haveSetObscuredInsets;
     172    BOOL _isChangingObscuredInsetsInteractively;
    172173
    173174    UIInterfaceOrientation _interfaceOrientationOverride;
     
    741742- (UIEdgeInsets)_computedContentInset
    742743{
    743     if (!UIEdgeInsetsEqualToEdgeInsets(_obscuredInsets, UIEdgeInsetsZero))
     744    if (_haveSetObscuredInsets)
    744745        return _obscuredInsets;
    745746
     
    20772078    ASSERT(obscuredInsets.bottom >= 0);
    20782079    ASSERT(obscuredInsets.right >= 0);
     2080   
     2081    _haveSetObscuredInsets = YES;
    20792082
    20802083    if (UIEdgeInsetsEqualToEdgeInsets(_obscuredInsets, obscuredInsets))
Note: See TracChangeset for help on using the changeset viewer.