Changeset 254552 in webkit
- Timestamp:
- Jan 14, 2020, 6:03:37 PM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 5 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/ViewGestureController.cpp (modified) (2 diffs)
-
UIProcess/ViewGestureController.h (modified) (1 diff)
-
UIProcess/ios/ViewGestureControllerIOS.mm (modified) (4 diffs)
-
UIProcess/mac/ViewGestureControllerMac.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r254550 r254552 1 2020-01-14 Tim Horton <timothy_horton@apple.com> 2 3 REGRESSION (r253394): After swiping back during a navigation, WKWebView gets stuck with the forward content, stops repainting 4 https://bugs.webkit.org/show_bug.cgi?id=206268 5 <rdar://problem/58536702> 6 7 Reviewed by Simon Fraser. 8 9 * UIProcess/ViewGestureController.cpp: 10 (WebKit::ViewGestureController::endSwipeGesture): 11 * UIProcess/ViewGestureController.h: 12 * UIProcess/ios/ViewGestureControllerIOS.mm: 13 (WebKit::ViewGestureController::beginSwipeGesture): 14 (WebKit::ViewGestureController::endSwipeGesture): 15 (WebKit::ViewGestureController::removeSwipeSnapshot): 16 * UIProcess/mac/ViewGestureControllerMac.mm: 17 (WebKit::ViewGestureController::beginSwipeGesture): 18 (WebKit::ViewGestureController::removeSwipeSnapshot): 19 After r253394, we start loading the destination page in willEndSwipeGesture, 20 when we know the gesture will complete, instead of in endSwipeGesture, 21 when it is actually done. 22 23 This means that if we decide that we should tear down the snapshot immediately, 24 this can now happen in the window between willEndSwipeGesture and endSwipeGesture. 25 26 However, removeSwipeSnapshot has numerous dependencies on endSwipeGesture 27 (especially on iOS, where there are /also/ dependencies in the other direction - 28 endSwipeGesture will never be called after removeSwipeSnapshot because 29 of the gestureID mismatch). 30 31 Regardless, it does not make sense to remove the snapshot while the animation 32 is still running. So, if something causes removeSwipeSnapshot to be called 33 before endSwipeGesture, we just set a bit and call it inside endSwipeGesture instead. 34 35 This ends up putting the snapshot removal ordering back as it was before r253394. 36 1 37 2020-01-14 Per Arne Vollan <pvollan@apple.com> 2 38 -
trunk/Source/WebKit/UIProcess/ViewGestureController.cpp
r254514 r254552 606 606 #endif 607 607 608 m_didCallEndSwipeGesture = true; 609 608 610 if (cancelled) { 609 611 removeSwipeSnapshot(); … … 615 617 616 618 m_snapshotRemovalTracker.eventOccurred(SnapshotRemovalTracker::SwipeAnimationEnd, SnapshotRemovalTracker::ShouldIgnoreEventIfPaused::No); 619 620 // removeSwipeSnapshot() was called between willEndSwipeGesture() and endSwipeGesture(). 621 // We couldn't remove it then, because the animation was still running, but now we can! 622 if (m_removeSnapshotImmediatelyWhenGestureEnds) { 623 removeSwipeSnapshot(); 624 return; 625 } 617 626 } 618 627 -
trunk/Source/WebKit/UIProcess/ViewGestureController.h
r253514 r254552 436 436 bool m_didStartProvisionalLoad { false }; 437 437 438 bool m_didCallEndSwipeGesture { false }; 439 bool m_removeSnapshotImmediatelyWhenGestureEnds { false }; 440 438 441 SnapshotRemovalTracker m_snapshotRemovalTracker; 439 442 WTF::Function<void()> m_loadCallback; -
trunk/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm
r253450 r254552 259 259 [m_swipeTransitionContext _setTransitionIsInFlight:YES]; 260 260 m_didCallWillEndSwipeGesture = false; 261 m_didCallEndSwipeGesture = false; 262 m_removeSnapshotImmediatelyWhenGestureEnds = false; 261 263 [m_swipeTransitionContext _setInteractiveUpdateHandler:^(BOOL finish, CGFloat percent, BOOL transitionCompleted, _UIViewControllerTransitionContext *) { 262 264 if (finish) … … 317 319 willEndSwipeGesture(*targetItem, cancelled); 318 320 321 m_didCallEndSwipeGesture = true; 322 319 323 [context _setTransitionIsInFlight:NO]; 320 324 [context _setInteractor:nil]; … … 347 351 } 348 352 353 // removeSwipeSnapshot() was called between willEndSwipeGesture() and endSwipeGesture(). 354 // We couldn't remove it then, because the animation was still running, but now we can! 355 if (m_removeSnapshotImmediatelyWhenGestureEnds) { 356 removeSwipeSnapshot(); 357 return; 358 } 359 349 360 auto pageID = m_webPageProxy.identifier(); 350 361 GestureID gestureID = m_currentGestureID; … … 399 410 return; 400 411 412 if (!m_didCallEndSwipeGesture) { 413 m_removeSnapshotImmediatelyWhenGestureEnds = true; 414 return; 415 } 416 401 417 [m_snapshotView removeFromSuperview]; 402 418 m_snapshotView = nullptr; -
trunk/Source/WebKit/UIProcess/mac/ViewGestureControllerMac.mm
r252155 r254552 467 467 if (m_webPageProxy.preferences().viewGestureDebuggingEnabled()) 468 468 applyDebuggingPropertiesToSwipeViews(); 469 470 m_didCallEndSwipeGesture = false; 471 m_removeSnapshotImmediatelyWhenGestureEnds = false; 469 472 470 473 CALayer *layerAdjacentToSnapshot = determineLayerAdjacentToSnapshotForParent(direction, snapshotLayerParent); … … 600 603 return; 601 604 605 if (!m_didCallEndSwipeGesture) { 606 m_removeSnapshotImmediatelyWhenGestureEnds = true; 607 return; 608 } 609 602 610 if (m_currentSwipeSnapshot) 603 611 m_currentSwipeSnapshot->setVolatile(true);
Note:
See TracChangeset
for help on using the changeset viewer.