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
|
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<meta charset="utf-8">
<title>Embellished operators - tree change and relayout</title>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<link rel="help" href="https://w3c.github.io/mathml-core/#embellished-operators">
<link rel="help" href="https://w3c.github.io/mathml-core/#definition-of-space-like-elements">
<link rel="help" href="https://w3c.github.io/mathml-core/#layout-of-mrow">
<script src="/mathml/support/mathml-fragments.js"></script>
<meta name="assert" content="Verify relayout of an mrow with a child that has a deeply nested <mo> element.">
<link rel="match" href="embellished-operator-dynamic-001-ref.html">
<style>
math, math * {
font: 25px/1 Ahem;
}
mn {
color: black;
}
mo {
color: blue;
}
</style>
</head>
<body>
<p>There should be the five 1em squares on the same line, with colors
black, orange, blue, orange, black:</p>
<math display="block">
<mrow style="background: yellow">
<mn>1</mn>
<mrow style="background: orange">
<mrow id="change_to_not_embellished_operator">
<mrow>
<mo lspace="1em" rspace="1em">X</mo>
</mrow>
</mrow>
</mrow>
<mn>2</mn>
</mrow>
</math>
<p>There should be the five 1em squares on the same line, with colors
black, yellow, blue, yellow, black:</p>
<math display="block">
<mrow style="background: yellow">
<mn>3</mn>
<mrow style="background: orange">
<mrow id="change_to_embellished_operator">
<mrow>
<mo lspace="1em" rspace="1em">X</mo>
</mrow>
<mn></mn>
</mrow>
</mrow>
<mn>4</mn>
</mrow>
</math>
<p>There should be the five 1em squares on the same line, with colors
black, orange, blue, orange, black:</p>
<math display="block">
<mrow style="background: yellow">
<mn>5</mn>
<mrow style="background: orange">
<mrow>
<mrow>
<mo lspace="1em" rspace="1em">X</mo>
</mrow>
</mrow>
<mrow id="change_to_not_space_like">
<mspace></mspace>
<mtext></mtext>
</mrow>
</mrow>
<mn>6</mn>
</mrow>
</math>
<p>There should be the five 1em squares on the same line, with colors
black, yellow, blue, yellow, black:</p>
<math display="block">
<mrow style="background: yellow">
<mn>7</mn>
<mrow style="background: orange">
<mrow>
<mrow>
<mo lspace="1em" rspace="1em">X</mo>
</mrow>
<mrow id="change_to_space_like">
<mspace></mspace>
<mtext></mtext>
<mn></mn>
</mrow>
</mrow>
</mrow>
<mn>8</mn>
</mrow>
</math>
<script src="/mathml/support/feature-detection.js"></script>
<script>
MathMLFeatureDetection.ensure_for_match_reftest("has_operator_spacing");
// After adding a not space-like element to mrow1, it is no longer an
// embellished operator : lspace/rspace should be around its mrow child.
let mrow1 = document.getElementById("change_to_not_embellished_operator");
mrow1.appendChild(FragmentHelper.createElement("mn"));
// Removing the not space-like element from mrow2 makes its orange parent
// an embellished operator. lspace/rspace should be around this parent.
let mrow2 = document.getElementById("change_to_embellished_operator");
mrow2.removeChild(mrow2.lastElementChild);
// Same as above, but changing the space-like nature of one child.
let mrow3 = document.getElementById("change_to_not_space_like");
mrow3.appendChild(FragmentHelper.createElement("mn"));
let mrow4 = document.getElementById("change_to_space_like");
mrow4.removeChild(mrow4.lastElementChild);
document.documentElement.classList.remove('reftest-wait');
</script>
</body>
</html>
|