summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-writing-modes/wm-propagation-body-computed-direction-002.html
blob: e83da484741bfd182f313c434527666de57831db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>

  <meta charset="UTF-8">

  <title>CSS Writing Modes Test: computed 'direction' of root element when 'writing-mode' for &lt;body&gt; propagates to viewport</title>

  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
  <link rel="help" href="https://www.w3.org/TR/css-writing-modes-3/#principal-flow">
  <!--
  Issue 3066: [css-writing-modes] Does vertical writing mode of an HTML body
  element cause an orthogonal flow?
  https://github.com/w3c/csswg-drafts/issues/3066
  -->

  <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.">

  <!--
  This test *only* verifies the computed value of 'direction' of the
  root element.

  This test does *not* verify if the 'writing-mode' value of
  the body element propagates to the root element.
  -->

  <script src="/resources/testharness.js"></script>

  <script src="/resources/testharnessreport.js"></script>

  <style>
  html
    {
      direction: ltr;
      writing-mode: vertical-rl;
    }

  body
    {
      direction: rtl;
      writing-mode: vertical-lr;
    }
  </style>

  <script>
  function startTesting()
  {

    test(function()
      {

      assert_equals(getComputedStyle(document.documentElement).direction, "ltr" );

      }, "Second test on computed value of 'direction' of root element.");

  }

  startTesting();

  </script>