Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: third_party/WebKit/LayoutTests/animations/resources/composited-animation-test.js

Issue 2702483002: Paint some content for animated elements in composited animation tests. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 'use strict'; 1 'use strict';
2 2
3 class CompositedAnimationTestCommon { 3 class CompositedAnimationTestCommon {
4 constructor(composited) { 4 constructor(composited) {
5 this.composited = composited; 5 this.composited = composited;
6 this.tests = []; 6 this.tests = [];
7 this.nextInstanceId = 1; 7 this.nextInstanceId = 1;
8 8
9 this.createStyles(); 9 this.createStyles();
10 this.createStaticElements(); 10 this.createStaticElements();
(...skipping 16 matching lines...) Expand all
27 background: orange; 27 background: orange;
28 margin: 15px; 28 margin: 15px;
29 }`; 29 }`;
30 30
31 document.head.appendChild(styleSheet); 31 document.head.appendChild(styleSheet);
32 } 32 }
33 33
34 createStaticElements() { 34 createStaticElements() {
35 this.error = document.createElement('span'); 35 this.error = document.createElement('span');
36 this.error.style.color = 'red'; 36 this.error.style.color = 'red';
37 // The element must have some painted content in order to be composited.
38 this.error.textContent = 'x';
37 document.body.appendChild(this.error); 39 document.body.appendChild(this.error);
38 40
39 this.wrapper = document.createElement('div'); 41 this.wrapper = document.createElement('div');
40 document.body.appendChild(this.wrapper); 42 document.body.appendChild(this.wrapper);
41 } 43 }
42 44
43 createTestElements() { 45 createTestElements() {
44 this.tests.forEach(test => { 46 this.tests.forEach(test => {
45 test.testWrapper = document.createElement('div'); 47 test.testWrapper = document.createElement('div');
46 this.wrapper.appendChild(test.testWrapper); 48 this.wrapper.appendChild(test.testWrapper);
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 208 }
207 209
208 var getLinearSamples = function(n, start, end) { 210 var getLinearSamples = function(n, start, end) {
209 var arr = []; 211 var arr = [];
210 var spread = end - start; 212 var spread = end - start;
211 for (var i = 0; i <= n; i++) 213 for (var i = 0; i <= n; i++)
212 arr.push(i * spread / n + start); 214 arr.push(i * spread / n + start);
213 return arr.map(t => { return {at: t} }); 215 return arr.map(t => { return {at: t} });
214 } 216 }
215 217
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698