Index: third_party/WebKit/LayoutTests/typedcssom/inlinestyle/numbers.html |
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/numbers.html b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/numbers.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..31b1308156ad13673131b25f0ae28a750ecd0e22 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/numbers.html |
@@ -0,0 +1,42 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+ |
+<div id="testElement">text</div> |
+ |
+<script> |
+ |
+var gettingProperties = [ |
+ 'animation-iteration-count', |
+ 'column-count', |
+ 'line-height', |
+ 'opacity', |
+ 'orphans', |
+ 'widows', |
+ 'z-index' |
+]; |
+ |
+test(function() { |
+ for (var i = 0; i < gettingProperties.length; i++) { |
+ var value = 10 * (i + 1); |
+ testElement.style[gettingProperties[i]] = "" + value; |
+ var result = testElement.styleMap.get(gettingProperties[i]); |
+ assert_true(result instanceof CSSNumberValue, "result from " + gettingProperties[i]); |
+ assert_equals(result.value, value); |
+ } |
+}, "Single valued CSSNumberValues can be retrieved from Inline StyleMap"); |
+ |
+test(function() { |
+ testElement.style.animationIterationCount = "6.2, 9.8, 1"; |
+ |
+ var result = testElement.styleMap.getAll('animation-iteration-count'); |
+ assert_equals(result.length, 3); |
+ assert_true(result[0] instanceof CSSNumberValue); |
+ assert_true(result[1] instanceof CSSNumberValue); |
+ assert_true(result[2] instanceof CSSNumberValue); |
+ assert_equals(result[0].value, 6.2); |
+ assert_equals(result[1].value, 9.8); |
+ assert_equals(result[2].value, 1); |
+}, "Can retrieve list of CSSNumberValues from list-valued property"); |
+ |
+</script> |