Changeset 219293 in webkit
- Timestamp:
- Jul 10, 2017 9:17:00 AM (7 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r219290 r219293 1 2017-07-10 Myles C. Maxfield <mmaxfield@apple.com> 2 3 REGRESSION(r213590): UI process updates the visible content rects more often than it did in iOS 10 4 https://bugs.webkit.org/show_bug.cgi?id=174282 5 <rdar://problem/33144344> 6 7 Reviewed by Simon Fraser. 8 9 In r213590, we accidentally refactored -[WKWebView _didCommitLayerTree:] to call _scheduleVisibleContentRectUpdate 10 more often. Instead, this should be triggered from inside the "if" statements. 11 12 No tests because there is no behavior change. Performance change is tested in MotionMark. 13 14 * UIProcess/API/Cocoa/WKWebView.mm: 15 (-[WKWebView _isShowingVideoPictureInPicture]): 16 (-[WKWebView _initializeWithConfiguration:]): 17 (-[WKWebView goBack]): 18 (-[WKWebView _didCommitLayerTree:]): 19 (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): 20 (-[WKWebView _zoomToRect:withOrigin:fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]): 21 (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): 22 (-[WKWebView scrollViewDidScroll:]): 23 (-[WKWebView _visibleContentRect]): 24 (-[WKWebView _frameOrBoundsChanged]): 25 (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]): 26 (-[WKWebView _updateVisibleContentRects]): 27 (-[WKWebView _navigationGestureDidBegin]): 28 (-[WKWebView _reloadWithoutContentBlockers]): 29 (-[WKWebView _reloadExpiredOnly]): 30 (-[WKWebView _setObscuredInsets:]): 31 (-[WKWebView _setUnobscuredSafeAreaInsets:]): 32 (-[WKWebView _endAnimatedResize]): 33 (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): 34 (-[WKWebView _clearOverrideLayoutParameters]): 35 (-[WKWebView _requestActivatedElementAtPosition:completionBlock:]): 36 (-[WKWebView _propertiesOfLayerWithID:]): 37 1 38 2017-07-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 39 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r219271 r219293 252 252 UIInterfaceOrientation _interfaceOrientationOverride; 253 253 BOOL _overridesInterfaceOrientation; 254 254 255 255 BOOL _allowsViewportShrinkToFit; 256 256 … … 293 293 BOOL _delayUpdateVisibleContentRects; 294 294 BOOL _hadDelayedUpdateVisibleContentRects; 295 295 296 296 int _activeAnimatedResizeCount; 297 297 … … 349 349 if (!_page || !_page->videoFullscreenManager()) 350 350 return false; 351 351 352 352 return _page->videoFullscreenManager()->hasMode(WebCore::HTMLMediaElementEnums::VideoFullscreenModePictureInPicture); 353 353 #endif … … 428 428 WebKit::WebProcessPool& processPool = *[_configuration processPool]->_processPool; 429 429 processPool.setResourceLoadStatisticsEnabled(configuration.websiteDataStore._resourceLoadStatisticsEnabled); 430 430 431 431 auto pageConfiguration = API::PageConfiguration::create(); 432 432 … … 521 521 522 522 [self _updateScrollViewInsetAdjustmentBehavior]; 523 523 524 524 [self addSubview:_scrollView.get()]; 525 525 … … 840 840 if (!navigation) 841 841 return nil; 842 842 843 843 return [wrapper(*navigation.leakRef()) autorelease]; 844 844 } … … 1487 1487 LOG_WITH_STREAM(VisibleRects, stream << "-[WKWebView _didCommitLayerTree:] transactionID " << layerTreeTransaction.transactionID() << " _dynamicViewportUpdateMode " << (int)_dynamicViewportUpdateMode); 1488 1488 1489 BOOL needUpdateVisbleContentRects = _page->updateLayoutViewportParameters(layerTreeTransaction);1489 bool needUpdateVisibleContentRects = _page->updateLayoutViewportParameters(layerTreeTransaction); 1490 1490 1491 1491 if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing) { … … 1539 1539 _navigationState->didFirstPaint(); 1540 1540 1541 needUpdateVis bleContentRects = YES;1541 needUpdateVisibleContentRects = true; 1542 1542 } 1543 1543 1544 1544 if (layerTreeTransaction.transactionID() >= _firstTransactionIDAfterPageRestore) { 1545 bool shouldRestoreScrollPosition = false; 1545 1546 if (_scrollOffsetToRestore) { 1546 1547 WebCore::FloatPoint scaledScrollOffset = _scrollOffsetToRestore.value(); … … 1553 1554 changeContentOffsetBoundedInValidRange(_scrollView.get(), contentOffsetInScrollViewCoordinates); 1554 1555 _commitDidRestoreScrollPosition = YES; 1556 1557 shouldRestoreScrollPosition = true; 1555 1558 } 1559 1560 needUpdateVisibleContentRects = true; 1556 1561 } 1557 1562 … … 1569 1574 1570 1575 changeContentOffsetBoundedInValidRange(_scrollView.get(), topLeftInDocumentCoordinates); 1576 1577 shouldRestoreScrollPosition = true; 1571 1578 } 1579 1580 needUpdateVisibleContentRects = true; 1572 1581 } 1573 1582 1574 needUpdateVisbleContentRects = YES; 1575 1576 if (_gestureController) 1583 if (shouldRestoreScrollPosition && _gestureController) 1577 1584 _gestureController->didRestoreScrollPosition(); 1578 1585 } 1579 1586 1580 if (needUpdateVis bleContentRects)1587 if (needUpdateVisibleContentRects) 1581 1588 [self _scheduleVisibleContentRectUpdate]; 1582 1589 … … 1645 1652 _firstTransactionIDAfterPageRestore = downcast<WebKit::RemoteLayerTreeDrawingAreaProxy>(*_page->drawingArea()).nextLayerTreeTransactionID(); 1646 1653 _unobscuredCenterToRestore = center.value(); 1647 1654 1648 1655 _scaleToRestore = scale; 1649 1656 } … … 1992 1999 return true; 1993 2000 } 1994 2001 1995 2002 return false; 1996 2003 } … … 2121 2128 // FIXME: Here, I'm finding the maximum horizontal/vertical scroll offsets. There's probably a better way to do this. 2122 2129 CGSize maxScrollOffsets = CGSizeMake(scrollView.contentSize.width - scrollView.bounds.size.width, scrollView.contentSize.height - scrollView.bounds.size.height); 2123 2130 2124 2131 CGRect fullViewRect = self.bounds; 2125 2132 … … 2133 2140 2134 2141 CGRect unobscuredRect = UIEdgeInsetsInsetRect(fullViewRect, contentInset); 2135 2142 2136 2143 coordinator->adjustTargetContentOffsetForSnapping(maxScrollOffsets, velocity, unobscuredRect.origin.y, targetContentOffset); 2137 2144 } … … 2162 2169 2163 2170 [self _scheduleVisibleContentRectUpdateAfterScrollInView:scrollView]; 2164 2171 2165 2172 if (WebKit::RemoteLayerTreeScrollingPerformanceData* scrollPerfData = _page->scrollingPerformanceData()) 2166 2173 scrollPerfData->didScroll([self visibleRectInViewCoordinates]); … … 2214 2221 2215 2222 CGRect visibleRectInContentCoordinates = [self convertRect:self.bounds toView:_contentView.get()]; 2216 2223 2217 2224 if (UIView *enclosingView = [self _enclosingViewForExposedRectComputation]) { 2218 2225 CGRect viewVisibleRect = [self _visibleRectInEnclosingView:enclosingView]; … … 2273 2280 if (!_overridesMaximumUnobscuredSize) 2274 2281 _page->setMaximumUnobscuredSize(WebCore::FloatSize(bounds.size)); 2275 2282 2276 2283 BOOL sizeChanged = NO; 2277 2284 if (auto drawingArea = _page->drawingArea()) 2278 2285 sizeChanged = drawingArea->setSize(WebCore::IntSize(bounds.size), WebCore::IntSize(), WebCore::IntSize()); 2279 2286 2280 2287 if (sizeChanged & [self usesStandardContentView]) 2281 2288 [_contentView setSizeChangedSinceLastVisibleContentRectUpdate:YES]; … … 2360 2367 2361 2368 _hasScheduledVisibleRectUpdate = YES; 2362 2369 2363 2370 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000 2364 2371 CATransactionPhase transactionPhase = [CATransaction currentPhase]; … … 2454 2461 if (coordinator && coordinator->hasActiveSnapPoint()) { 2455 2462 CGRect unobscuredRect = UIEdgeInsetsInsetRect(fullViewRect, computedContentInsetUnadjustedForKeyboard); 2456 2463 2457 2464 CGPoint currentPoint = [_scrollView contentOffset]; 2458 2465 CGPoint activePoint = coordinator->nearestActiveContentInsetAdjustedSnapPoint(unobscuredRect.origin.y, currentPoint); … … 2638 2645 _frozenVisibleContentRect = [self convertRect:fullViewRect toView:_contentView.get()]; 2639 2646 _frozenUnobscuredContentRect = [self convertRect:unobscuredRect toView:_contentView.get()]; 2640 2647 2641 2648 LOG_WITH_STREAM(VisibleRects, stream << "_navigationGestureDidBegin: freezing visibleContentRect " << _frozenVisibleContentRect.value() << " UnobscuredContentRect " << _frozenUnobscuredContentRect.value()); 2642 2649 } … … 3803 3810 if (!navigation) 3804 3811 return nil; 3805 3812 3806 3813 return [wrapper(*navigation.leakRef()) autorelease]; 3807 3814 } … … 3812 3819 if (!navigation) 3813 3820 return nil; 3814 3821 3815 3822 return [wrapper(*navigation.leakRef()) autorelease]; 3816 3823 } … … 4590 4597 ASSERT(obscuredInsets.bottom >= 0); 4591 4598 ASSERT(obscuredInsets.right >= 0); 4592 4599 4593 4600 _haveSetObscuredInsets = YES; 4594 4601 … … 4627 4634 ASSERT(unobscuredSafeAreaInsets.bottom >= 0); 4628 4635 ASSERT(unobscuredSafeAreaInsets.right >= 0); 4629 4636 4630 4637 _haveSetUnobscuredSafeAreaInsets = YES; 4631 4638 … … 4849 4856 return; 4850 4857 } 4851 4858 4852 4859 --_activeAnimatedResizeCount; 4853 4860 NSUInteger indexOfResizeAnimationView = [[_scrollView subviews] indexOfObject:_resizeAnimationView.get()]; … … 4943 4950 } 4944 4951 #endif 4945 4952 4946 4953 if (_customContentView) { 4947 4954 UIGraphicsBeginImageContextWithOptions(imageSize, YES, 1); … … 5001 5008 _overridesMinimumLayoutSize = NO; 5002 5009 _minimumLayoutSizeOverride = CGSizeZero; 5003 5010 5004 5011 _overridesMaximumUnobscuredSize = NO; 5005 5012 _maximumUnobscuredSizeOverride = CGSizeZero; … … 5276 5283 auto infoRequest = WebKit::InteractionInformationRequest(WebCore::roundedIntPoint(position)); 5277 5284 infoRequest.includeSnapshot = true; 5278 5285 5279 5286 [_contentView doAfterPositionInformationUpdate:[capturedBlock = makeBlockPtr(block)] (WebKit::InteractionInformationAtPosition information) { 5280 5287 capturedBlock([_WKActivatedElementInfo activatedElementInfoWithInteractionInformationAtPosition:information]); … … 5474 5481 @"m44" : @(layer.sublayerTransform.m44), 5475 5482 }, 5476 5483 5477 5484 @"hidden" : @(layer.hidden), 5478 5485 @"doubleSided" : @(layer.doubleSided),
Note: See TracChangeset
for help on using the changeset viewer.