⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 242683 in webkit


Ignore:
Timestamp:
Mar 9, 2019, 9:52:21 PM (7 years ago)
Author:
Simon Fraser
Message:

Add a test for scrolling tree adjustment of fixed layers (r242601)
https://bugs.webkit.org/show_bug.cgi?id=195521

Reviewed by Sam Weinig.

This test sets the "unstable" scrolling state (as if the user is actively scrolling) and scrolls,
then changes style to trigger a scrolling tree commit with a changed offset for a fixed layer.
The test shows the wrong fixed layer position before r242601.

Helpers are added to UIHelper to do the scroll, and to wrap setTimeout in an async function.
Sadly we have to wait about 120ms for the scrollbars to fade out.

  • resources/ui-helper.js:

(window.UIHelper.async.delayFor):
(window.UIHelper.async.immediateScrollTo):
(window.UIHelper.async.immediateUnstableScrollTo):

  • scrollingcoordinator/ios/ui-scroll-fixed-expected.html: Added.
  • scrollingcoordinator/ios/ui-scroll-fixed.html: Added.
Location:
trunk/LayoutTests
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r242682 r242683  
     12019-03-09  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add a test for scrolling tree adjustment of fixed layers (r242601)
     4        https://bugs.webkit.org/show_bug.cgi?id=195521
     5
     6        Reviewed by Sam Weinig.
     7       
     8        This test sets the "unstable" scrolling state (as if the user is actively scrolling) and scrolls,
     9        then changes style to trigger a scrolling tree commit with a changed offset for a fixed layer.
     10        The test shows the wrong fixed layer position before r242601.
     11
     12        Helpers are added to UIHelper to do the scroll, and to wrap setTimeout in an async function.
     13        Sadly we have to wait about 120ms for the scrollbars to fade out.
     14
     15        * resources/ui-helper.js:
     16        (window.UIHelper.async.delayFor):
     17        (window.UIHelper.async.immediateScrollTo):
     18        (window.UIHelper.async.immediateUnstableScrollTo):
     19        * scrollingcoordinator/ios/ui-scroll-fixed-expected.html: Added.
     20        * scrollingcoordinator/ios/ui-scroll-fixed.html: Added.
     21
    1222019-03-09  Wenson Hsieh  <wenson_hsieh@apple.com>
    223
  • trunk/LayoutTests/resources/ui-helper.js

    r242401 r242683  
    198198    }
    199199
     200    static async delayFor(ms)
     201    {
     202        return new Promise(resolve => setTimeout(resolve, ms));
     203    }
     204   
     205    static async immediateScrollTo(x, y)
     206    {
     207        if (!this.isWebKit2()) {
     208            window.scrollTo(x, y);
     209            return Promise.resolve();
     210        }
     211
     212        await new Promise(resolve => {
     213            testRunner.runUIScript(`
     214                uiController.immediateScrollToOffset(${x}, ${y});`, resolve);
     215        });
     216    }
     217
     218    static async immediateUnstableScrollTo(x, y)
     219    {
     220        if (!this.isWebKit2()) {
     221            window.scrollTo(x, y);
     222            return Promise.resolve();
     223        }
     224
     225        await new Promise(resolve => {
     226            testRunner.runUIScript(`
     227                uiController.stableStateOverride = false;
     228                uiController.immediateScrollToOffset(${x}, ${y});`, resolve);
     229        });
     230    }
     231
    200232    static ensureVisibleContentRectUpdate()
    201233    {
Note: See TracChangeset for help on using the changeset viewer.