OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <title>Whitespace in attribute values tests</title> |
| 3 <script src=../../resources/testharness.js></script> |
| 4 <script src=../../resources/testharnessreport.js></script> |
| 5 <script src=resources/whitespace-helper.js></script> |
| 6 <svg id="testcontainer"> |
| 7 <defs> |
| 8 <marker/> |
| 9 <stop/> |
| 10 <filter> |
| 11 <feTurbulence></feTurbulence> |
| 12 </filter> |
| 13 </defs> |
| 14 </svg> |
| 15 <div id=log></div> |
| 16 <script> |
| 17 var svg = document.querySelector("svg"); |
| 18 |
| 19 // test length values |
| 20 var EPSILON = Math.pow(2, -24); // float epsilon |
| 21 var whitespace = [ "", " ", " ", "\r\n\t ", "\f" ]; |
| 22 var validunits = [ "", "em", "ex", "px", "in", "cm", "mm", "pt", "pc", "%" ]; |
| 23 |
| 24 // This test was split out from whitespace-length.html because the trybots were
too slow. |
| 25 |
| 26 testType("<length>", |
| 27 svg, |
| 28 "x", |
| 29 0, // expected default value |
| 30 whitespace, |
| 31 [], // valid |
| 32 [ Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINIT
Y, "fnord", "E", "e", "e+", "E-", "-", "+", "-.", ".-", ".", "+.", ".E0", "e1" ]
, // invalid |
| 33 validunits, |
| 34 [], // garbage |
| 35 function(elm, value) { assert_approx_equals(elm.x.baseVal.value
InSpecifiedUnits, parseFloat(value), EPSILON); }, |
| 36 function(elm, expected) { assert_approx_equals(elm.x.baseVal.va
lue, expected, EPSILON); } ); |
| 37 |
| 38 </script> |
OLD | NEW |