tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

scroll-timeline-default-writing-mode-rl.html (1748B)


      1 <!DOCTYPE HTML>
      2 <html class="reftest-wait">
      3 <title>The default scroll() timeline with writing-mode:vertical-rl</title>
      4 <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
      5 <link rel="help" href="https://drafts.csswg.org/scroll-animations-1/#scroll-notation">
      6 <link rel="help" href="https://drafts.csswg.org/css-animations-2/#animation-timeline">
      7 <meta name="assert" content="CSS animation correctly updates values when using
      8                             the default scroll() timeline with writing-mode:vertical-rl">
      9 <link rel="match" href="scroll-timeline-default-writing-mode-rl-ref.html">
     10 
     11 <style>
     12  @keyframes update {
     13    from { transform: translateX(0px); }
     14    to { transform: translateX(-200px); }
     15  }
     16 
     17  html {
     18    min-block-size: 100%;
     19    padding-block-end: 100px;
     20    writing-mode: vertical-rl;
     21  }
     22 
     23  #box {
     24    width: 100px;
     25    height: 100px;
     26    background-color: green;
     27    animation: update 1s linear;
     28    animation-timeline: scroll();
     29  }
     30 
     31  #covered {
     32    width: 100px;
     33    height: 100px;
     34    background-color: red;
     35  }
     36 
     37  * {
     38    margin-block: 0px;
     39  }
     40 </style>
     41 
     42 <div id="box"></div>
     43 <div id="covered"></div>
     44 
     45 <script src="/web-animations/testcommon.js"></script>
     46 <script>
     47  document.documentElement.addEventListener('TestRendered', async () => {
     48    runTest();
     49  }, { once: true });
     50 
     51  async function runTest() {
     52    const scroller = document.scrollingElement;
     53 
     54    await waitForCompositorReady();
     55 
     56    // Move the scroller to the halfway point.
     57    const maxScroll = scroller.scrollWidth - scroller.clientWidth;
     58    scroller.scrollLeft = -0.5 * maxScroll;
     59 
     60    await waitForNextFrame();
     61    await waitForNextFrame();
     62 
     63    document.documentElement.classList.remove("reftest-wait");
     64  }
     65 </script>