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

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

Issue 2097093002: [Typed OM] Rename cssString methods to cssText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rename-transformvalue
Patch Set: Update usage in csspaint logging for tests 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 // TODO(meade): Make this a test case for a property with multiple values when that is supported. 10 // TODO(meade): Make this a test case for a property with multiple values when that is supported.
11 testElement.styleMap.set('width', new CSSSimpleLength(90, 'px')); 11 testElement.styleMap.set('width', new CSSSimpleLength(90, 'px'));
12 var result = testElement.styleMap.getAll('width'); 12 var result = testElement.styleMap.getAll('width');
13 assert_equals(result.length, 1); 13 assert_equals(result.length, 1);
14 assert_equals(result[0].cssString, '90px'); 14 assert_equals(result[0].cssText, '90px');
15 }, "getAll() returns a list of values"); 15 }, "getAll() returns a list of values");
16 16
17 test(function() { 17 test(function() {
18 testElement.styleMap.set('width', new CSSSimpleLength(100, 'px')); 18 testElement.styleMap.set('width', new CSSSimpleLength(100, 'px'));
19 var lowerResult = testElement.styleMap.getAll('width'); 19 var lowerResult = testElement.styleMap.getAll('width');
20 var upperResult = testElement.styleMap.getAll('WIDTH'); 20 var upperResult = testElement.styleMap.getAll('WIDTH');
21 var mixedResult = testElement.styleMap.getAll('wIdTh'); 21 var mixedResult = testElement.styleMap.getAll('wIdTh');
22 22
23 assert_equals(lowerResult.length, 1); 23 assert_equals(lowerResult.length, 1);
24 assert_equals(upperResult.length, 1); 24 assert_equals(upperResult.length, 1);
25 assert_equals(mixedResult.length, 1); 25 assert_equals(mixedResult.length, 1);
26 assert_equals(lowerResult[0].cssString, '100px'); 26 assert_equals(lowerResult[0].cssText, '100px');
27 assert_equals(upperResult[0].cssString, '100px'); 27 assert_equals(upperResult[0].cssText, '100px');
28 assert_equals(mixedResult[0].cssString, '100px'); 28 assert_equals(mixedResult[0].cssText, '100px');
29 }, "getAll is case-insensitive for the property name"); 29 }, "getAll is case-insensitive for the property name");
30 30
31 test(function() { 31 test(function() {
32 assert_array_equals(testElement.styleMap.getAll('height'), []); 32 assert_array_equals(testElement.styleMap.getAll('height'), []);
33 }, "getAll() returns an empty list if the property isn't set"); 33 }, "getAll() returns an empty list if the property isn't set");
34 34
35 test(function() { 35 test(function() {
36 assert_throws(new TypeError(), function() { 36 assert_throws(new TypeError(), function() {
37 testElement.styleMap.getAll('lemons'); 37 testElement.styleMap.getAll('lemons');
38 }); 38 });
39 }, "getAll() throws if you try to get an invalid property"); 39 }, "getAll() throws if you try to get an invalid property");
40 40
41 </script> 41 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698