Changeset 220788 in webkit
- Timestamp:
- Aug 16, 2017, 12:49:32 AM (9 years ago)
- Location:
- branches/safari-604-branch/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
-
branches/safari-604-branch/Source/WebKit/ChangeLog
r220635 r220788 1 2017-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 1 49 2017-08-13 Jason Marcell <jmarcell@apple.com> 2 50 -
branches/safari-604-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r220230 r220788 248 248 UIEdgeInsets _unobscuredSafeAreaInsets; 249 249 BOOL _haveSetUnobscuredSafeAreaInsets; 250 BOOL _avoidsUnsafeArea; 250 251 UIRectEdge _obscuredInsetEdgesAffectedBySafeArea; 251 252 … … 525 526 [_scrollView setBouncesZoom:YES]; 526 527 528 _avoidsUnsafeArea = YES; 527 529 [self _updateScrollViewInsetAdjustmentBehavior]; 528 530 … … 1270 1272 [_scrollView setContentOffset:[self _adjustedContentOffset:CGPointZero]]; 1271 1273 1272 [self _ didChangeAvoidsUnsafeArea:NO];1274 [self _setAvoidsUnsafeArea:NO]; 1273 1275 } else if (_customContentView) { 1274 1276 [_customContentView removeFromSuperview]; … … 1284 1286 [_customContentFixedOverlayView setFrame:self.bounds]; 1285 1287 [self addSubview:_customContentFixedOverlayView.get()]; 1286 1287 [self _didChangeAvoidsUnsafeArea:_page->avoidsUnsafeArea()];1288 1288 } 1289 1289 … … 1409 1409 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 1410 1410 if (self._safeAreaShouldAffectObscuredInsets) 1411 UIEdgeInsetsAdd(insets, [_scrollView _systemContentInset], self._effectiveObscuredInsetEdgesAffectedBySafeArea);1411 insets = UIEdgeInsetsAdd(insets, [_scrollView _systemContentInset], self._effectiveObscuredInsetEdgesAffectedBySafeArea); 1412 1412 #endif 1413 1413 … … 1463 1463 _firstTransactionIDAfterPageRestore = 0; 1464 1464 _resizeAnimationTransformTransactionID = std::nullopt; 1465 1466 _avoidsUnsafeArea = YES; 1465 1467 } 1466 1468 … … 1561 1563 1562 1564 [self _updateScrollViewBackground]; 1565 [self _setAvoidsUnsafeArea:layerTreeTransaction.avoidsUnsafeArea()]; 1563 1566 1564 1567 if (_gestureController) … … 2719 2722 } 2720 2723 2721 - (void)_didChangeAvoidsUnsafeArea:(BOOL)avoidsUnsafeArea 2722 { 2724 - (void)_setAvoidsUnsafeArea:(BOOL)avoidsUnsafeArea 2725 { 2726 if (_avoidsUnsafeArea == avoidsUnsafeArea) 2727 return; 2728 2729 _avoidsUnsafeArea = avoidsUnsafeArea; 2730 2723 2731 [self _updateScrollViewInsetAdjustmentBehavior]; 2724 2732 [self _scheduleVisibleContentRectUpdate]; … … 4674 4682 if (![self usesStandardContentView]) 4675 4683 return NO; 4676 if (!_page) 4677 return YES; 4678 return _page->avoidsUnsafeArea(); 4684 return _avoidsUnsafeArea; 4679 4685 } 4680 4686 -
branches/safari-604-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
r220230 r220788 120 120 - (void)_hidePasswordView; 121 121 122 - (void)_didChangeAvoidsUnsafeArea:(BOOL)avoidsUnsafeArea;123 124 122 - (void)_addShortcut:(id)sender; 125 123 - (void)_arrowKey:(id)sender; -
branches/safari-604-branch/Source/WebKit/UIProcess/API/gtk/PageClientImpl.h
r218740 r220788 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 -
branches/safari-604-branch/Source/WebKit/UIProcess/API/wpe/PageClientImpl.h
r218740 r220788 118 118 WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection() override; 119 119 120 void didChangeAvoidsUnsafeArea(bool) override { }121 122 120 JSGlobalContextRef javascriptGlobalContext() override; 123 121 -
branches/safari-604-branch/Source/WebKit/UIProcess/PageClient.h
r219340 r220788 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; } -
branches/safari-604-branch/Source/WebKit/UIProcess/WebPageProxy.cpp
r220062 r220788 5499 5499 requestPointerUnlock(); 5500 5500 #endif 5501 5502 m_avoidsUnsafeArea = true;5503 5501 } 5504 5502 … … 6935 6933 } 6936 6934 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 6947 6935 } // namespace WebKit -
branches/safari-604-branch/Source/WebKit/UIProcess/WebPageProxy.h
r220062 r220788 1201 1201 #endif 1202 1202 1203 void setAvoidsUnsafeArea(bool);1204 bool avoidsUnsafeArea() const { return m_avoidsUnsafeArea; }1205 1206 1203 private: 1207 1204 WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, Ref<API::PageConfiguration>&&); … … 2000 1997 bool m_isUsingHighPerformanceWebGL { false }; 2001 1998 2002 bool m_avoidsUnsafeArea { true };2003 2004 1999 WeakPtrFactory<WebPageProxy> m_weakPtrFactory; 2005 2000 -
branches/safari-604-branch/Source/WebKit/UIProcess/ios/PageClientImplIOS.h
r219340 r220788 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; -
branches/safari-604-branch/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
r219340 r220788 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 -
branches/safari-604-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r219934 r220788 373 373 { 374 374 m_pageExtendedBackgroundColor = layerTreeTransaction.pageExtendedBackgroundColor(); 375 setAvoidsUnsafeArea(layerTreeTransaction.avoidsUnsafeArea());376 375 377 376 if (!m_hasReceivedLayerTreeTransactionAfterDidCommitLoad) { -
branches/safari-604-branch/Source/WebKit/UIProcess/mac/PageClientImpl.h
r217566 r220788 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.