Changeset 210041 in webkit


Ignore:
Timestamp:
Dec 20, 2016 3:32:28 PM (7 years ago)
Author:
Simon Fraser
Message:

[iOS WK2] Switching or closing a tab leads to all-white tab content if the status bar is double height
https://bugs.webkit.org/show_bug.cgi?id=166286
rdar://problem/29593525

Reviewed by Tim Horton.

A double-height status bar triggers view resize while snapshotting in the background,
which also triggers calls to _endAnimatedResize on tab resume. However, it was possible
for _endAnimatedResize to re-enter via synchronizeDynamicViewportUpdate()/didCommitLayerTree(),
causing us to use a nil _resizeAnimationView for scale computations, thus setting a zero
scale on the WKContentView.

Fix by checking _dynamicViewportUpdateMode again after the call to synchronizeDynamicViewportUpdate(),
and do a belt-and-braces check for a nil _resizeAnimationView.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _endAnimatedResize]):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r210031 r210041  
     12016-12-20  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] Switching or closing a tab leads to all-white tab content if the status bar is double height
     4        https://bugs.webkit.org/show_bug.cgi?id=166286
     5        rdar://problem/29593525
     6
     7        Reviewed by Tim Horton.
     8
     9        A double-height status bar triggers view resize while snapshotting in the background,
     10        which also triggers calls to _endAnimatedResize on tab resume. However, it was possible
     11        for _endAnimatedResize to re-enter via synchronizeDynamicViewportUpdate()/didCommitLayerTree(),
     12        causing us to use a nil _resizeAnimationView for scale computations, thus setting a zero
     13        scale on the WKContentView.
     14
     15        Fix by checking _dynamicViewportUpdateMode again after the call to synchronizeDynamicViewportUpdate(),
     16        and do a belt-and-braces check for a nil _resizeAnimationView.
     17
     18        * UIProcess/API/Cocoa/WKWebView.mm:
     19        (-[WKWebView _endAnimatedResize]):
     20
    1212016-12-20  Andy Estes  <aestes@apple.com>
    222
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r210031 r210041  
    43054305    _page->synchronizeDynamicViewportUpdate();
    43064306
     4307    // synchronizeDynamicViewportUpdate() may cause this function to re-enter via _didCommitLayerTree, so check _dynamicViewportUpdateMode again.
     4308    if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::NotResizing)
     4309        return;
     4310
     4311    if (!_resizeAnimationView) {
     4312        // Paranoia. If _resizeAnimationView is null we'll end up setting a zero scale on the content view.
     4313        ASSERT_NOT_REACHED();
     4314        _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing;
     4315        [_contentView setHidden:NO];
     4316        return;
     4317    }
     4318   
    43074319    NSUInteger indexOfResizeAnimationView = [[_scrollView subviews] indexOfObject:_resizeAnimationView.get()];
    43084320    [_scrollView insertSubview:_contentView.get() atIndex:indexOfResizeAnimationView];
Note: See TracChangeset for help on using the changeset viewer.