tor-browser

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

wm-propagation-body-scroll-offset-vertical-lr.html (1461B)


      1 <!DOCTYPE html>
      2 <meta charset="UTF-8">
      3 <title>CSS Writing Modes Test: body vertical-lr propagated to viewport - scroll direction</title>
      4 <link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com">
      5 <link rel="help" href="https://www.w3.org/TR/css-writing-modes-3/#principal-flow">
      6 <meta name="assert" content="Test that propagating writing-mode from body to viewport affects scroll direction">
      7 <script src="/resources/testharness.js"></script>
      8 <script src="/resources/testharnessreport.js"></script>
      9 <style>
     10  html { writing-mode: vertical-rl; }
     11  body { writing-mode: vertical-lr; width: 10000px; }
     12 
     13  .result-wm, .result-wm > body {
     14    writing-mode: horizontal-tb;
     15    width: auto;
     16  }
     17 </style>
     18 <body>
     19 <script>
     20  test(function() {
     21    assert_equals(document.scrollingElement.scrollLeft, 0, "scrollLeft should be 0.");
     22  }, "Check initial scroll position of viewport.");
     23 
     24  test(function() {
     25    document.scrollingElement.scrollLeft = -1000;
     26    assert_equals(document.scrollingElement.scrollLeft, 0, "scrollLeft should be 0.");
     27  }, "Scroll to scrollLeft = -1000 should not be possible.");
     28 
     29  test(function() {
     30    document.scrollingElement.scrollLeft = 1000;
     31    assert_equals(document.scrollingElement.scrollLeft, 1000, "scrollLeft should be 1000.");
     32  }, "Scroll to scrollLeft = 1000 should be possible.");
     33 
     34  // Reset back to horizontal-tb to make the result readable on-screen.
     35  document.scrollingElement.className = "result-wm";
     36 </script>