summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-text/white-space/white-space-applies-to-text-001.html
blob: 1a9a62a2206a82bbdbccb6c1555afab9c0cb66bb (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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!DOCTYPE html>

  <meta charset="UTF-8">

  <title>CSS Text Test: white-space property applies to text</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-text-3/#white-space-processing">
  <link rel="help" href="https://www.w3.org/TR/css-display-3/#box-generation">
  <link rel="match" href="reference/white-space-applies-to-text-001-ref.html">

  <meta content="This test checks that 'white-space', which applies to inlines, also applies to text. In this test, we verify that 'white-space: normal', 'white-space: nowrap', 'white-space: pre', 'white-space: pre-wrap', 'white-space: break-spaces' and 'white-space: pre-line' apply to text." name="assert">

  <style>
  section
    {
      border: black solid 2px;
      float: left;
      font-family: monospace;
      font-size: 14px;
      line-height: 1; /* computes to 14px */
      margin-bottom: 10px;
      width: 16ch;
    }

  section.applies-to-text
    {
      clear: both;
    }

  section.applies-to-inline
    {
      margin-left: 10em;
    }

  div
    {
      display: contents;
    }

  div.first-subtest
    {
      white-space: normal;
    }

  div.second-subtest
    {
      white-space: nowrap;
    }

  div.third-subtest
    {
      white-space: pre;
    }

  div.fourth-subtest
    {
      white-space: pre-wrap;
    }

  div.fifth-subtest
    {
      white-space: break-spaces;
    }

  div.sixth-subtest
    {
      white-space: pre-line;
    }

  hr
    {
      clear: both;
      margin: 4em auto 1.5em 0em;
      width: 480px;
    }
  </style>

  <p>Test passes if the characters inside of each black bordered rectangles on the lefthand side are laid out identically to their counterparts on the righthand side.

  <section class="applies-to-text">
    <div class="first-subtest">Lorem ipsum.      Dolor&NewLine;
   sit.</div>
  </section>

  <section class="applies-to-inline">
    <div class="first-subtest"><span>Lorem ipsum.      Dolor&NewLine;
   sit.</span></div>
  </section>

  <hr>

  <section class="applies-to-text">
    <div class="second-subtest">Lorem ipsum.      Dolor&NewLine;
   sit.</div>
  </section>

  <section class="applies-to-inline">
    <div class="second-subtest"><span>Lorem ipsum.      Dolor&NewLine;
   sit.</span></div>
  </section>

  <hr>

  <section class="applies-to-text">
    <div class="third-subtest">Lorem ipsum.      Dolor&NewLine;
   sit.</div>
  </section>

  <section class="applies-to-inline">
    <div class="third-subtest"><span>Lorem ipsum.      Dolor&NewLine;
   sit.</span></div>
  </section>

  <hr>

  <section class="applies-to-text">
    <div class="fourth-subtest">Lorem ipsum.      Dolor&NewLine;
   sit.</div>
  </section>

  <section class="applies-to-inline">
    <div class="fourth-subtest"><span>Lorem ipsum.      Dolor&NewLine;
   sit.</span></div>
  </section>

  <hr>

  <section class="applies-to-text">
    <div class="fifth-subtest">Lorem ipsum.      Dolor&NewLine;
   sit.</div>
  </section>

  <section class="applies-to-inline">
    <div class="fifth-subtest"><span>Lorem ipsum.      Dolor&NewLine;
   sit.</span></div>
  </section>

  <hr>

  <section class="applies-to-text">
    <div class="sixth-subtest">Lorem ipsum.      Dolor&NewLine;
   sit.</div>
  </section>

  <section class="applies-to-inline">
    <div class="sixth-subtest"><span>Lorem ipsum.      Dolor&NewLine;
   sit.</span></div>
  </section>