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

Side by Side Diff: third_party/WebKit/LayoutTests/typedcssom/inlinestyle/numbers.html

Issue 2274463002: [Typed OM] Add CSSValue -> CSSNumberValue conversion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test for computed style Created 4 years, 4 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
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4
5 <div id="testElement">text</div>
6
7 <script>
8
9 var gettingProperties = [
10 'animation-iteration-count',
11 'column-count',
12 'line-height',
13 'opacity',
14 'orphans',
15 'widows',
16 'z-index'
17 ];
18
19 test(function() {
20 for (var i = 0; i < gettingProperties.length; i++) {
21 var value = 10 * (i + 1);
22 testElement.style[gettingProperties[i]] = "" + value;
23 var result = testElement.styleMap.get(gettingProperties[i]);
24 assert_true(result instanceof CSSNumberValue, "result from " + gettingProper ties[i]);
25 assert_equals(result.value, value);
26 }
27 }, "Single valued CSSNumberValues can be retrieved from Inline StyleMap");
28
29 test(function() {
30 testElement.style.animationIterationCount = "6.2, 9.8, 1";
31
32 var result = testElement.styleMap.getAll('animation-iteration-count');
33 assert_equals(result.length, 3);
34 assert_true(result[0] instanceof CSSNumberValue);
35 assert_true(result[1] instanceof CSSNumberValue);
36 assert_true(result[2] instanceof CSSNumberValue);
37 assert_equals(result[0].value, 6.2);
38 assert_equals(result[1].value, 9.8);
39 assert_equals(result[2].value, 1);
40 }, "Can retrieve list of CSSNumberValues from list-valued property");
41
42 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698