OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
4 <style> | 4 <style> |
5 #test { d: path('M 0 0 H 30 V 40'); } | 5 #test { d: path('M 0 0 H 30 V 40'); } |
6 </style> | 6 </style> |
7 <svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"> | 7 <svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"> |
8 <path id="test" d="M 10 190 H 190" /> | 8 <path id="test" d="M 10 190 H 190" /> |
9 | 9 |
10 <path id="test2" d="M 10 190 H 190" /> | 10 <path id="test2" d="M 10 190 H 190" /> |
11 <path id="test3" d="" /> | 11 <path id="test3" d="" /> |
12 <path id="test4" /> | 12 <path id="test4" /> |
13 </svg> | 13 </svg> |
14 <script> | 14 <script> |
15 'use strict'; | 15 'use strict'; |
16 test(function() { | 16 test(function() { |
17 var test = document.getElementById("test"); | 17 var test = document.getElementById("test"); |
18 assert_equals(test.getTotalLength(), 70); | 18 assert_equals(test.getTotalLength(), 70); |
19 }, "Test for getTotalLength using computed style"); | 19 }, "Test for getTotalLength using computed style"); |
20 test(function() { | 20 test(function() { |
21 var test = document.getElementById("test"); | 21 var test = document.getElementById("test"); |
22 assert_equals(test.getPointAtLength(70).x, 30); | 22 assert_equals(test.getPointAtLength(70).x, 30); |
23 assert_equals(test.getPointAtLength(70).y, 40); | 23 assert_equals(test.getPointAtLength(70).y, 40); |
24 }, "Test for getTotalLength using computed style"); | 24 }, "Test for getPointAtLength using computed style"); |
25 test(function() { | 25 test(function() { |
26 var test = document.getElementById("test"); | 26 var test = document.getElementById("test"); |
27 assert_equals(test.getPathSegAtLength(50), 2); | 27 assert_equals(test.getPathSegAtLength(50), 2); |
28 }, "Test for getPathSegAtLength using computed style"); | 28 }, "Test for getPathSegAtLength using computed style"); |
29 | 29 |
30 test(function() { | 30 test(function() { |
31 var test = document.getElementById("test"); | 31 var test = document.getElementById("test"); |
32 assert_equals(getComputedStyle(test).d, "path('M 0 0 H 30 V 40')"); | 32 assert_equals(getComputedStyle(test).d, "path('M 0 0 H 30 V 40')"); |
33 }, "Test for CSS d using computed style"); | 33 }, "Test for CSS d using computed style"); |
34 test(function() { | 34 test(function() { |
35 var test2 = document.getElementById("test2"); | 35 var test2 = document.getElementById("test2"); |
36 assert_equals(getComputedStyle(test2).d, "path('M 10 190 H 190')"); | 36 assert_equals(getComputedStyle(test2).d, "path('M 10 190 H 190')"); |
37 }, "Test for DOM d using computed style"); | 37 }, "Test for DOM d using computed style"); |
38 test(function() { | 38 test(function() { |
39 var test3 = document.getElementById("test3"); | 39 var test3 = document.getElementById("test3"); |
40 assert_equals(getComputedStyle(test3).d, "none"); | 40 assert_equals(getComputedStyle(test3).d, "none"); |
41 }, "Test for empty d using computed style"); | 41 }, "Test for empty d using computed style"); |
42 test(function() { | 42 test(function() { |
43 var test4 = document.getElementById("test4"); | 43 var test4 = document.getElementById("test4"); |
44 assert_equals(getComputedStyle(test4).d, "none"); | 44 assert_equals(getComputedStyle(test4).d, "none"); |
45 }, "Test for absent d using computed style"); | 45 }, "Test for absent d using computed style"); |
46 </script> | 46 </script> |
OLD | NEW |