OLD | NEW |
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 <script> | 4 <script> |
5 | 5 |
6 test(function() { | 6 test(function() { |
7 assert_throws(TypeError(), function() { new CSSKeywordValue("") }); | 7 assert_throws(TypeError(), function() { new CSSKeywordValue("") }); |
8 }, "Constructor should throw an error if given an empty string"); | 8 }, "Constructor should throw an error if given an empty string"); |
9 | 9 |
10 test(function() { | 10 test(function() { |
11 assert_equals(new CSSKeywordValue('initial').cssString, 'initial'); | 11 assert_equals(new CSSKeywordValue('initial').cssText, 'initial'); |
12 assert_equals(new CSSKeywordValue('center').cssString, 'center'); | 12 assert_equals(new CSSKeywordValue('center').cssText, 'center'); |
13 assert_equals(new CSSKeywordValue('customLemon').cssString, 'customLemon'); | 13 assert_equals(new CSSKeywordValue('customLemon').cssText, 'customLemon'); |
14 assert_equals(new CSSKeywordValue(' Hello World').cssString, CSS.escape(' Hell
o World')); | 14 assert_equals(new CSSKeywordValue(' Hello World').cssText, CSS.escape(' Hello
World')); |
15 assert_equals(new CSSKeywordValue('3').cssString, CSS.escape('3')); | 15 assert_equals(new CSSKeywordValue('3').cssText, CSS.escape('3')); |
16 }, 'cssString returns a string with a format similar to CSS.escape. This test al
so ' + | 16 }, 'cssText returns a string with a format similar to CSS.escape. This test also
' + |
17 'implies that toCSSValue supports all keywords including custom identifiers'
); | 17 'implies that toCSSValue supports all keywords including custom identifiers'
); |
18 | 18 |
19 test(function() { | 19 test(function() { |
20 assert_equals(new CSSKeywordValue('initial').keywordValue, 'initial'); | 20 assert_equals(new CSSKeywordValue('initial').keywordValue, 'initial'); |
21 assert_equals(new CSSKeywordValue('center').keywordValue, 'center'); | 21 assert_equals(new CSSKeywordValue('center').keywordValue, 'center'); |
22 assert_equals(new CSSKeywordValue('customLemon').keywordValue, 'customLemon'); | 22 assert_equals(new CSSKeywordValue('customLemon').keywordValue, 'customLemon'); |
23 assert_equals(new CSSKeywordValue(' Hello World').keywordValue, ' Hello World'
); | 23 assert_equals(new CSSKeywordValue(' Hello World').keywordValue, ' Hello World'
); |
24 assert_equals(new CSSKeywordValue('3').keywordValue, '3'); | 24 assert_equals(new CSSKeywordValue('3').keywordValue, '3'); |
25 }, 'keywordValue returns a string equal to the string used in the constructor'); | 25 }, 'keywordValue returns a string equal to the string used in the constructor'); |
26 | 26 |
27 </script> | 27 </script> |
28 <body> | 28 <body> |
29 </body> | 29 </body> |
OLD | NEW |