tor-browser

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

wm-propagation-body-computed-direction-001.html (1713B)


      1 <!DOCTYPE html>
      2 
      3  <meta charset="UTF-8">
      4 
      5  <title>CSS Writing Modes Test: computed 'direction' of root element when 'writing-mode' for &lt;body&gt; propagates to viewport</title>
      6 
      7  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
      8  <link rel="help" href="https://www.w3.org/TR/css-writing-modes-3/#principal-flow">
      9  <!--
     10  Issue 3066: [css-writing-modes] Does vertical writing mode of an HTML body
     11  element cause an orthogonal flow?
     12  https://github.com/w3c/csswg-drafts/issues/3066
     13  -->
     14 
     15  <meta name="assert" content="When the root element has a &lt;body&gt; child element, then the principal writing mode is instead taken from the values of 'writing-mode' and 'direction' on such first child element instead of taken from the root element. In this test, a small script verifies that the computed value of 'direction' of the root element itself is not affected by such propagation.">
     16 
     17  <!--
     18  This test *only* verifies the computed value of 'direction' of the
     19  root element.
     20 
     21  This test does *not* verify if the 'writing-mode' value of
     22  the body element propagates to the root element.
     23  -->
     24 
     25  <script src="/resources/testharness.js"></script>
     26 
     27  <script src="/resources/testharnessreport.js"></script>
     28 
     29  <style>
     30  html
     31    {
     32      direction: rtl;
     33      writing-mode: vertical-lr;
     34    }
     35 
     36  body
     37    {
     38      direction: ltr;
     39      writing-mode: vertical-rl;
     40    }
     41  </style>
     42 
     43  <script>
     44  function startTesting()
     45  {
     46 
     47    test(function()
     48      {
     49 
     50      assert_equals(getComputedStyle(document.documentElement).direction, "rtl" );
     51 
     52      }, "First test on computed value of 'direction' of root element.");
     53 
     54  }
     55 
     56  startTesting();
     57 
     58  </script>