Changeset 220286 in webkit
- Timestamp:
- Aug 4, 2017, 12:50:23 PM (9 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 12 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/API/Cocoa/WKWebView.mm (modified) (9 diffs)
-
UIProcess/API/Cocoa/WKWebViewInternal.h (modified) (1 diff)
-
UIProcess/API/gtk/PageClientImpl.h (modified) (1 diff)
-
UIProcess/API/wpe/PageClientImpl.h (modified) (1 diff)
-
UIProcess/PageClient.h (modified) (1 diff)
-
UIProcess/WebPageProxy.cpp (modified) (2 diffs)
-
UIProcess/WebPageProxy.h (modified) (2 diffs)
-
UIProcess/ios/PageClientImplIOS.h (modified) (1 diff)
-
UIProcess/ios/PageClientImplIOS.mm (modified) (1 diff)
-
UIProcess/ios/WebPageProxyIOS.mm (modified) (1 diff)
-
UIProcess/mac/PageClientImpl.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r220279 r220286 1 2017-08-04 Tim Horton <timothy_horton@apple.com> 2 3 viewport-fit changes during animated resize can cause layout size to get stuck 4 https://bugs.webkit.org/show_bug.cgi?id=175169 5 <rdar://problem/33684697> 6 7 Reviewed by Simon Fraser. 8 9 If we get a commit that changes viewport-fit state while an animated 10 resize is underway, and that change causes the client to push a new 11 minimumLayoutSizeOverride, the new size will be lost forever, and we 12 will get stuck laying out at the wrong size. 13 14 This is because we unconditionally apply avoidsUnsafeArea for every commit, 15 while most other changes that come in from a commit are ignored if we're 16 inside animated resize. To fix, also ignore avoidsUnsafeArea changes during 17 animated resize, by moving the code that keeps track of it into WKWebView 18 like all of the rest, and read it out of the commit in didCommitLayerTree 19 *after* the animated-resize early-return. 20 21 Also, fix the associated layout tests by adding a missing assignment 22 in _computedContentInset, which was broken in r220138. 23 24 * UIProcess/API/Cocoa/WKWebView.mm: 25 (-[WKWebView _initializeWithConfiguration:]): 26 (-[WKWebView _setHasCustomContentView:loadedMIMEType:]): 27 (-[WKWebView _processDidExit]): 28 (-[WKWebView _didCommitLayerTree:]): 29 (-[WKWebView _setAvoidsUnsafeArea:]): 30 (-[WKWebView _safeAreaShouldAffectObscuredInsets]): 31 (-[WKWebView _didChangeAvoidsUnsafeArea:]): Deleted. 32 * UIProcess/API/Cocoa/WKWebViewInternal.h: 33 * UIProcess/PageClient.h: 34 * UIProcess/WebPageProxy.cpp: 35 (WebKit::WebPageProxy::resetState): 36 (WebKit::WebPageProxy::setAvoidsUnsafeArea): Deleted. 37 * UIProcess/WebPageProxy.h: 38 (WebKit::WebPageProxy::avoidsUnsafeArea const): Deleted. 39 * UIProcess/ios/PageClientImplIOS.h: 40 * UIProcess/ios/PageClientImplIOS.mm: 41 (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea): Deleted. 42 * UIProcess/ios/WebPageProxyIOS.mm: 43 (WebKit::WebPageProxy::didCommitLayerTree): 44 1 45 2017-08-04 Matt Lewis <jlewis3@apple.com> 2 46 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r220138 r220286 247 247 UIEdgeInsets _unobscuredSafeAreaInsets; 248 248 BOOL _haveSetUnobscuredSafeAreaInsets; 249 BOOL _avoidsUnsafeArea; 249 250 UIRectEdge _obscuredInsetEdgesAffectedBySafeArea; 250 251 … … 524 525 [_scrollView setBouncesZoom:YES]; 525 526 527 _avoidsUnsafeArea = YES; 526 528 [self _updateScrollViewInsetAdjustmentBehavior]; 527 529 … … 1269 1271 [_scrollView setContentOffset:[self _adjustedContentOffset:CGPointZero]]; 1270 1272 1271 [self _ didChangeAvoidsUnsafeArea:NO];1273 [self _setAvoidsUnsafeArea:NO]; 1272 1274 } else if (_customContentView) { 1273 1275 [_customContentView removeFromSuperview]; … … 1283 1285 [_customContentFixedOverlayView setFrame:self.bounds]; 1284 1286 [self addSubview:_customContentFixedOverlayView.get()]; 1285 1286 [self _didChangeAvoidsUnsafeArea:_page->avoidsUnsafeArea()];1287 1287 } 1288 1288 … … 1408 1408 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 1409 1409 if (self._safeAreaShouldAffectObscuredInsets) 1410 UIEdgeInsetsAdd(insets, [_scrollView _systemContentInset], self._effectiveObscuredInsetEdgesAffectedBySafeArea);1410 insets = UIEdgeInsetsAdd(insets, [_scrollView _systemContentInset], self._effectiveObscuredInsetEdgesAffectedBySafeArea); 1411 1411 #endif 1412 1412 … … 1462 1462 _firstTransactionIDAfterPageRestore = 0; 1463 1463 _resizeAnimationTransformTransactionID = std::nullopt; 1464 1465 _avoidsUnsafeArea = YES; 1464 1466 } 1465 1467 … … 1560 1562 1561 1563 [self _updateScrollViewBackground]; 1564 [self _setAvoidsUnsafeArea:layerTreeTransaction.avoidsUnsafeArea()]; 1562 1565 1563 1566 if (_gestureController) … … 2718 2721 } 2719 2722 2720 - (void)_didChangeAvoidsUnsafeArea:(BOOL)avoidsUnsafeArea 2721 { 2723 - (void)_setAvoidsUnsafeArea:(BOOL)avoidsUnsafeArea 2724 { 2725 if (_avoidsUnsafeArea == avoidsUnsafeArea) 2726 return; 2727 2728 _avoidsUnsafeArea = avoidsUnsafeArea; 2729 2722 2730 [self _updateScrollViewInsetAdjustmentBehavior]; 2723 2731 [self _scheduleVisibleContentRectUpdate]; … … 4673 4681 if (![self usesStandardContentView]) 4674 4682 return NO; 4675 if (!_page) 4676 return YES; 4677 return _page->avoidsUnsafeArea(); 4683 return _avoidsUnsafeArea; 4678 4684 } 4679 4685 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
r220138 r220286 120 120 - (void)_hidePasswordView; 121 121 122 - (void)_didChangeAvoidsUnsafeArea:(BOOL)avoidsUnsafeArea;123 124 122 - (void)_addShortcut:(id)sender; 125 123 - (void)_arrowKey:(id)sender; -
trunk/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h
r218740 r220286 147 147 WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override { return WebCore::UserInterfaceLayoutDirection::LTR; } 148 148 149 void didChangeAvoidsUnsafeArea(bool) override { }150 151 149 JSGlobalContextRef javascriptGlobalContext() override; 152 150 -
trunk/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h
r218740 r220286 118 118 WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override; 119 119 120 void didChangeAvoidsUnsafeArea(bool) override { }121 122 120 JSGlobalContextRef javascriptGlobalContext() override; 123 121 -
trunk/Source/WebKit/UIProcess/PageClient.h
r219340 r220286 385 385 #endif 386 386 387 virtual void didChangeAvoidsUnsafeArea(bool avoidsUnsafeArea) = 0;388 389 387 #if PLATFORM(GTK) || PLATFORM(WPE) 390 388 virtual JSGlobalContextRef javascriptGlobalContext() { return nullptr; } -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r220115 r220286 5515 5515 requestPointerUnlock(); 5516 5516 #endif 5517 5518 m_avoidsUnsafeArea = true;5519 5517 } 5520 5518 … … 6951 6949 } 6952 6950 6953 void WebPageProxy::setAvoidsUnsafeArea(bool avoidsUnsafeArea)6954 {6955 if (m_avoidsUnsafeArea == avoidsUnsafeArea)6956 return;6957 6958 m_avoidsUnsafeArea = avoidsUnsafeArea;6959 6960 m_pageClient.didChangeAvoidsUnsafeArea(avoidsUnsafeArea);6961 }6962 6963 6951 } // namespace WebKit -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r220011 r220286 1202 1202 #endif 1203 1203 1204 void setAvoidsUnsafeArea(bool);1205 bool avoidsUnsafeArea() const { return m_avoidsUnsafeArea; }1206 1207 1204 private: 1208 1205 WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&); … … 2001 1998 bool m_isUsingHighPerformanceWebGL { false }; 2002 1999 2003 bool m_avoidsUnsafeArea { true };2004 2005 2000 WeakPtrFactory<WebPageProxy> m_weakPtrFactory; 2006 2001 -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h
r219340 r220286 200 200 void handleActiveNowPlayingSessionInfoResponse(bool hasActiveSession, const String& title, double duration, double elapsedTime) override; 201 201 202 void didChangeAvoidsUnsafeArea(bool avoidsUnsafeArea) override;203 204 202 #if USE(QUICK_LOOK) 205 203 void requestPasswordForQuickLookDocument(const String& fileName, WTF::Function<void(const String&)>&&) override; -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
r219340 r220286 827 827 #endif 828 828 829 void PageClientImpl::didChangeAvoidsUnsafeArea(bool avoidsUnsafeArea)830 {831 [m_webView _didChangeAvoidsUnsafeArea:avoidsUnsafeArea];832 }833 834 829 } // namespace WebKit 835 830 -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r219996 r220286 373 373 { 374 374 m_pageExtendedBackgroundColor = layerTreeTransaction.pageExtendedBackgroundColor(); 375 setAvoidsUnsafeArea(layerTreeTransaction.avoidsUnsafeArea());376 375 377 376 if (!m_hasReceivedLayerTreeTransactionAfterDidCommitLoad) { -
trunk/Source/WebKit/UIProcess/mac/PageClientImpl.h
r217566 r220286 254 254 void didRestoreScrollPosition() override; 255 255 bool windowIsFrontWindowUnderMouse(const NativeWebMouseEvent&) override; 256 257 void didChangeAvoidsUnsafeArea(bool avoidsUnsafeArea) override { }258 256 }; 259 257
Note:
See TracChangeset
for help on using the changeset viewer.