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

Side by Side Diff: third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_setGet.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 unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 4
5 <div id="testElement"></div> 5 <div id="testElement"></div>
6 6
7 <script> 7 <script>
8 8
9 test(function() { 9 test(function() {
10 testElement.styleMap.set('width', new CSSSimpleLength(10, 'px')); 10 testElement.styleMap.set('width', new CSSSimpleLength(10, 'px'));
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 }, "Getting a property that doesn't exist throws"); 62 }, "Getting a property that doesn't exist throws");
63 63
64 test(function() { 64 test(function() {
65 assert_throws(new TypeError(), function() { 65 assert_throws(new TypeError(), function() {
66 testElement.styleMap.set('width', null); 66 testElement.styleMap.set('width', null);
67 }); 67 });
68 // Force a style recalc. 68 // Force a style recalc.
69 getComputedStyle(testElement).width; 69 getComputedStyle(testElement).width;
70 }, "Setting null to a property does not crash"); 70 }, "Setting null to a property does not crash");
71 71
72 test(function() {
73 var values = [new CSSNumberValue(3), new CSSKeywordValue("infinite")];
74 testElement.styleMap.set('animation-iteration-count', values);
75
76 var result = testElement.styleMap.getAll('animation-iteration-count');
77 assert_equals(result.length, 2);
78 assert_true(result[0] instanceof CSSNumberValue);
79 assert_true(result[1] instanceof CSSKeywordValue);
80 assert_equals(result[0].value, 3);
81 assert_equals(result[1].value, "infinite");
82
83 assert_equals(testElement.style.animationIterationCount, "3, infinite");
84 }, "Setting a property with mixed types works if the types are all valid");
72 85
73 </script> 86 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698