Changeset 251907 in webkit
- Timestamp:
- Oct 31, 2019 9:07:37 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r251897 r251907 1 2019-10-31 Chris Dumez <cdumez@apple.com> 2 3 Take down the gesture snapshot early when the back/forward cache is not leveraged 4 https://bugs.webkit.org/show_bug.cgi?id=203713 5 <rdar://problem/56803910> 6 7 Reviewed by Tim Horton. 8 9 Take down the gesture snapshot as soon as the gesture is done when the back/forward cache 10 is not leveraged. Otherwise, the snapshot may stay up for a long time (while we load, parse 11 and restore scroll position) and it would look to the user as if the view was unresponsive. 12 Showing the page slowly loading in such cases is less confusing as the user knows what's 13 going on and is even able to interact with the partially loaded page. 14 15 * Shared/WebBackForwardListItem.cpp: 16 (WebKit::WebBackForwardListItem::hasCachedWebPage const): 17 * Shared/WebBackForwardListItem.h: 18 * UIProcess/ViewGestureController.cpp: 19 (WebKit::ViewGestureController::endSwipeGesture): 20 * UIProcess/ViewGestureController.h: 21 * UIProcess/ios/ViewGestureControllerIOS.mm: 22 (WebKit::ViewGestureController::makeSnapshotBlank): 23 (WebKit::ViewGestureController::endSwipeGesture): 24 * UIProcess/mac/ViewGestureControllerMac.mm: 25 (WebKit::ViewGestureController::makeSnapshotBlank): 26 1 27 2019-10-31 Per Arne Vollan <pvollan@apple.com> 2 28 -
trunk/Source/WebKit/Shared/WebBackForwardListItem.cpp
r251121 r251907 183 183 } 184 184 185 bool WebBackForwardListItem::hasCachedWebPage() const 186 { 187 if (!m_backForwardCacheEntry) 188 return false; 189 if (!m_backForwardCacheEntry->suspendedPage()) 190 return true; // In-process cached page without suspended page proxy. 191 // Make sure the suspended page proxy has an associated WebPage. 192 return !m_backForwardCacheEntry->suspendedPage()->pageIsClosedOrClosing(); 193 } 194 185 195 #if !LOG_DISABLED 186 196 const char* WebBackForwardListItem::loggingString() -
trunk/Source/WebKit/Shared/WebBackForwardListItem.h
r251121 r251907 83 83 void wasRemovedFromBackForwardList(); 84 84 85 bool hasCachedWebPage() const; 85 86 WebBackForwardCacheEntry* backForwardCacheEntry() const { return m_backForwardCacheEntry.get(); } 86 87 SuspendedPageProxy* suspendedPage() const; -
trunk/Source/WebKit/UIProcess/ViewGestureController.cpp
r251220 r251907 591 591 } 592 592 593 SnapshotRemovalTracker::Events desiredEvents = SnapshotRemovalTracker::VisuallyNonEmptyLayout 593 SnapshotRemovalTracker::Events desiredEvents; 594 if (targetItem->hasCachedWebPage()) { 595 desiredEvents = SnapshotRemovalTracker::VisuallyNonEmptyLayout 594 596 | SnapshotRemovalTracker::MainFrameLoad 595 597 | SnapshotRemovalTracker::SubresourceLoads 596 598 | SnapshotRemovalTracker::ScrollPositionRestoration; 599 } else { 600 desiredEvents = SnapshotRemovalTracker::VisuallyNonEmptyLayout; 601 makeSnapshotBlank(); 602 } 597 603 598 604 if (renderTreeSizeThreshold) { -
trunk/Source/WebKit/UIProcess/ViewGestureController.h
r250820 r251907 311 311 #endif 312 312 313 void makeSnapshotBlank(); 314 313 315 WebPageProxy& m_webPageProxy; 314 316 ViewGestureType m_activeGestureType { ViewGestureType::None }; -
trunk/Source/WebKit/UIProcess/gtk/ViewGestureControllerGtk.cpp
r250820 r251907 571 571 } 572 572 573 void ViewGestureController::makeSnapshotBlank() 574 { 575 } 576 573 577 } // namespace WebKit -
trunk/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm
r251382 r251907 268 268 } 269 269 270 void ViewGestureController::makeSnapshotBlank() 271 { 272 [m_snapshotView layer].contents = nil; 273 } 274 270 275 void ViewGestureController::endSwipeGesture(WebBackForwardListItem* targetItem, _UIViewControllerTransitionContext *context, bool cancelled) 271 276 { … … 313 318 } 314 319 320 SnapshotRemovalTracker::Events desiredEvents; 321 if (targetItem->hasCachedWebPage()) { 322 desiredEvents = SnapshotRemovalTracker::RenderTreeSizeThreshold 323 | SnapshotRemovalTracker::RepaintAfterNavigation 324 | SnapshotRemovalTracker::MainFrameLoad 325 | SnapshotRemovalTracker::SubresourceLoads 326 | SnapshotRemovalTracker::ScrollPositionRestoration; 327 } else { 328 desiredEvents = SnapshotRemovalTracker::VisuallyNonEmptyLayout; 329 makeSnapshotBlank(); 330 } 331 315 332 // FIXME: Should we wait for VisuallyNonEmptyLayout like we do on Mac? 316 m_snapshotRemovalTracker.start(SnapshotRemovalTracker::RenderTreeSizeThreshold 317 | SnapshotRemovalTracker::RepaintAfterNavigation 318 | SnapshotRemovalTracker::MainFrameLoad 319 | SnapshotRemovalTracker::SubresourceLoads 320 | SnapshotRemovalTracker::ScrollPositionRestoration, [this] { 333 m_snapshotRemovalTracker.start(desiredEvents, [this] { 321 334 this->removeSwipeSnapshot(); 322 335 }); -
trunk/Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm
r249275 r251907 172 172 if (event.phase == NSEventPhaseEnded || event.phase == NSEventPhaseCancelled) 173 173 endMagnificationGesture(); 174 } 175 176 void ViewGestureController::makeSnapshotBlank() 177 { 178 [m_swipeSnapshotLayer setContents:nil]; 174 179 } 175 180
Note: See TracChangeset
for help on using the changeset viewer.