Index: LayoutTests/fast/svg/whitespace-integer.html |
diff --git a/LayoutTests/fast/svg/whitespace-integer.html b/LayoutTests/fast/svg/whitespace-integer.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c09d961eb2e498f45ecf343e69e3c86318b79bb8 |
--- /dev/null |
+++ b/LayoutTests/fast/svg/whitespace-integer.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 garbage = [ "a", "e", "foo", ")90" ]; |
+var validunits = [ "", "em", "ex", "px", "in", "cm", "mm", "pt", "pc", "%" ]; |
+ |
+testType("<integer>", |
+ document.getElementsByTagName("feTurbulence")[0], // workaround for broken querySelector on camelcased elements |
+ "numOctaves", |
+ 0, // expected default value (FIXME: should be 1) |
+ whitespace, |
+ [ "-47", "0", "+32", "1241245" ], |
+ [ Number.NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, "fnord", "E", "e", "e+", "E-", "-", "+", "-.", ".-", ".", "+.", ".E0", "e1", "+17E-1", "17e+2", "0.35", "1e-10", ".1" ], |
+ [""], // valid units |
+ garbage, |
+ function(elm, value) { assert_equals(elm.numOctaves.baseVal, parseInt(value)); }, |
+ function(elm, expected) { assert_equals(elm.numOctaves.baseVal, expected); } ); |
+ |
+ |
+</script> |