summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-writing-modes/wm-propagation-body-051.html
blob: 4f43a7d9956aaa5d25d2b91e048c5aaf68e26f49 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>

  <meta charset="UTF-8">

  <title>CSS Writing Modes Test: 'writing-mode: sideways-lr' set to &lt;body&gt; element 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-4/#principal-flow" title="8. The Principal Writing Mode">
  <!--
  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
  -->
  <link rel="match" href="wm-propagation-body-035-ref.html">

  <meta name="assert" content="This test checks that 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 the first such child element instead of taken from the root element. Also, a small script in this test verifies that the computed value of 'writing-mode' of the root element itself is not affected by such propagation.">

  <!--
  Tests 032 to 035: html's writing-mode is not specified

  Tests 036 to 039: html's writing-mode is specified as horizontal-tb

  Tests 040 to 043: html's writing-mode is specified as vertical-rl

  Tests 044 to 047: html's writing-mode is specified as vertical-lr

  Tests 048 to 051: html's writing-mode is specified as sideways-rl

  Tests 052 to 055: html's writing-mode is specified as sideways-lr
  -->

  <style>
  html
    {
      writing-mode: sideways-rl;
    }

  body
    {
      writing-mode: sideways-lr;
    }

  div
    {
      background-color: teal;
      height: 100px;
      width: 100px;
    }

  h1#second-test-condition
    {
      background-color: red;
      color: yellow;
    }
  </style>

  <script>
  function verifyComputedValueDocRoot()
  {
  if(getComputedStyle(document.documentElement)["writing-mode"] == "sideways-rl")
    {
    document.getElementById("second-test-condition").style.display = "none";
    };

    /*
    If the computed value of 'writing-mode' of the root element
    itself is not affected by such propagation, then the big FAIL
    word will not be displayed.
    */
  }
  </script>

 <body onload="verifyComputedValueDocRoot();">

  <div></div>

  <p><img src="support/wm-propagation-body-035-exp-res.png" width="322" height="38" alt="Image download support must be enabled">

  <!--
  The image says:
  Test passes if there is a teal square in
  the <strong>lower-left corner</strong> of the page.
  -->

  <h1 id="second-test-condition">FAIL</h1>