⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 220788 in webkit


Ignore:
Timestamp:
Aug 16, 2017, 12:49:32 AM (9 years ago)
Author:
jmarcell@apple.com
Message:

Cherry-pick r220286. rdar://problem/33904738

Location:
branches/safari-604-branch/Source/WebKit
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-604-branch/Source/WebKit/ChangeLog

    r220635 r220788  
     12017-08-15  Jason Marcell  <jmarcell@apple.com>
     2
     3        Cherry-pick r220286. rdar://problem/33904738
     4
     5    2017-08-04  Tim Horton  <timothy_horton@apple.com>
     6
     7            viewport-fit changes during animated resize can cause layout size to get stuck
     8            https://bugs.webkit.org/show_bug.cgi?id=175169
     9            <rdar://problem/33684697>
     10
     11            Reviewed by Simon Fraser.
     12
     13            If we get a commit that changes viewport-fit state while an animated
     14            resize is underway, and that change causes the client to push a new
     15            minimumLayoutSizeOverride, the new size will be lost forever, and we
     16            will get stuck laying out at the wrong size.
     17
     18            This is because we unconditionally apply avoidsUnsafeArea for every commit,
     19            while most other changes that come in from a commit are ignored if we're
     20            inside animated resize. To fix, also ignore avoidsUnsafeArea changes during
     21            animated resize, by moving the code that keeps track of it into WKWebView
     22            like all of the rest, and read it out of the commit in didCommitLayerTree
     23            *after* the animated-resize early-return.
     24
     25            Also, fix the associated layout tests by adding a missing assignment
     26            in _computedContentInset, which was broken in r220138.
     27
     28            * UIProcess/API/Cocoa/WKWebView.mm:
     29            (-[WKWebView _initializeWithConfiguration:]):
     30            (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
     31            (-[WKWebView _processDidExit]):
     32            (-[WKWebView _didCommitLayerTree:]):
     33            (-[WKWebView _setAvoidsUnsafeArea:]):
     34            (-[WKWebView _safeAreaShouldAffectObscuredInsets]):
     35            (-[WKWebView _didChangeAvoidsUnsafeArea:]): Deleted.
     36            * UIProcess/API/Cocoa/WKWebViewInternal.h:
     37            * UIProcess/PageClient.h:
     38            * UIProcess/WebPageProxy.cpp:
     39            (WebKit::WebPageProxy::resetState):
     40            (WebKit::WebPageProxy::setAvoidsUnsafeArea): Deleted.
     41            * UIProcess/WebPageProxy.h:
     42            (WebKit::WebPageProxy::avoidsUnsafeArea const): Deleted.
     43            * UIProcess/ios/PageClientImplIOS.h:
     44            * UIProcess/ios/PageClientImplIOS.mm:
     45            (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea): Deleted.
     46            * UIProcess/ios/WebPageProxyIOS.mm:
     47            (WebKit::WebPageProxy::didCommitLayerTree):
     48
    1492017-08-13  Jason Marcell  <jmarcell@apple.com>
    250
  • branches/safari-604-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r220230 r220788  
    248248    UIEdgeInsets _unobscuredSafeAreaInsets;
    249249    BOOL _haveSetUnobscuredSafeAreaInsets;
     250    BOOL _avoidsUnsafeArea;
    250251    UIRectEdge _obscuredInsetEdgesAffectedBySafeArea;
    251252
    … …  
    525526    [_scrollView setBouncesZoom:YES];
    526527
     528    _avoidsUnsafeArea = YES;
    527529    [self _updateScrollViewInsetAdjustmentBehavior];
    528530
    … …  
    12701272        [_scrollView setContentOffset:[self _adjustedContentOffset:CGPointZero]];
    12711273
    1272         [self _didChangeAvoidsUnsafeArea:NO];
     1274        [self _setAvoidsUnsafeArea:NO];
    12731275    } else if (_customContentView) {
    12741276        [_customContentView removeFromSuperview];
    … …  
    12841286        [_customContentFixedOverlayView setFrame:self.bounds];
    12851287        [self addSubview:_customContentFixedOverlayView.get()];
    1286 
    1287         [self _didChangeAvoidsUnsafeArea:_page->avoidsUnsafeArea()];
    12881288    }
    12891289
    … …  
    14091409#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
    14101410    if (self._safeAreaShouldAffectObscuredInsets)
    1411         UIEdgeInsetsAdd(insets, [_scrollView _systemContentInset], self._effectiveObscuredInsetEdgesAffectedBySafeArea);
     1411        insets = UIEdgeInsetsAdd(insets, [_scrollView _systemContentInset], self._effectiveObscuredInsetEdgesAffectedBySafeArea);
    14121412#endif
    14131413
    … …  
    14631463    _firstTransactionIDAfterPageRestore = 0;
    14641464    _resizeAnimationTransformTransactionID = std::nullopt;
     1465
     1466    _avoidsUnsafeArea = YES;
    14651467}
    14661468
    … …  
    15611563
    15621564    [self _updateScrollViewBackground];
     1565    [self _setAvoidsUnsafeArea:layerTreeTransaction.avoidsUnsafeArea()];
    15631566
    15641567    if (_gestureController)
    … …  
    27192722}
    27202723
    2721 - (void)_didChangeAvoidsUnsafeArea:(BOOL)avoidsUnsafeArea
    2722 {
     2724- (void)_setAvoidsUnsafeArea:(BOOL)avoidsUnsafeArea
     2725{
     2726    if (_avoidsUnsafeArea == avoidsUnsafeArea)
     2727        return;
     2728
     2729    _avoidsUnsafeArea = avoidsUnsafeArea;
     2730
    27232731    [self _updateScrollViewInsetAdjustmentBehavior];
    27242732    [self _scheduleVisibleContentRectUpdate];
    … …  
    46744682    if (![self usesStandardContentView])
    46754683        return NO;
    4676     if (!_page)
    4677         return YES;
    4678     return _page->avoidsUnsafeArea();
     4684    return _avoidsUnsafeArea;
    46794685}
    46804686
  • branches/safari-604-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h

    r220230 r220788  
    120120- (void)_hidePasswordView;
    121121
    122 - (void)_didChangeAvoidsUnsafeArea:(BOOL)avoidsUnsafeArea;
    123 
    124122- (void)_addShortcut:(id)sender;
    125123- (void)_arrowKey:(id)sender;
  • branches/safari-604-branch/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h

    r218740 r220788  
    147147    WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override { return WebCore::UserInterfaceLayoutDirection::LTR; }
    148148
    149     void didChangeAvoidsUnsafeArea(bool) override { }
    150 
    151149    JSGlobalContextRef javascriptGlobalContext() override;
    152150
  • branches/safari-604-branch/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h

    r218740 r220788  
    118118    WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override;
    119119
    120     void didChangeAvoidsUnsafeArea(bool) override { }
    121 
    122120    JSGlobalContextRef javascriptGlobalContext() override;
    123121
  • branches/safari-604-branch/Source/WebKit/UIProcess/PageClient.h

    r219340 r220788  
    385385#endif
    386386
    387     virtual void didChangeAvoidsUnsafeArea(bool avoidsUnsafeArea) = 0;
    388 
    389387#if PLATFORM(GTK) || PLATFORM(WPE)
    390388    virtual JSGlobalContextRef javascriptGlobalContext() { return nullptr; }
  • branches/safari-604-branch/Source/WebKit/UIProcess/WebPageProxy.cpp

    r220062 r220788  
    54995499    requestPointerUnlock();
    55005500#endif
    5501 
    5502     m_avoidsUnsafeArea = true;
    55035501}
    55045502
    … …  
    69356933}
    69366934
    6937 void WebPageProxy::setAvoidsUnsafeArea(bool avoidsUnsafeArea)
    6938 {
    6939     if (m_avoidsUnsafeArea == avoidsUnsafeArea)
    6940         return;
    6941 
    6942     m_avoidsUnsafeArea = avoidsUnsafeArea;
    6943 
    6944     m_pageClient.didChangeAvoidsUnsafeArea(avoidsUnsafeArea);
    6945 }
    6946 
    69476935} // namespace WebKit
  • branches/safari-604-branch/Source/WebKit/UIProcess/WebPageProxy.h

    r220062 r220788  
    12011201#endif
    12021202
    1203     void setAvoidsUnsafeArea(bool);
    1204     bool avoidsUnsafeArea() const { return m_avoidsUnsafeArea; }
    1205 
    12061203private:
    12071204    WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&);
    … …  
    20001997    bool m_isUsingHighPerformanceWebGL { false };
    20011998
    2002     bool m_avoidsUnsafeArea { true };
    2003 
    20041999    WeakPtrFactory<WebPageProxy> m_weakPtrFactory;
    20052000
  • branches/safari-604-branch/Source/WebKit/UIProcess/ios/PageClientImplIOS.h

    r219340 r220788  
    200200    void handleActiveNowPlayingSessionInfoResponse(bool hasActiveSession, const String& title, double duration, double elapsedTime) override;
    201201
    202     void didChangeAvoidsUnsafeArea(bool avoidsUnsafeArea) override;
    203 
    204202#if USE(QUICK_LOOK)
    205203    void requestPasswordForQuickLookDocument(const String& fileName, WTF::Function<void(const String&)>&&) override;
  • branches/safari-604-branch/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm

    r219340 r220788  
    827827#endif
    828828
    829 void PageClientImpl::didChangeAvoidsUnsafeArea(bool avoidsUnsafeArea)
    830 {
    831     [m_webView _didChangeAvoidsUnsafeArea:avoidsUnsafeArea];
    832 }
    833 
    834829} // namespace WebKit
    835830
  • branches/safari-604-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm

    r219934 r220788  
    373373{
    374374    m_pageExtendedBackgroundColor = layerTreeTransaction.pageExtendedBackgroundColor();
    375     setAvoidsUnsafeArea(layerTreeTransaction.avoidsUnsafeArea());
    376375
    377376    if (!m_hasReceivedLayerTreeTransactionAfterDidCommitLoad) {
  • branches/safari-604-branch/Source/WebKit/UIProcess/mac/PageClientImpl.h

    r217566 r220788  
    254254    void didRestoreScrollPosition() override;
    255255    bool windowIsFrontWindowUnderMouse(const NativeWebMouseEvent&) override;
    256 
    257     void didChangeAvoidsUnsafeArea(bool avoidsUnsafeArea) override { }
    258256};
    259257
Note: See TracChangeset for help on using the changeset viewer.