tor-browser

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

scroll-state-scrolled-keyboard-scroll-on-body.html (1483B)


      1 <!DOCTYPE html>
      2 <title>@container: scroll-state(scrolled) keyboard scroll on body</title>
      3 <link rel="help" href="https://drafts.csswg.org/css-conditional-5/#scrolled">
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/resources/testdriver.js"></script>
      7 <script src="/resources/testdriver-actions.js"></script>
      8 <script src="/resources/testdriver-vendor.js"></script>
      9 <script src="/web-animations/testcommon.js"></script>
     10 <script src="/css/css-conditional/container-queries/support/cq-testcommon.js"></script>
     11 <style>
     12 html {
     13  overflow: scroll;
     14 }
     15 
     16 body {
     17  container-type: scroll-state;
     18  overflow-y: scroll;
     19 }
     20 
     21 body {
     22  height: 300px;
     23 }
     24 
     25 div {
     26  height: 1000px;
     27  --y: no;
     28 }
     29 
     30 @container scroll-state(scrolled: y) {
     31  div {
     32    --y: yes;
     33  }
     34 }
     35 </style>
     36 <body>
     37 <div id="target"></div>
     38 </body>
     39 <script>
     40  setup(() => assert_implements_scroll_state_container_queries());
     41 
     42  promise_test(async t => {
     43    await new test_driver.Actions()
     44      .addPointer("TestPointer", "mouse")
     45      .pointerMove(100, 100)
     46      .pointerDown()
     47      .pointerUp()
     48      .send();
     49    await new test_driver.Actions()
     50      .keyDown('\uE00D')
     51      .keyUp('\uE00D')
     52      .send();
     53    await new test_driver.Actions()
     54      .keyDown('\uE00D')
     55      .keyUp('\uE00D')
     56      .send();
     57    await waitForAnimationFrames(2);
     58    assert_equals(getComputedStyle(target).getPropertyValue("--y"), "yes");
     59 
     60  }, "Spacebar scroll on body");
     61 
     62 </script>