Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/mathml/relations/css-styling/lengths-3.html

Issue 2434253002: Import wpt@7e8373f4bd144e66c88535983aa735b28c934cfe (Closed)
Patch Set: Modify TestExpectations or download new baselines for tests. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>MathML lengths</title>
6 <link rel="help" href="http://www.mathml-association.org/MathMLinHTML5/S2.html#S S3.SSS1"/>
7 <meta name="assert" content="Verify various cases of the MathML length syntax.">
8 <script src="/resources/testharness.js"></script>
9 <script src="/resources/testharnessreport.js"></script>
10 <style>
11 @font-face {
12 font-family: TestFont;
13 src: url("/fonts/math/xheight500.woff");
14 }
15 math {
16 font-family: TestFont;
17 font-size: 10px;
18 }
19 </style>
20 <script>
21 var epsilon = .5;
22
23 function getBox(aId) {
24 return document.getElementById(aId).getBoundingClientRect();
25 }
26
27 setup({ explicit_done: true });
28 window.addEventListener("load", function() {
29 document.fonts.ready.then(runTests);
30 });
31
32 function runTests() {
33 test(function() {
34 assert_equals(getBox("unitCm").width, 96, "cm");
35 assert_equals(getBox("unitEm").width, 120, "em");
36 assert_equals(getBox("unitEx").width, 500, "ex");
37 assert_equals(getBox("unitIn").width, 288, "in");
38 assert_equals(getBox("unitNamed").width, 700, "namedspace");
39 assert_equals(getBox("unitMm").width, 576, "mm");
40 assert_equals(getBox("unitPc").width, 96, "pc");
41 assert_equals(getBox("unitPercentage").width, 60, "%");
42 assert_equals(getBox("unitPt").width, 96, "pt");
43 assert_equals(getBox("unitPx").width, 123, "px");
44 assert_equals(getBox("unitNone").width, 150, "Unitless");
45 }, "Units");
46
47 test(function() {
48 assert_equals(getBox("spaceCm").width, 96, "cm");
49 assert_equals(getBox("spaceEm").width, 120, "em");
50 assert_equals(getBox("spaceEx").width, 500, "ex");
51 assert_equals(getBox("spaceIn").width, 288, "in");
52 assert_equals(getBox("spaceNamed").width, 700, "namedspace");
53 assert_equals(getBox("spaceMm").width, 576, "mm");
54 assert_equals(getBox("spacePc").width, 96, "pc");
55 assert_equals(getBox("spacePercentage").width, 60, "%");
56 assert_equals(getBox("spacePt").width, 96, "pt");
57 assert_equals(getBox("spacePx").width, 123, "px");
58 assert_equals(getBox("spaceNone").width, 150, "Unitless");
59 }, "Trimming of space");
60
61 test(function() {
62 assert_approx_equals(getBox("n0").width, 0, epsilon, "n0");
63 assert_approx_equals(getBox("n1").width, 90, epsilon, "n1");
64 assert_approx_equals(getBox("n2").width, 8, epsilon, "n2");
65 assert_approx_equals(getBox("n3").width, 70, epsilon, "n3");
66 assert_approx_equals(getBox("n4").width, 650, epsilon, "n4");
67 assert_approx_equals(getBox("n5").width, 4320, epsilon, "n5");
68 assert_approx_equals(getBox("n6").width, 1, epsilon, "n6");
69 assert_approx_equals(getBox("n7").width, 8, epsilon, "n7");
70 assert_approx_equals(getBox("n8").width, 65, epsilon, "n8");
71 assert_approx_equals(getBox("n9").width, 432, epsilon, "n9");
72 assert_approx_equals(getBox("n10").width, 123, epsilon, "n10");
73 }, "Non-negative numbers");
74
75 test(function() {
76 var topRef = getBox("ref").top;
77 assert_approx_equals(getBox("N0").top - topRef, -0, epsilon, "N0");
78 assert_approx_equals(topRef - getBox("N1").top, -90, epsilon, "N1");
79 assert_approx_equals(topRef - getBox("N2").top, -8, epsilon, "N2");
80 assert_approx_equals(topRef - getBox("N3").top, -70, epsilon, "N3");
81 assert_approx_equals(topRef - getBox("N4").top, -650, epsilon, "N4");
82 assert_approx_equals(topRef - getBox("N5").top, -4320, epsilon, "N5");
83 assert_approx_equals(topRef - getBox("N6").top, -1, epsilon, "N6");
84 assert_approx_equals(topRef - getBox("N7").top, -8, epsilon, "N7");
85 assert_approx_equals(topRef - getBox("N8").top, -65, epsilon, "N8");
86 assert_approx_equals(topRef - getBox("N9").top, -432, epsilon, "N9");
87 assert_approx_equals(topRef - getBox("N10").top, -123, epsilon, "N10");
88 }, "Non-positive numbers");
89
90 done();
91 }
92 </script>
93 </head>
94 <body>
95 <p>
96 <math>
97 <mspace id="unitCm" width="2.54cm"/>
98 <mspace id="unitEm" width="12em"/>
99 <mspace id="unitEx" width="100ex"/>
100 <mspace id="unitIn" width="3in"/>
101 <mspace style="font-size: 1800px" id="unitNamed" width="veryverythickmaths pace"/>
102 <mspace id="unitMm" width="152.4mm"/>
103 <mspace id="unitPc" width="6pc"/>
104 <mstyle mathsize="200%"><mspace id="unitPercentage" width="3em"/></mstyle>
105 <mspace id="unitPt" width="72pt"/>
106 <mspace id="unitPx" width="123px"/>
107 <mstyle mathsize="5"><mspace id="unitNone" width="3em"/></mstyle>
108 </math>
109 </p>
110 <p>
111 <math>
112 <mspace id="spaceCm" width="&#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;2.54 cm&#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;"/>
113 <mspace id="spaceEm" width="&#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;12em &#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;"/>
114 <mspace id="spaceEx" width="&#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;100e x&#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;"/>
115 <mspace id="spaceIn" width="&#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;3in& #x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;"/>
116 <mspace style="font-size: 1800px" id="spaceNamed" width="&#x20;&#x9;&#xA;& #xD;&#x20;&#x9;&#xA;&#xD;veryverythickmathspace&#x20;&#x9;&#xA;&#xD;&#x20;&#x9;& #xA;&#xD;"/>
117 <mspace id="spaceMm" width="&#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;152. 4mm&#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;"/>
118 <mspace id="spacePc" width="&#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;6pc& #x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;"/>
119 <mstyle mathsize="200%"><mspace id="spacePercentage" width="&#x20;&#x9;&#x A;&#xD;&#x20;&#x9;&#xA;&#xD;3em&#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;"/></ms tyle>
120 <mspace id="spacePt" width="&#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;72pt &#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;"/>
121 <mspace id="spacePx" width="&#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;123p x&#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;"/>
122 <mstyle mathsize="5"><mspace id="spaceNone" width="&#x20;&#x9;&#xA;&#xD;&# x20;&#x9;&#xA;&#xD;3em&#x20;&#x9;&#xA;&#xD;&#x20;&#x9;&#xA;&#xD;"/></mstyle>
123 </math>
124 </p>
125 <p>
126 <math>
127 <mspace id="n0" width="0em"/>
128 <mspace id="n1" width="9em"/>
129 <mspace id="n2" width=".8em"/>
130 <mspace id="n3" width="7.em"/>
131 <mspace id="n4" width="65em"/>
132 <mspace id="n5" width="432em"/>
133 <mspace id="n6" width=".10em"/>
134 <mspace id="n7" width=".789em"/>
135 <mspace id="n8" width="6.5em"/>
136 <mspace id="n9" width="43.21em"/>
137 <mspace id="n10" width="012.345em"/>
138 </math>
139 </p>
140 <p>
141 <math>
142 <mspace id="ref"></mspace>
143 <mpadded voffset="-0em"><mspace id="N0"/></mpadded>
144 <mpadded voffset="-9em"><mspace id="N1"/></mpadded>
145 <mpadded voffset="-.8em"><mspace id="N2"/></mpadded>
146 <mpadded voffset="-7.em"><mspace id="N3"/></mpadded>
147 <mpadded voffset="-65em"><mspace id="N4"/></mpadded>
148 <mpadded voffset="-432em"><mspace id="N5"/></mpadded>
149 <mpadded voffset="-.10em"><mspace id="N6"/></mpadded>
150 <mpadded voffset="-.789em"><mspace id="N7"/></mpadded>
151 <mpadded voffset="-6.5em"><mspace id="N8"/></mpadded>
152 <mpadded voffset="-43.21em"><mspace id="N9"/></mpadded>
153 <mpadded voffset="-012.345em"><mspace id="N10"/></mpadded>
154 </math>
155 </p>
156 <hr/>
157 </body>
158 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698