OLD | NEW |
| (Empty) |
1 <pre id="console"></pre> | |
2 <script> | |
3 if (window.testRunner) | |
4 testRunner.dumpAsText(); | |
5 | |
6 function log(message) | |
7 { | |
8 document.getElementById("console").appendChild(document.createTextNode(m
essage + "\n")); | |
9 } | |
10 | |
11 function test(declaration, expectedHyphenateLimit, after) | |
12 { | |
13 var element = document.createElement("div"); | |
14 element.style.cssText = declaration; | |
15 var hyphenateLimit = after ? element.style.webkitHyphenateLimitAfter : e
lement.style.webkitHyphenateLimitBefore; | |
16 if (hyphenateLimit === expectedHyphenateLimit) | |
17 log("PASS: '" + declaration + "' parsed as '" + hyphenateLimit + "'"
); | |
18 else | |
19 log("FAIL: '" + declaration + "' parsed as '" + hyphenateLimit + "'"
); | |
20 } | |
21 | |
22 test('-webkit-hyphenate-limit-before: initial;', 'initial'); | |
23 test('-webkit-hyphenate-limit-before: inherit;', 'inherit'); | |
24 test('-webkit-hyphenate-limit-before: auto;', 'auto'); | |
25 test('-webkit-hyphenate-limit-before: 0;', '0'); | |
26 test('-webkit-hyphenate-limit-before: 4;', '4'); | |
27 test('-webkit-hyphenate-limit-before: 2 2;', ''); | |
28 test('-webkit-hyphenate-limit-before: 2px;', ''); | |
29 test('-webkit-hyphenate-limit-before: -1;', ''); | |
30 test('-webkit-hyphenate-limit-before: "1";', ''); | |
31 | |
32 log(""); | |
33 | |
34 test('-webkit-hyphenate-limit-after: initial;', 'initial', true); | |
35 test('-webkit-hyphenate-limit-after: inherit;', 'inherit', true); | |
36 test('-webkit-hyphenate-limit-after: auto;', 'auto', true); | |
37 test('-webkit-hyphenate-limit-after: 0;', '0', true); | |
38 test('-webkit-hyphenate-limit-after: 4;', '4', true); | |
39 test('-webkit-hyphenate-limit-after: 2 2;', '', true); | |
40 test('-webkit-hyphenate-limit-after: 2px;', '', true); | |
41 test('-webkit-hyphenate-limit-after: -1;', '', true); | |
42 test('-webkit-hyphenate-limit-after: "1";', '', true); | |
43 </script> | |
OLD | NEW |