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

Side by Side Diff: third_party/WebKit/LayoutTests/transitions/opacity-transition-zindex.html

Issue 2591623002: CSS Transition: Fix flaky opacity-transition-zindex.html (Closed)
Patch Set: no classes Created 3 years, 12 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 * {
7 margin: 0;
8 }
9 #container {
7 position: relative; 10 position: relative;
8 height: 300px; 11 height: 300px;
9 width: 300px; 12 width: 300px;
10 margin: 10px; 13 margin: 10px;
11 background-color: green; 14 background-color: green;
15 opacity: 0.5;
12 transition-property: opacity; 16 transition-property: opacity;
13 transition-timing-function: linear; 17 transition-timing-function: linear;
14 transition-duration: 5s; 18 transition-duration: 5s;
15 } 19 }
16
17 #first {
18 opacity: 0.5;
19 }
20 20
21 .box { 21 #box {
22 position: absolute; 22 position: absolute;
23 left: 10px; 23 left: 10px;
24 top: 10px; 24 top: 10px;
25 height: 200px; 25 height: 200px;
26 width: 200px; 26 width: 200px;
27 background-color: blue; 27 background-color: blue;
28 } 28 }
29 29
30 .indicator { 30 #indicator {
31 position: absolute; 31 position: absolute;
32 top: 150px; 32 top: 150px;
33 left: 150px; 33 left: 150px;
34 height: 100px; 34 height: 100px;
35 width: 100px; 35 width: 100px;
36 background-color: orange; 36 background-color: orange;
37 z-index: -1; 37 z-index: -1;
38 } 38 }
39 </style> 39 </style>
40 <script> 40 <script>
41 if (window.testRunner) 41 if (window.testRunner)
42 testRunner.waitUntilDone(); 42 testRunner.waitUntilDone();
43 43
44 function waitForCompositor() {
45 var box = document.getElementById('box');
46 return box.animate({transform: ['scale(1)', 'scale(1)']}, 1).ready;
47 }
48
44 function runTest() 49 function runTest()
45 { 50 {
46 var container = document.getElementById('first'); 51 var container = document.getElementById('container');
47 container.style.opacity = 1; 52 container.style.opacity = 1;
48 53
49 // dump the tree in the middle of the transition 54 // dump the tree in the middle of the transition
50 if (window.internals) { 55 if (window.internals) {
51 window.internals.forceCompositingUpdate(document); 56 window.internals.forceCompositingUpdate(document);
52 window.internals.pauseAnimations(2.5); 57 window.internals.pauseAnimations(2.5);
53 } 58 }
54 if (window.testRunner) { 59 if (window.testRunner) {
60 waitForCompositor().then(() => {
55 testRunner.notifyDone(); 61 testRunner.notifyDone();
62 });
56 } 63 }
57 } 64 }
58 // FIXME: this should use runTransitionTest(). 65 // FIXME: this should use runTransitionTest().
59 window.addEventListener('load', runTest, false); 66 window.addEventListener('load', runTest, false);
60 </script> 67 </script>
61 </head> 68 </head>
62 <body> 69 <body>
63 70
64 <div class="container" id="first"> 71 <div id="container">
65 <div class="box"></div> 72 <div id="box"></div>
66 <div class="indicator"></div> 73 <div id="indicator"></div>
67 </div> 74 </div>
68 75
69 </body> 76 </body>
70 </html> 77 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698