Index: third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_append.html |
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_append.html b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_append.html |
index 045c4f21a40977651fd68c4bbef7ac8b31d085bb..69a1d47caf0b79139fa17267f06dc6c21a112972 100644 |
--- a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_append.html |
+++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_append.html |
@@ -6,7 +6,16 @@ |
<script> |
-// Append |
+test(function() { |
+ testElement.style.animationIterationCount = ""; |
+ testElement.styleMap.append('animation-iteration-count', new CSSNumberValue(1)); |
+ |
+ assert_equals(testElement.style.animationIterationCount, "1"); |
+ var result = testElement.styleMap.getAll('animation-iteration-count'); |
+ assert_equals(result.length, 1); |
+ assert_equals(result[0].value, 1); |
+}, "Appending a value to an unset property works"); |
+ |
test(function() { |
assert_throws(new TypeError(), function() { |
testElement.styleMap.append('width', new CSSSimpleLength(60, 'px')); |
@@ -14,9 +23,8 @@ test(function() { |
}, "Attempting to append to a property that doesn't support multiple values throws"); |
test(function() { |
- // TODO(meade): Use a property that supports multiple values when that is available. |
assert_throws(new TypeError(), function() { |
- testElement.styleMap.append('width', new CSSNumberValue(70)); |
+ testElement.styleMap.append('animation-iteration-count', new CSSSimpleLength(70, 'px')); |
}); |
}, "Appending an invalid type to a property throws"); |
@@ -26,4 +34,28 @@ test(function() { |
}); |
}, "Attempting to append to an invalid property throws"); |
+test(function() { |
+ assert_throws(new TypeError(), function() { |
+ testElement.styleMap.append('animation-iteration-count', null); |
+ }); |
+ // Force a style recalc. |
+ getComputedStyle(testElement).animationIterationCount; |
+}, "Appending null to a property does not crash"); |
+ |
+test(function() { |
+ testElement.style.animationIterationCount = ""; |
+ testElement.styleMap.append('animation-iteration-count', new CSSNumberValue(4)); |
+ testElement.styleMap.append('animation-iteration-count', new CSSNumberValue(6.9)); |
+ |
+ assert_equals(testElement.style.animationIterationCount, "4, 6.9"); |
+}, "Appending two valid types of the same type works."); |
+ |
+test(function() { |
+ testElement.style.animationIterationCount = ""; |
+ testElement.styleMap.append('animation-iteration-count', new CSSNumberValue(4)); |
+ testElement.styleMap.append('animation-iteration-count', new CSSKeywordValue("infinite")); |
+ |
+ assert_equals(testElement.style.animationIterationCount, "4, infinite"); |
+}, "Appending two different types that are both valid works."); |
+ |
</script> |