1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Strict//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
5 <title>Test for Bug
39139</title>
6 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
7 <meta name=
"viewport" content=
"initial-scale=0.60, minimum-scale=0.60, maximum-scale=0.60">
8 <style type=
"text/css">
11 font-family: 'Lucida Grande', Verdana
, Arial
;
21 Setting the perspective of the contents of the stage
22 but not the stage itself
25 -webkit-perspective: 800;
32 /* Ensure that we're in 3D space */
33 -webkit-transform-style: preserve-3d
;
35 Make the whole set of rows use the x-axis spin animation
36 for a duration of 7 seconds, running infinitely and linearly
38 -webkit-animation-name: x-spin
;
39 -webkit-animation-duration: 7s;
40 -webkit-animation-iteration-count: infinite
;
41 -webkit-animation-timing-function: linear
;
48 -webkit-transform-style: preserve-3d
;
49 -webkit-animation-iteration-count: infinite
;
50 -webkit-animation-timing-function: linear
;
53 .ring > :nth-child(odd) {
54 background-color: #995C7F;
57 .ring > :nth-child(even) {
58 background-color: #835A99;
67 color: rgba
(0,0,0,0.9);
68 -webkit-border-radius: 10px;
72 font-family: 'Georgia', serif
;
80 Set up each row to have a different animation duration
81 and alternating y-axis rotation directions.
84 -webkit-animation-name: y-spin
;
85 -webkit-animation-duration: 5s;
89 -webkit-animation-name: back-y-spin
;
90 -webkit-animation-duration: 4s;
94 -webkit-animation-name: y-spin
;
95 -webkit-animation-duration: 3s;
100 Here we define each of the three individual animations that
101 we will be using to have our 3D rotation effect. The first
102 animation will perform a full rotation on the x-axis, we'll
103 use that on the whole set of objects. The second and third
104 animations will perform a full rotation on the y-axis in
105 opposite directions, alternating directions between rows.
107 Note that you currently have to specify an intermediate step
108 for rotations even when you are using individual transformation
112 @
-webkit-keyframes x-spin
{
113 0% { transform: rotateX
(0deg); }
114 50% { transform: rotateX
(180deg); }
115 100% { transform: rotateX
(360deg); }
118 @
-webkit-keyframes y-spin
{
119 0% { transform: rotateY
(0deg); }
120 50% { transform: rotateY
(180deg); }
121 100% { transform: rotateY
(360deg); }
124 @
-webkit-keyframes back-y-spin
{
125 0% { transform: rotateY
(360deg); }
126 50% { transform: rotateY
(180deg); }
127 100% { transform: rotateY
(0deg); }
131 <script type=
"text/javascript">
133 const POSTERS_PER_ROW
= 12;
134 const RING_RADIUS
= 200;
136 function setup_posters (row
)
138 var posterAngle
= 360 / POSTERS_PER_ROW
;
139 for (var i
= 0; i
< POSTERS_PER_ROW
; i
++) {
140 var poster
= document
.createElement('div');
141 poster
.className
= 'poster';
142 // compute and assign the transform for this poster
143 var transform
= 'rotateY(' + (posterAngle
* i
) + 'deg) translateZ(' + RING_RADIUS
+ 'px)';
144 poster
.style
.webkitTransform
= transform
;
145 // setup the number to show inside the poster
146 var content
= poster
.appendChild(document
.createElement('p'));
147 content
.textContent
= i
;
148 // add the poster to the row
149 row
.appendChild(poster
);
156 setup_posters(document
.getElementById('ring-1'));
157 setup_posters(document
.getElementById('ring-2'));
158 setup_posters(document
.getElementById('ring-3'));
161 // call init once the document is fully loaded
162 window
.addEventListener('load', init
, false);
169 <p>This is a test for
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=39139">Bug
39139: Pages
170 that use hardware acceleration don't repaint after waking computer from sleep
</a>. To test, put
171 your computer to sleep (or
"Standby", as Windows calls it). When you wake your computer up, the
172 animation below should still be running.
</p>
175 <div id=
"ring-1" class=
"ring"></div>
176 <div id=
"ring-2" class=
"ring"></div>
177 <div id=
"ring-3" class=
"ring"></div>