| OLD | NEW |
| 1 "use strict"; | 1 "use strict"; |
| 2 | 2 |
| 3 // Utility functions and common keyframe test data. | 3 // Utility functions and common keyframe test data. |
| 4 | 4 |
| 5 // ------------------------------ | 5 // ------------------------------ |
| 6 // Helper functions | 6 // Helper functions |
| 7 // ------------------------------ | 7 // ------------------------------ |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Test equality between two lists of computed keyframes | 10 * Test equality between two lists of computed keyframes |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 { offset: 1, left: "40px" }], | 250 { offset: 1, left: "40px" }], |
| 251 output: [{ offset: 0, computedOffset: 0, easing: "linear", left: "10px" }, | 251 output: [{ offset: 0, computedOffset: 0, easing: "linear", left: "10px" }, |
| 252 { offset: 0, computedOffset: 0, easing: "linear", top: "20px" }, | 252 { offset: 0, computedOffset: 0, easing: "linear", top: "20px" }, |
| 253 { offset: 1, computedOffset: 1, easing: "linear", top: "30px" }, | 253 { offset: 1, computedOffset: 1, easing: "linear", top: "30px" }, |
| 254 { offset: 1, computedOffset: 1, easing: "linear", left: "40px" }] | 254 { offset: 1, computedOffset: 1, easing: "linear", left: "40px" }] |
| 255 }, | 255 }, |
| 256 { desc: "a single keyframe sequence with omitted offsets", | 256 { desc: "a single keyframe sequence with omitted offsets", |
| 257 input: [{ left: "10px" }], | 257 input: [{ left: "10px" }], |
| 258 output: [{ offset: null, computedOffset: 1, easing: "linear", | 258 output: [{ offset: null, computedOffset: 1, easing: "linear", |
| 259 left: "10px" }] }, | 259 left: "10px" }] }, |
| 260 { desc: "a single keyframe sequence with string offset", |
| 261 input: [{ offset: '0.5', left: "10px" }], |
| 262 output: [{ offset: 0.5, computedOffset: 1, easing: "linear", |
| 263 left: "10px" }] }, |
| 260 { desc: "a one property keyframe sequence with some omitted offsets", | 264 { desc: "a one property keyframe sequence with some omitted offsets", |
| 261 input: [{ offset: 0.00, left: "10px" }, | 265 input: [{ offset: 0.00, left: "10px" }, |
| 262 { offset: 0.25, left: "20px" }, | 266 { offset: 0.25, left: "20px" }, |
| 263 { left: "30px" }, | 267 { left: "30px" }, |
| 264 { left: "40px" }, | 268 { left: "40px" }, |
| 265 { offset: 1.00, left: "50px" }], | 269 { offset: 1.00, left: "50px" }], |
| 266 output: [{ offset: 0.00, computedOffset: 0.00, easing: "linear", | 270 output: [{ offset: 0.00, computedOffset: 0.00, easing: "linear", |
| 267 left: "10px" }, | 271 left: "10px" }, |
| 268 { offset: 0.25, computedOffset: 0.25, easing: "linear", | 272 { offset: 0.25, computedOffset: 0.25, easing: "linear", |
| 269 left: "20px" }, | 273 left: "20px" }, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 { offset: 1.0, easing: "step-end", left: "50px" }, | 318 { offset: 1.0, easing: "step-end", left: "50px" }, |
| 315 { offset: 1.0, easing: "step-end", top: "60px" }], | 319 { offset: 1.0, easing: "step-end", top: "60px" }], |
| 316 output: [{ offset: 0.0, computedOffset: 0.0, easing: "ease", | 320 output: [{ offset: 0.0, computedOffset: 0.0, easing: "ease", |
| 317 left: "10px" }, | 321 left: "10px" }, |
| 318 { offset: 0.0, computedOffset: 0.0, easing: "ease", | 322 { offset: 0.0, computedOffset: 0.0, easing: "ease", |
| 319 top: "20px" }, | 323 top: "20px" }, |
| 320 { offset: 0.5, computedOffset: 0.5, easing: "linear", | 324 { offset: 0.5, computedOffset: 0.5, easing: "linear", |
| 321 left: "30px" }, | 325 left: "30px" }, |
| 322 { offset: 0.5, computedOffset: 0.5, easing: "linear", | 326 { offset: 0.5, computedOffset: 0.5, easing: "linear", |
| 323 top: "40px" }, | 327 top: "40px" }, |
| 324 { offset: 1.0, computedOffset: 1.0, easing: "step-end", | 328 { offset: 1.0, computedOffset: 1.0, easing: "steps(1)", |
| 325 left: "50px" }, | 329 left: "50px" }, |
| 326 { offset: 1.0, computedOffset: 1.0, easing: "step-end", | 330 { offset: 1.0, computedOffset: 1.0, easing: "steps(1)", |
| 327 top: "60px" }] }, | 331 top: "60px" }] }, |
| 328 { desc: "a keyframe sequence with different composite values, but the" | 332 { desc: "a keyframe sequence with different composite values, but the" |
| 329 + " same composite value for a given offset", | 333 + " same composite value for a given offset", |
| 330 input: [{ offset: 0.0, composite: "replace", left: "10px" }, | 334 input: [{ offset: 0.0, composite: "replace", left: "10px" }, |
| 331 { offset: 0.0, composite: "replace", top: "20px" }, | 335 { offset: 0.0, composite: "replace", top: "20px" }, |
| 332 { offset: 0.5, composite: "add", left: "30px" }, | 336 { offset: 0.5, composite: "add", left: "30px" }, |
| 333 { offset: 0.5, composite: "add", top: "40px" }, | 337 { offset: 0.5, composite: "add", top: "40px" }, |
| 334 { offset: 1.0, composite: "replace", left: "50px" }, | 338 { offset: 1.0, composite: "replace", left: "50px" }, |
| 335 { offset: 1.0, composite: "replace", top: "60px" }], | 339 { offset: 1.0, composite: "replace", top: "60px" }], |
| 336 output: [{ offset: 0.0, computedOffset: 0.0, easing: "linear", | 340 output: [{ offset: 0.0, computedOffset: 0.0, easing: "linear", |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 { offset: 1.0, left: "400px", easing: "ease-out" }, | 429 { offset: 1.0, left: "400px", easing: "ease-out" }, |
| 426 { offset: 1.0, left: "500px", easing: "step-end" }], | 430 { offset: 1.0, left: "500px", easing: "step-end" }], |
| 427 output: [{ offset: 0.0, computedOffset: 0.0, easing: "ease", | 431 output: [{ offset: 0.0, computedOffset: 0.0, easing: "ease", |
| 428 left: "100px" }, | 432 left: "100px" }, |
| 429 { offset: 0.0, computedOffset: 0.0, easing: "ease", | 433 { offset: 0.0, computedOffset: 0.0, easing: "ease", |
| 430 left: "200px" }, | 434 left: "200px" }, |
| 431 { offset: 0.5, computedOffset: 0.5, easing: "linear", | 435 { offset: 0.5, computedOffset: 0.5, easing: "linear", |
| 432 left: "300px" }, | 436 left: "300px" }, |
| 433 { offset: 1.0, computedOffset: 1.0, easing: "ease-out", | 437 { offset: 1.0, computedOffset: 1.0, easing: "ease-out", |
| 434 left: "400px" }, | 438 left: "400px" }, |
| 435 { offset: 1.0, computedOffset: 1.0, easing: "step-end", | 439 { offset: 1.0, computedOffset: 1.0, easing: "steps(1)", |
| 436 left: "500px" }] }, | 440 left: "500px" }] }, |
| 437 ]; | 441 ]; |
| 438 | 442 |
| 439 var gInvalidKeyframesTests = [ | 443 var gInvalidKeyframesTests = [ |
| 440 { desc: "keyframes with an out-of-bounded positive offset", | 444 { desc: "keyframes with an out-of-bounded positive offset", |
| 441 input: [ { opacity: 0 }, | 445 input: [ { opacity: 0 }, |
| 442 { opacity: 0.5, offset: 2 }, | 446 { opacity: 0.5, offset: 2 }, |
| 443 { opacity: 1 } ], | 447 { opacity: 1 } ], |
| 444 expected: { name: "TypeError" } }, | 448 expected: { name: "TypeError" } }, |
| 445 { desc: "keyframes with an out-of-bounded negative offset", | 449 { desc: "keyframes with an out-of-bounded negative offset", |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 { desc: "an 'inherit' easing", | 554 { desc: "an 'inherit' easing", |
| 551 input: { easing: "inherit" }, | 555 input: { easing: "inherit" }, |
| 552 expected: { name: "TypeError" } }, | 556 expected: { name: "TypeError" } }, |
| 553 { desc: "a variable easing", | 557 { desc: "a variable easing", |
| 554 input: { easing: "var(--x)" }, | 558 input: { easing: "var(--x)" }, |
| 555 expected: { name: "TypeError" } }, | 559 expected: { name: "TypeError" } }, |
| 556 { desc: "a multi-value easing", | 560 { desc: "a multi-value easing", |
| 557 input: { easing: "ease-in-out, ease-out" }, | 561 input: { easing: "ease-in-out, ease-out" }, |
| 558 expected: { name: "TypeError" } } | 562 expected: { name: "TypeError" } } |
| 559 ]; | 563 ]; |
| OLD | NEW |