summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-writing-modes/text-combine-upright-parsing-valid-001.html
blob: f66ffbd40ec9842a5423621a91a11d21a10fd351 (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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>CSS Writing Modes: parsing text-combine-upright with valid values</title>
<link rel="author" title="Masataka Yakura" href="http://google.com/+MasatakaYakura">
<link rel="help" href="http://www.w3.org/TR/css-writing-modes-3/#text-combine-upright">
<meta name="assert" content="text-combine-upright supports `none`, `all`, `digits`, and `digits` followed by a digit in the range from 2 to 4.">
<meta name="flags" content="dom">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<style>
#valid_none {
  text-combine-upright: none;
}

#valid_all {
  text-combine-upright: all;
}

#valid_initial {
  text-combine-upright: initial;
}

#valid_inherit_outer {
  text-combine-upright: all;
}

#valid_inherit_inner {
  text-combine-upright: inherit;
}

#valid_unset_outer {
  text-combine-upright: all;
}

#valid_unset_inner {
  text-combine-upright: unset;
}
</style>
</head>
<body>

<div id="valid_none"></div>
<div id="valid_all"></div>

<div id="valid_initial"></div>

<div id="valid_inherit_outer">
  <div id="valid_inherit_inner"></div>
</div>

<div id="valid_unset_outer">
  <div id="valid_unset_inner"></div>
</div>

<div id="log"></div>

<script>
var getComputedValueFor = function (id) {
  var element = document.getElementById(id);
  return window.getComputedStyle(element).textCombineUpright;
};

test(function () {
  assert_equals(getComputedValueFor('valid_none'), 'none');
}, 'Computed value for `text-combine-upright: none` is `none`');

test(function () {
  assert_equals(getComputedValueFor('valid_all'), 'all');
}, 'Computed value for `text-combine-upright: all` is `all`');


test(function () {
  assert_equals(getComputedValueFor('valid_initial'), 'none');
}, 'Computed value for `text-combine-upright: initial` is `none`');


test(function () {
  assert_equals(getComputedValueFor('valid_inherit_outer'), 'all');
  assert_equals(getComputedValueFor('valid_inherit_inner'), 'all');
}, 'Computed value for `text-combine-upright: inherit` is `all` which is inherited from the parent element');

test(function () {
  assert_equals(getComputedValueFor('valid_unset_outer'), 'all');
  assert_equals(getComputedValueFor('valid_unset_inner'), 'all');
}, 'Computed value for `text-combine-upright: unset` is `all` which is inherited from the parent element');
</script>
</body>
</html>