Index: LayoutTests/fast/svg/whitespace-length-invalid.html |
diff --git a/LayoutTests/fast/svg/whitespace-length-invalid.html b/LayoutTests/fast/svg/whitespace-length-invalid.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..84bf03b2b1166dbfe34d2d49b033b945f26cf327 |
--- /dev/null |
+++ b/LayoutTests/fast/svg/whitespace-length-invalid.html |
@@ -0,0 +1,38 @@ |
+<!doctype html> |
+<title>Whitespace in attribute values tests</title> |
+<script src=../../resources/testharness.js></script> |
+<script src=../../resources/testharnessreport.js></script> |
+<script src=resources/whitespace-helper.js></script> |
+<svg id="testcontainer"> |
+ <defs> |
+ <marker/> |
+ <stop/> |
+ <filter> |
+ <feTurbulence></feTurbulence> |
+ </filter> |
+ </defs> |
+</svg> |
+<div id=log></div> |
+<script> |
+var svg = document.querySelector("svg"); |
+ |
+// test length values |
+var EPSILON = Math.pow(2, -24); // float epsilon |
+var whitespace = [ "", " ", " ", "\r\n\t ", "\f" ]; |
+var validunits = [ "", "em", "ex", "px", "in", "cm", "mm", "pt", "pc", "%" ]; |
+ |
+// This test was split out from whitespace-length.html because the trybots were too slow. |
+ |
+testType("<length>", |
+ svg, |
+ "x", |
+ 0, // expected default value |
+ whitespace, |
+ [], // valid |
+ [ Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, "fnord", "E", "e", "e+", "E-", "-", "+", "-.", ".-", ".", "+.", ".E0", "e1" ], // invalid |
+ validunits, |
+ [], // garbage |
+ function(elm, value) { assert_approx_equals(elm.x.baseVal.valueInSpecifiedUnits, parseFloat(value), EPSILON); }, |
+ function(elm, expected) { assert_approx_equals(elm.x.baseVal.value, expected, EPSILON); } ); |
+ |
+</script> |