OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
esprehn
2014/04/12 06:22:47
We often leave off the <html>, <head> and <body>.
| |
4 <script src="../../resources/js-test.js"></script> | |
5 <script type="text/javascript" charset="utf-8"> | |
esprehn
2014/04/12 06:22:47
Leave off type and charset.
| |
6 if (window.testRunner) | |
7 testRunner.dumpAsText(); | |
esprehn
2014/04/12 06:22:47
You don't need this, js-test.js does this.
| |
8 | |
9 function shouldBeEqual(a, b) | |
esprehn
2014/04/12 06:22:47
js-test has this already.
| |
10 { | |
11 if (a == b) | |
12 testPassed("Overflow values are the same."); | |
13 else | |
14 testFailed("Overflow values should be the same. overflow-x: " + a + ", overflow-y: " + b + "."); | |
15 } | |
16 | |
17 function test() | |
esprehn
2014/04/12 06:22:47
onload = function() {
| |
18 { | |
19 description("This test checks the overflow equality in case of SVG.") | |
20 | |
21 var cases = document.getElementsByClassName("case"); | |
esprehn
2014/04/12 06:22:47
Use querySelector
| |
22 for (var i = 0; i < cases.length; ++i) { | |
23 var computedStyle = getComputedStyle(cases[i]); | |
esprehn
2014/04/12 06:22:47
remove var
| |
24 var overflowX = computedStyle.getPropertyValue("overflow-x"); | |
25 var overflowY = computedStyle.getPropertyValue("overflow-y"); | |
esprehn
2014/04/12 06:22:47
remove this.
| |
26 | |
27 shouldBeEqual(overflowX, overflowY); | |
esprehn
2014/04/12 06:22:47
shouldBe("computedStyle.getPropertyValue('overflow
| |
28 } | |
29 } | |
30 </script> | |
31 </head> | |
32 <body> | |
33 <svg class="case"/> | |
34 <svg class="case" style="overflow-x: auto"/> | |
35 <svg class="case" style="overflow-x: visible; overflow-y: hidden"/> | |
36 <script> | |
37 test(); | |
esprehn
2014/04/12 06:22:47
remove
| |
38 </script> | |
39 </body> | |
40 </html> | |
OLD | NEW |