| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 input: { left: ["10px", "invalid"] }, | 175 input: { left: ["10px", "invalid"] }, |
| 176 output: [{ offset: null, computedOffset: 0, easing: "linear", | 176 output: [{ offset: null, computedOffset: 0, easing: "linear", |
| 177 left: "10px" }, | 177 left: "10px" }, |
| 178 { offset: null, computedOffset: 1, easing: "linear", | 178 { offset: null, computedOffset: 1, easing: "linear", |
| 179 left: "invalid" }] }, | 179 left: "invalid" }] }, |
| 180 ]; | 180 ]; |
| 181 | 181 |
| 182 var gKeyframeSequenceTests = [ | 182 var gKeyframeSequenceTests = [ |
| 183 { desc: "a one property one keyframe sequence", | 183 { desc: "a one property one keyframe sequence", |
| 184 input: [{ offset: 1, left: "10px" }], | 184 input: [{ offset: 1, left: "10px" }], |
| 185 output: [{ offset: null, computedOffset: 1, easing: "linear", | 185 output: [{ offset: 1, computedOffset: 1, easing: "linear", |
| 186 left: "10px" }] }, | 186 left: "10px" }] }, |
| 187 { desc: "a one property two keyframe sequence", | 187 { desc: "a one property two keyframe sequence", |
| 188 input: [{ offset: 0, left: "10px" }, | 188 input: [{ offset: 0, left: "10px" }, |
| 189 { offset: 1, left: "20px" }], | 189 { offset: 1, left: "20px" }], |
| 190 output: [{ offset: 0, computedOffset: 0, easing: "linear", left: "10px" }, | 190 output: [{ offset: 0, computedOffset: 0, easing: "linear", left: "10px" }, |
| 191 { offset: 1, computedOffset: 1, easing: "linear", left: "20px" }] | 191 { offset: 1, computedOffset: 1, easing: "linear", left: "20px" }] |
| 192 }, | 192 }, |
| 193 { desc: "a two property two keyframe sequence", | 193 { desc: "a two property two keyframe sequence", |
| 194 input: [{ offset: 0, left: "10px", top: "30px" }, | 194 input: [{ offset: 0, left: "10px", top: "30px" }, |
| 195 { offset: 1, left: "20px", top: "40px" }], | 195 { offset: 1, left: "20px", top: "40px" }], |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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", | 260 { desc: "a single keyframe sequence with string offset", |
| 261 input: [{ offset: '0.5', left: "10px" }], | 261 input: [{ offset: '0.5', left: "10px" }], |
| 262 output: [{ offset: 0.5, computedOffset: 1, easing: "linear", | 262 output: [{ offset: 0.5, computedOffset: 0.5, easing: "linear", |
| 263 left: "10px" }] }, | 263 left: "10px" }] }, |
| 264 { desc: "a one property keyframe sequence with some omitted offsets", | 264 { desc: "a one property keyframe sequence with some omitted offsets", |
| 265 input: [{ offset: 0.00, left: "10px" }, | 265 input: [{ offset: 0.00, left: "10px" }, |
| 266 { offset: 0.25, left: "20px" }, | 266 { offset: 0.25, left: "20px" }, |
| 267 { left: "30px" }, | 267 { left: "30px" }, |
| 268 { left: "40px" }, | 268 { left: "40px" }, |
| 269 { offset: 1.00, left: "50px" }], | 269 { offset: 1.00, left: "50px" }], |
| 270 output: [{ offset: 0.00, computedOffset: 0.00, easing: "linear", | 270 output: [{ offset: 0.00, computedOffset: 0.00, easing: "linear", |
| 271 left: "10px" }, | 271 left: "10px" }, |
| 272 { offset: 0.25, computedOffset: 0.25, easing: "linear", | 272 { offset: 0.25, computedOffset: 0.25, easing: "linear", |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 input: [{ offset: 0.0, composite: "replace", left: "10px" }, | 334 input: [{ offset: 0.0, composite: "replace", left: "10px" }, |
| 335 { offset: 0.0, composite: "replace", top: "20px" }, | 335 { offset: 0.0, composite: "replace", top: "20px" }, |
| 336 { offset: 0.5, composite: "add", left: "30px" }, | 336 { offset: 0.5, composite: "add", left: "30px" }, |
| 337 { offset: 0.5, composite: "add", top: "40px" }, | 337 { offset: 0.5, composite: "add", top: "40px" }, |
| 338 { offset: 1.0, composite: "replace", left: "50px" }, | 338 { offset: 1.0, composite: "replace", left: "50px" }, |
| 339 { offset: 1.0, composite: "replace", top: "60px" }], | 339 { offset: 1.0, composite: "replace", top: "60px" }], |
| 340 output: [{ offset: 0.0, computedOffset: 0.0, easing: "linear", | 340 output: [{ offset: 0.0, computedOffset: 0.0, easing: "linear", |
| 341 composite: "replace", left: "10px" }, | 341 composite: "replace", left: "10px" }, |
| 342 { offset: 0.0, computedOffset: 0.0, easing: "linear", | 342 { offset: 0.0, computedOffset: 0.0, easing: "linear", |
| 343 composite: "replace", top: "20px" }, | 343 composite: "replace", top: "20px" }, |
| 344 { offset: 0.5, computedOffset: 0.0, easing: "linear", | 344 { offset: 0.5, computedOffset: 0.5, easing: "linear", |
| 345 composite: "add", left: "30px" }, | 345 composite: "add", left: "30px" }, |
| 346 { offset: 0.5, computedOffset: 0.0, easing: "linear", | 346 { offset: 0.5, computedOffset: 0.5, easing: "linear", |
| 347 composite: "add", top: "40px" }, | 347 composite: "add", top: "40px" }, |
| 348 { offset: 1.0, computedOffset: 1.0, easing: "linear", | 348 { offset: 1.0, computedOffset: 1.0, easing: "linear", |
| 349 composite: "replace", left: "50px" }, | 349 composite: "replace", left: "50px" }, |
| 350 { offset: 1.0, computedOffset: 1.0, easing: "linear", | 350 { offset: 1.0, computedOffset: 1.0, easing: "linear", |
| 351 composite: "replace", top: "60px" }] }, | 351 composite: "replace", top: "60px" }] }, |
| 352 { desc: "a one property two keyframe sequence that needs to stringify" | 352 { desc: "a one property two keyframe sequence that needs to stringify" |
| 353 + " its values", | 353 + " its values", |
| 354 input: [{ offset: 0, opacity: 0 }, | 354 input: [{ offset: 0, opacity: 0 }, |
| 355 { offset: 1, opacity: 1 }], | 355 { offset: 1, opacity: 1 }], |
| 356 output: [{ offset: 0, computedOffset: 0, easing: "linear", opacity: "0" }, | 356 output: [{ offset: 0, computedOffset: 0, easing: "linear", opacity: "0" }, |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 { desc: "an 'inherit' easing", | 554 { desc: "an 'inherit' easing", |
| 555 input: { easing: "inherit" }, | 555 input: { easing: "inherit" }, |
| 556 expected: { name: "TypeError" } }, | 556 expected: { name: "TypeError" } }, |
| 557 { desc: "a variable easing", | 557 { desc: "a variable easing", |
| 558 input: { easing: "var(--x)" }, | 558 input: { easing: "var(--x)" }, |
| 559 expected: { name: "TypeError" } }, | 559 expected: { name: "TypeError" } }, |
| 560 { desc: "a multi-value easing", | 560 { desc: "a multi-value easing", |
| 561 input: { easing: "ease-in-out, ease-out" }, | 561 input: { easing: "ease-in-out, ease-out" }, |
| 562 expected: { name: "TypeError" } } | 562 expected: { name: "TypeError" } } |
| 563 ]; | 563 ]; |
| OLD | NEW |