Changeset 216145 in webkit


Ignore:
Timestamp:
May 3, 2017 3:04:18 PM (7 years ago)
Author:
Simon Fraser
Message:

Have WKWebView call _updateVisibleContentRects for the current transaction if possible, rather than always delaying
https://bugs.webkit.org/show_bug.cgi?id=171619
Source/WebKit2:

Also fixes webkit.org/b/170153 and webkit.org/b/170195

Reviewed by Tim Horton.

In r214391 we started adding the pre-commit handler in a dispatch_async() to ensure that
the handler would always run, since we couldn't reliably test the phase of the current
transaction. Now that problem has been solved (rdar://problem/31253952) we can go back to
checking the transaction phase on newer iOS versions. If we're too late for the current transaction
we still need to dispatch_async() to get into the next one.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
(-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):

Tools:

https://bugs.webkit.org/show_bug.cgi?id=170195

Reviewed by Tim Horton.

Re-enable WebKit2.ResizeWithHiddenContentDoesNotHang.

  • TestWebKitAPI/Tests/WebKit2Cocoa/AnimatedResize.mm:

(TEST):

LayoutTests:

https://bugs.webkit.org/show_bug.cgi?id=170153

Reviewed by Tim Horton.

These tests need to wait a bit for the scrolling state of the document to be updated.

  • fast/scrolling/ios/touch-scroll-pointer-events-none.html:
  • fast/scrolling/ios/touch-scroll-visibility-hidden.html:
  • platform/ios-wk2/TestExpectations:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r216143 r216145  
     12017-05-03  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Have WKWebView call _updateVisibleContentRects for the current transaction if possible, rather than always delaying
     4        https://bugs.webkit.org/show_bug.cgi?id=171619
     5        https://bugs.webkit.org/show_bug.cgi?id=170153
     6
     7        Reviewed by Tim Horton.
     8
     9        These tests need to wait a bit for the scrolling state of the document to be updated.
     10
     11        * fast/scrolling/ios/touch-scroll-pointer-events-none.html:
     12        * fast/scrolling/ios/touch-scroll-visibility-hidden.html:
     13        * platform/ios-wk2/TestExpectations:
     14
    1152017-05-03  Yoav Weiss  <yoav@yoav.ws>
    216
  • trunk/LayoutTests/fast/scrolling/ios/touch-scroll-pointer-events-none.html

    r201901 r216145  
    6767            if (testRunner.runUIScript) {
    6868                testRunner.runUIScript(getUIScript(), function() {
    69                     debug("swipe complete");
    70                     shouldBe("scroller.scrollTop", "0");
    71                     shouldBe("document.scrollingElement.scrollTop", "90");
    72                     finishJSTest();
     69                    setTimeout(function() {
     70                        debug("swipe complete");
     71                        shouldBe("scroller.scrollTop", "0");
     72                        shouldBe("document.scrollingElement.scrollTop", "90");
     73                        finishJSTest();
     74                    }, 0);
    7375                });
    7476            }
  • trunk/LayoutTests/fast/scrolling/ios/touch-scroll-visibility-hidden.html

    r200609 r216145  
    6767            if (testRunner.runUIScript) {
    6868                testRunner.runUIScript(getUIScript(), function() {
    69                     debug("swipe complete");
    70                     shouldBe("scroller.scrollTop", "0");
    71                     shouldBe("document.scrollingElement.scrollTop", "90");
    72                     finishJSTest();
     69                    setTimeout(function() {
     70                        debug("swipe complete");
     71                        shouldBe("scroller.scrollTop", "0");
     72                        shouldBe("document.scrollingElement.scrollTop", "90");
     73                        finishJSTest();
     74                    }, 0);
    7375                });
    7476            }
  • trunk/LayoutTests/platform/ios-wk2/TestExpectations

    r216142 r216145  
    19411941webkit.org/b/169558 fast/history/ios/history-scroll-restoration.html [ Pass Failure ]
    19421942
    1943 webkit.org/b/170153 fast/scrolling/ios/touch-scroll-pointer-events-none.html [ Failure ]
    1944 webkit.org/b/170153 fast/scrolling/ios/touch-scroll-visibility-hidden.html [ Failure ]
    1945 
    19461943webkit.org/b/169719 fast/mediacapturefromelement/CanvasCaptureMediaStream-request-frame-events.html [ Pass Failure ]
    19471944
  • trunk/Source/WebKit2/ChangeLog

    r216144 r216145  
     12017-05-03  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Have WKWebView call _updateVisibleContentRects for the current transaction if possible, rather than always delaying
     4        https://bugs.webkit.org/show_bug.cgi?id=171619
     5       
     6        Also fixes webkit.org/b/170153 and webkit.org/b/170195
     7
     8        Reviewed by Tim Horton.
     9
     10        In r214391 we started adding the pre-commit handler in a dispatch_async() to ensure that
     11        the handler would always run, since we couldn't reliably test the phase of the current
     12        transaction. Now that problem has been solved (rdar://problem/31253952) we can go back to
     13        checking the transaction phase on newer iOS versions. If we're too late for the current transaction
     14        we still need to dispatch_async() to get into the next one.
     15
     16        * UIProcess/API/Cocoa/WKWebView.mm:
     17        (-[WKWebView _addUpdateVisibleContentRectPreCommitHandler]):
     18        (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
     19
    1202017-05-03  Chris Dumez  <cdumez@apple.com>
    221
  • trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm

    r216098 r216145  
    23122312}
    23132313
     2314- (void)_addUpdateVisibleContentRectPreCommitHandler
     2315{
     2316    auto retainedSelf = retainPtr(self);
     2317    [CATransaction addCommitHandler:[retainedSelf] {
     2318        WKWebView *webView = retainedSelf.get();
     2319        [webView _updateVisibleContentRects];
     2320        webView->_hasScheduledVisibleRectUpdate = NO;
     2321    } forPhase:kCATransactionPhasePreCommit];
     2322}
     2323
    23142324- (void)_scheduleVisibleContentRectUpdateAfterScrollInView:(UIScrollView *)scrollView
    23152325{
     
    23212331    _hasScheduledVisibleRectUpdate = YES;
    23222332   
    2323     // FIXME: remove the dispatch_async() when we have a fix for rdar://problem/31253952.
     2333#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000
     2334    CATransactionPhase transactionPhase = [CATransaction currentPhase];
     2335    if (transactionPhase == kCATransactionPhaseNull || transactionPhase == kCATransactionPhasePreLayout) {
     2336        [self _addUpdateVisibleContentRectPreCommitHandler];
     2337        return;
     2338    }
     2339#endif
     2340
    23242341    dispatch_async(dispatch_get_main_queue(), [retainedSelf = retainPtr(self)] {
    2325         [CATransaction addCommitHandler:[retainedSelf] {
    2326             WKWebView *webView = retainedSelf.get();
    2327             [webView _updateVisibleContentRects];
    2328             webView->_hasScheduledVisibleRectUpdate = NO;
    2329         } forPhase:kCATransactionPhasePreCommit];
     2342        WKWebView *webView = retainedSelf.get();
     2343        [webView _addUpdateVisibleContentRectPreCommitHandler];
    23302344    });
    23312345}
  • trunk/Tools/ChangeLog

    r216139 r216145  
     12017-05-03  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Have WKWebView call _updateVisibleContentRects for the current transaction if possible, rather than always delaying
     4        https://bugs.webkit.org/show_bug.cgi?id=171619
     5        https://bugs.webkit.org/show_bug.cgi?id=170195
     6
     7        Reviewed by Tim Horton.
     8
     9        Re-enable WebKit2.ResizeWithHiddenContentDoesNotHang.
     10
     11        * TestWebKitAPI/Tests/WebKit2Cocoa/AnimatedResize.mm:
     12        (TEST):
     13
    1142017-05-03  Michael Catanzaro  <mcatanzaro@igalia.com>
    215
  • trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/AnimatedResize.mm

    r215080 r216145  
    8383}
    8484
    85 TEST(WebKit2, DISABLED_ResizeWithHiddenContentDoesNotHang)
     85TEST(WebKit2, ResizeWithHiddenContentDoesNotHang)
    8686{
    8787    auto webView = createAnimatedResizeWebView();
Note: See TracChangeset for help on using the changeset viewer.