Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_append.html

Issue 2096133002: [Typed OM] Add support for properties which take numbers in CSSProperties.in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync to head Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_append-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_append-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698