Changeset 238818 in webkit


Ignore:
Timestamp:
Dec 3, 2018 1:41:29 PM (5 years ago)
Author:
timothy_horton@apple.com
Message:

Swipe snapshot stays up too long swiping around on apple.com (waiting for first paint)
https://bugs.webkit.org/show_bug.cgi?id=192319
<rdar://problem/45928708>

Reviewed by Simon Fraser.

  • UIProcess/Cocoa/ViewGestureController.cpp:

(WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):

  • UIProcess/Cocoa/ViewGestureController.h:
  • UIProcess/ios/ViewGestureControllerIOS.mm:

(WebKit::ViewGestureController::endSwipeGesture):
In r236966, I reverted slightly too much of r232416.
We still need to defer requesting a presentation update callback until
after the provisional load starts. Otherwise, we could get the callback
while we're in the 'paused' state, and drop it on the floor. That would
then mean that we time out instead of promptly removing the snapshot.

Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r238817 r238818  
     12018-12-03  Tim Horton  <timothy_horton@apple.com>
     2
     3        Swipe snapshot stays up too long swiping around on apple.com (waiting for first paint)
     4        https://bugs.webkit.org/show_bug.cgi?id=192319
     5        <rdar://problem/45928708>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * UIProcess/Cocoa/ViewGestureController.cpp:
     10        (WebKit::ViewGestureController::didStartProvisionalLoadForMainFrame):
     11        * UIProcess/Cocoa/ViewGestureController.h:
     12        * UIProcess/ios/ViewGestureControllerIOS.mm:
     13        (WebKit::ViewGestureController::endSwipeGesture):
     14        In r236966, I reverted slightly too much of r232416.
     15        We still need to defer requesting a presentation update callback until
     16        after the provisional load starts. Otherwise, we could get the callback
     17        while we're in the 'paused' state, and drop it on the floor. That would
     18        then mean that we time out instead of promptly removing the snapshot.
     19
    1202018-12-03  Alex Christensen  <achristensen@webkit.org>
    221
  • trunk/Source/WebKit/UIProcess/Cocoa/ViewGestureController.cpp

    r238810 r238818  
    149149{
    150150    m_snapshotRemovalTracker.resume();
     151
     152    if (auto provisionalLoadCallback = WTFMove(m_provisionalLoadCallback))
     153        provisionalLoadCallback();
    151154}
    152155
  • trunk/Source/WebKit/UIProcess/Cocoa/ViewGestureController.h

    r238356 r238818  
    313313
    314314    SnapshotRemovalTracker m_snapshotRemovalTracker;
     315    WTF::Function<void()> m_provisionalLoadCallback;
    315316};
    316317
  • trunk/Source/WebKit/UIProcess/ios/ViewGestureControllerIOS.mm

    r237266 r238818  
    301301    }
    302302
    303     if (auto drawingArea = m_webPageProxy.drawingArea()) {
    304         uint64_t pageID = m_webPageProxy.pageID();
    305         GestureID gestureID = m_currentGestureID;
    306         drawingArea->dispatchAfterEnsuringDrawing([pageID, gestureID] (CallbackBase::Error error) {
    307             if (auto gestureController = controllerForGesture(pageID, gestureID))
    308                 gestureController->willCommitPostSwipeTransitionLayerTree(error == CallbackBase::Error::None);
    309         });
    310         drawingArea->hideContentUntilPendingUpdate();
    311     } else {
    312         removeSwipeSnapshot();
    313         return;
    314     }
    315 
    316303    // FIXME: Should we wait for VisuallyNonEmptyLayout like we do on Mac?
    317304    m_snapshotRemovalTracker.start(SnapshotRemovalTracker::RenderTreeSizeThreshold
     
    327314        m_webPageProxy.didChangeBackgroundColor();
    328315    }
     316
     317    uint64_t pageID = m_webPageProxy.pageID();
     318    GestureID gestureID = m_currentGestureID;
     319    m_provisionalLoadCallback = [this, pageID, gestureID] {
     320        auto drawingArea = m_webPageProxy.drawingArea();
     321        if (!drawingArea) {
     322            removeSwipeSnapshot();
     323            return;
     324        }
     325
     326        drawingArea->dispatchAfterEnsuringDrawing([pageID, gestureID] (CallbackBase::Error error) {
     327            if (auto gestureController = controllerForGesture(pageID, gestureID))
     328                gestureController->willCommitPostSwipeTransitionLayerTree(error == CallbackBase::Error::None);
     329        });
     330        drawingArea->hideContentUntilPendingUpdate();
     331    };
    329332}
    330333
Note: See TracChangeset for help on using the changeset viewer.