OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../fast/js/resources/js-test-pre.js"></script> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <script> | 7 <script> |
8 description("Test the parsing and the computed style values of the transitions p
roperties.") | 8 description("Test the parsing and the computed style values of the transitions p
roperties.") |
9 | 9 |
10 var testContainer = document.createElement("div"); | 10 var testContainer = document.createElement("div"); |
(...skipping 12 matching lines...) Expand all Loading... |
23 e.style.transition = before; | 23 e.style.transition = before; |
24 return (computedStyle.getPropertyValue('transition') == before); | 24 return (computedStyle.getPropertyValue('transition') == before); |
25 } | 25 } |
26 | 26 |
27 debug("Valid transition-property values."); | 27 debug("Valid transition-property values."); |
28 // Initial test. | 28 // Initial test. |
29 shouldBe("computedStyle.transitionProperty", "'all'"); | 29 shouldBe("computedStyle.transitionProperty", "'all'"); |
30 shouldBe("computedStyle.webkitTransitionProperty", "'all'"); | 30 shouldBe("computedStyle.webkitTransitionProperty", "'all'"); |
31 | 31 |
32 style.transitionProperty = "none"; | 32 style.transitionProperty = "none"; |
| 33 shouldNotBe("Object.keys(style).indexOf('transitionProperty')", "-1"); |
| 34 shouldNotBe("Object.keys(style).indexOf('webkitTransitionProperty')", "-1"); |
33 shouldBe("style.transitionProperty", "'none'"); | 35 shouldBe("style.transitionProperty", "'none'"); |
34 shouldBe("computedStyle.transitionProperty", "'none'"); | 36 shouldBe("computedStyle.transitionProperty", "'none'"); |
35 shouldBe("style.webkitTransitionProperty", "'none'"); | 37 shouldBe("style.webkitTransitionProperty", "'none'"); |
36 shouldBe("computedStyle.webkitTransitionProperty", "'none'"); | 38 shouldBe("computedStyle.webkitTransitionProperty", "'none'"); |
37 | 39 |
38 style.transitionProperty = "all"; | 40 style.transitionProperty = "all"; |
39 shouldBe("style.transitionProperty", "'all'"); | 41 shouldBe("style.transitionProperty", "'all'"); |
40 shouldBe("computedStyle.transitionProperty", "'all'"); | 42 shouldBe("computedStyle.transitionProperty", "'all'"); |
41 shouldBe("style.webkitTransitionProperty", "'all'"); | 43 shouldBe("style.webkitTransitionProperty", "'all'"); |
42 shouldBe("computedStyle.webkitTransitionProperty", "'all'"); | 44 shouldBe("computedStyle.webkitTransitionProperty", "'all'"); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 shouldBe("computedStyle.webkitTransitionProperty", "'all'"); | 143 shouldBe("computedStyle.webkitTransitionProperty", "'all'"); |
142 | 144 |
143 style.transitionProperty = ""; | 145 style.transitionProperty = ""; |
144 | 146 |
145 debug("Valid transition-duration values."); | 147 debug("Valid transition-duration values."); |
146 // Initial test. | 148 // Initial test. |
147 shouldBe("computedStyle.transitionDuration", "'0s'"); | 149 shouldBe("computedStyle.transitionDuration", "'0s'"); |
148 shouldBe("computedStyle.webkitTransitionDuration", "'0s'"); | 150 shouldBe("computedStyle.webkitTransitionDuration", "'0s'"); |
149 | 151 |
150 style.transitionDuration = "0s"; | 152 style.transitionDuration = "0s"; |
| 153 shouldNotBe("Object.keys(style).indexOf('transitionDuration')", "-1"); |
| 154 shouldNotBe("Object.keys(style).indexOf('webkitTransitionDuration')", "-1"); |
151 shouldBe("style.transitionDuration", "'0s'"); | 155 shouldBe("style.transitionDuration", "'0s'"); |
152 shouldBe("computedStyle.transitionDuration", "'0s'"); | 156 shouldBe("computedStyle.transitionDuration", "'0s'"); |
153 shouldBe("style.webkitTransitionDuration", "'0s'"); | 157 shouldBe("style.webkitTransitionDuration", "'0s'"); |
154 shouldBe("computedStyle.webkitTransitionDuration", "'0s'"); | 158 shouldBe("computedStyle.webkitTransitionDuration", "'0s'"); |
155 | 159 |
156 style.transitionDuration = "5s"; | 160 style.transitionDuration = "5s"; |
157 shouldBe("style.transitionDuration", "'5s'"); | 161 shouldBe("style.transitionDuration", "'5s'"); |
158 shouldBe("computedStyle.transitionDuration", "'5s'"); | 162 shouldBe("computedStyle.transitionDuration", "'5s'"); |
159 shouldBe("style.webkitTransitionDuration", "'5s'"); | 163 shouldBe("style.webkitTransitionDuration", "'5s'"); |
160 shouldBe("computedStyle.webkitTransitionDuration", "'5s'"); | 164 shouldBe("computedStyle.webkitTransitionDuration", "'5s'"); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 shouldBe("computedStyle.transitionDuration", "'0s'"); | 223 shouldBe("computedStyle.transitionDuration", "'0s'"); |
220 shouldBe("style.webkitTransitionDuration", "''"); | 224 shouldBe("style.webkitTransitionDuration", "''"); |
221 shouldBe("computedStyle.webkitTransitionDuration", "'0s'"); | 225 shouldBe("computedStyle.webkitTransitionDuration", "'0s'"); |
222 | 226 |
223 debug("Valid transition-timing-function values."); | 227 debug("Valid transition-timing-function values."); |
224 // Initial test. | 228 // Initial test. |
225 shouldBe("computedStyle.transitionTimingFunction", "'ease'"); | 229 shouldBe("computedStyle.transitionTimingFunction", "'ease'"); |
226 shouldBe("computedStyle.webkitTransitionTimingFunction", "'ease'"); | 230 shouldBe("computedStyle.webkitTransitionTimingFunction", "'ease'"); |
227 | 231 |
228 style.transitionTimingFunction = "linear"; | 232 style.transitionTimingFunction = "linear"; |
| 233 shouldNotBe("Object.keys(style).indexOf('transitionTimingFunction')", "-1"); |
| 234 shouldNotBe("Object.keys(style).indexOf('webkitTransitionTimingFunction')", "-1"
); |
229 shouldBe("style.transitionTimingFunction", "'linear'"); | 235 shouldBe("style.transitionTimingFunction", "'linear'"); |
230 shouldBe("computedStyle.transitionTimingFunction", "'linear'"); | 236 shouldBe("computedStyle.transitionTimingFunction", "'linear'"); |
231 shouldBe("style.webkitTransitionTimingFunction", "'linear'"); | 237 shouldBe("style.webkitTransitionTimingFunction", "'linear'"); |
232 shouldBe("computedStyle.webkitTransitionTimingFunction", "'linear'"); | 238 shouldBe("computedStyle.webkitTransitionTimingFunction", "'linear'"); |
233 | 239 |
234 style.transitionTimingFunction = "ease"; | 240 style.transitionTimingFunction = "ease"; |
235 shouldBe("style.transitionTimingFunction", "'ease'"); | 241 shouldBe("style.transitionTimingFunction", "'ease'"); |
236 shouldBe("computedStyle.transitionTimingFunction", "'ease'"); | 242 shouldBe("computedStyle.transitionTimingFunction", "'ease'"); |
237 shouldBe("style.webkitTransitionTimingFunction", "'ease'"); | 243 shouldBe("style.webkitTransitionTimingFunction", "'ease'"); |
238 shouldBe("computedStyle.webkitTransitionTimingFunction", "'ease'"); | 244 shouldBe("computedStyle.webkitTransitionTimingFunction", "'ease'"); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 shouldBe("computedStyle.transitionTimingFunction", "'ease'"); | 446 shouldBe("computedStyle.transitionTimingFunction", "'ease'"); |
441 shouldBe("style.webkitTransitionTimingFunction", "''"); | 447 shouldBe("style.webkitTransitionTimingFunction", "''"); |
442 shouldBe("computedStyle.webkitTransitionTimingFunction", "'ease'"); | 448 shouldBe("computedStyle.webkitTransitionTimingFunction", "'ease'"); |
443 | 449 |
444 debug("Valid transition-delay values."); | 450 debug("Valid transition-delay values."); |
445 // Initial test. | 451 // Initial test. |
446 shouldBe("computedStyle.transitionDelay", "'0s'"); | 452 shouldBe("computedStyle.transitionDelay", "'0s'"); |
447 shouldBe("computedStyle.webkitTransitionDelay", "'0s'"); | 453 shouldBe("computedStyle.webkitTransitionDelay", "'0s'"); |
448 | 454 |
449 style.transitionDelay = "0s"; | 455 style.transitionDelay = "0s"; |
| 456 shouldNotBe("Object.keys(style).indexOf('transitionDelay')", "-1"); |
| 457 shouldNotBe("Object.keys(style).indexOf('webkitTransitionDelay')", "-1"); |
450 shouldBe("style.transitionDelay", "'0s'"); | 458 shouldBe("style.transitionDelay", "'0s'"); |
451 shouldBe("computedStyle.transitionDelay", "'0s'"); | 459 shouldBe("computedStyle.transitionDelay", "'0s'"); |
452 shouldBe("style.webkitTransitionDelay", "'0s'"); | 460 shouldBe("style.webkitTransitionDelay", "'0s'"); |
453 shouldBe("computedStyle.webkitTransitionDelay", "'0s'"); | 461 shouldBe("computedStyle.webkitTransitionDelay", "'0s'"); |
454 | 462 |
455 style.transitionDelay = "5s"; | 463 style.transitionDelay = "5s"; |
456 shouldBe("style.transitionDelay", "'5s'"); | 464 shouldBe("style.transitionDelay", "'5s'"); |
457 shouldBe("computedStyle.transitionDelay", "'5s'"); | 465 shouldBe("computedStyle.transitionDelay", "'5s'"); |
458 shouldBe("style.webkitTransitionDelay", "'5s'"); | 466 shouldBe("style.webkitTransitionDelay", "'5s'"); |
459 shouldBe("computedStyle.webkitTransitionDelay", "'5s'"); | 467 shouldBe("computedStyle.webkitTransitionDelay", "'5s'"); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 shouldBe("style.webkitTransitionDelay", "''"); | 526 shouldBe("style.webkitTransitionDelay", "''"); |
519 shouldBe("computedStyle.webkitTransitionDelay", "'0s'"); | 527 shouldBe("computedStyle.webkitTransitionDelay", "'0s'"); |
520 | 528 |
521 debug("Valid transition shorthand values."); | 529 debug("Valid transition shorthand values."); |
522 style.transition = ""; | 530 style.transition = ""; |
523 // Initial test. | 531 // Initial test. |
524 shouldBe("computedStyle.transition", "'all 0s ease 0s'"); | 532 shouldBe("computedStyle.transition", "'all 0s ease 0s'"); |
525 shouldBe("computedStyle.webkitTransition", "'all 0s ease 0s'"); | 533 shouldBe("computedStyle.webkitTransition", "'all 0s ease 0s'"); |
526 | 534 |
527 style.transition = "none"; | 535 style.transition = "none"; |
| 536 shouldNotBe("Object.keys(style).indexOf('transition')", "-1"); |
| 537 shouldNotBe("Object.keys(style).indexOf('webkitTransition')", "-1"); |
528 shouldBe("style.transition", "'none'"); | 538 shouldBe("style.transition", "'none'"); |
529 shouldBe("computedStyle.transition", "'none 0s ease 0s'"); | 539 shouldBe("computedStyle.transition", "'none 0s ease 0s'"); |
530 shouldBe("style.webkitTransition", "'none'"); | 540 shouldBe("style.webkitTransition", "'none'"); |
531 shouldBe("computedStyle.webkitTransition", "'none 0s ease 0s'"); | 541 shouldBe("computedStyle.webkitTransition", "'none 0s ease 0s'"); |
532 shouldBe("checkTransitionShorthandValue()", "true"); | 542 shouldBe("checkTransitionShorthandValue()", "true"); |
533 | 543 |
534 style.transition = "none 20s"; | 544 style.transition = "none 20s"; |
535 shouldBe("style.transition", "'none 20s'"); | 545 shouldBe("style.transition", "'none 20s'"); |
536 shouldBe("computedStyle.transition", "'none 20s ease 0s'"); | 546 shouldBe("computedStyle.transition", "'none 20s ease 0s'"); |
537 shouldBe("style.webkitTransition", "'none 20s'"); | 547 shouldBe("style.webkitTransition", "'none 20s'"); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 shouldBe("style.transition", "''"); | 642 shouldBe("style.transition", "''"); |
633 shouldBe("computedStyle.transition", "'all 0s ease 0s'"); | 643 shouldBe("computedStyle.transition", "'all 0s ease 0s'"); |
634 shouldBe("style.webkitTransition", "''"); | 644 shouldBe("style.webkitTransition", "''"); |
635 shouldBe("computedStyle.webkitTransition", "'all 0s ease 0s'"); | 645 shouldBe("computedStyle.webkitTransition", "'all 0s ease 0s'"); |
636 | 646 |
637 document.body.removeChild(testContainer); | 647 document.body.removeChild(testContainer); |
638 </script> | 648 </script> |
639 <script src="../fast/js/resources/js-test-post.js"></script> | 649 <script src="../fast/js/resources/js-test-post.js"></script> |
640 </body> | 650 </body> |
641 </html> | 651 </html> |
OLD | NEW |