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

Side by Side Diff: third_party/WebKit/LayoutTests/transitions/move-after-transition.html

Issue 2614883005: CSS Transitions: Fix flaky move-after-transition.html (Closed)
Patch Set: Created 3 years, 11 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 2
3 <html> 3 <html>
4 <head> 4 <head>
5 <style> 5 <style>
6 #container { 6 #container {
7 position: relative; 7 position: relative;
8 width: 400px; 8 width: 400px;
9 height: 100px; 9 height: 100px;
10 border: 1px solid black; 10 border: 1px solid black;
11 } 11 }
12
13 .box { 12 .box {
14 position: absolute; 13 position: absolute;
15 width: 100px; 14 width: 100px;
16 height: 100px; 15 height: 100px;
17 background-color: green; 16 background-color: green;
18 } 17 }
19
20 .indicator { 18 .indicator {
21 left: 150px; 19 left: 150px;
22 top: 0; 20 top: 0;
23 background-color: red; 21 background-color: red;
24 } 22 }
25 #container.moved .software { 23 #container.moved .software {
26 left: 300px; 24 left: 300px;
27 } 25 }
28
29 #container.moved .hardware { 26 #container.moved .hardware {
30 transform: translateX(300px); 27 transform: translateX(300px);
31 } 28 }
32
33 .hardware { 29 .hardware {
34 transform-style: preserve-3d; 30 transform-style: preserve-3d;
35 -webkit-transition: transform 300ms linear; 31 transition: transform 300ms linear;
36 transform: translateX(0); 32 transform: translateX(0);
37 } 33 }
38
39 </style> 34 </style>
40 <script src="../animations/resources/animation-test-helpers.js"></script>
41 <script type="text/javascript"> 35 <script type="text/javascript">
36 'use strict';
37 function waitForCompositor() {
38 var container = document.getElementById('container');
39 return container.animate({opacity: [1, 1]}, 1).ready;
40 }
42 41
43 function testEnded() 42 function testEnded()
44 { 43 {
45 var testDiv = document.getElementById('tester'); 44 var testDiv = document.getElementById('tester');
46 testDiv.style.webkitTransitionProperty = 'none'; 45 testDiv.style.transitionProperty = 'none';
47 testDiv.style.webkitTransitionDuration = '0'; 46 testDiv.style.transitionDuration = '0';
48 47
49 testDiv.style.webkitTransform = 'translateX(150px)'; 48 testDiv.style.transform = 'translateX(150px)';
50 if (window.testRunner) 49 waitForCompositor().then(() => {
51 testRunner.notifyDone(); 50 if (window.testRunner)
51 testRunner.notifyDone();
52 });
52 } 53 }
53 54
54 function startTest() 55 function startTest()
55 { 56 {
56 if (window.testRunner) 57 if (window.testRunner)
57 testRunner.waitUntilDone(); 58 testRunner.waitUntilDone();
58 59
59 document.getElementById('tester').addEventListener('webkitTransitionEnd', testEnded, false); 60 document.body.offsetHeight; // Force style recalc
61 document.getElementById('tester').addEventListener('transitionend', testEn ded, false);
60 document.getElementById('container').className = 'moved'; 62 document.getElementById('container').className = 'moved';
61 } 63 }
62 64
63 window.addEventListener('load', startTest, false); 65 window.addEventListener('load', startTest, false);
64 </script> 66 </script>
65 </head> 67 </head>
66 <body> 68 <body>
67 69
68 <p>At the end of the test the green box should obscure the red box.</p> 70 <p>At the end of the test the green box should obscure the red box.</p>
69 <div id="container"> 71 <div id="container">
70 <div class="indicator box"></div> 72 <div class="indicator box"></div>
71 <div id="tester" class="hardware box"></div> 73 <div id="tester" class="hardware box"></div>
72 </div> 74 </div>
73 75
74 <div id="result"> 76 <div id="result">
75 </div> 77 </div>
76 78
77 </body> 79 </body>
78 </html> 80 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698