Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / compositing / geometry / repaint-foreground-layer.html
blob07bfe5524d16fd09af9f79d52426461e86d49084
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style type="text/css">
5 .box {
6 position: relative;
7 display: inline-block;
8 margin: 30px;
9 width: 200px;
10 height: 200px;
11 transform: translateZ(0);
14 .main {
15 border: 40px solid gray;
16 background-color: red;
17 line-height: 0;
18 outline: 20px solid transparent; /* Makes compositing layers larger */
21 .child {
22 position: absolute;
23 width: 150px;
24 height: 150px;
25 padding: 20px;
26 transform: translateZ(0);
29 .negative {
30 z-index: -1;
31 top: 0;
32 left: 0;
33 height: 10px;
34 width: 10px;
37 img {
38 display: inline-block;
39 background-color: green;
40 height: 100px;
41 width: 100px;
44 @-webkit-keyframes fade {
45 from { background-color: green; }
46 to { background-color: orange; }
49 .embiggener {
50 position: absolute;
51 height: 10px;
52 width: 10px;
53 top: -50px;
54 left: -50px;
55 background-color: blue;
58 #layer-tree {
59 opacity: 0; /* hide from pixel test */
62 </style>
63 <script type="text/javascript" charset="utf-8">
64 if (window.testRunner) {
65 testRunner.dumpAsTextWithPixelResults();
66 testRunner.waitUntilDone();
69 function repaint()
71 var imagesToRepaint = document.querySelectorAll('.repainted');
72 for (var i = 0; i < imagesToRepaint.length; ++i) {
73 var currImage = imagesToRepaint[i];
74 currImage.style.backgroundColor = 'orange';
77 if (window.testRunner)
78 testRunner.notifyDone();
81 window.addEventListener('load', function() {
82 window.setTimeout(repaint, 0);
83 }, false);
84 </script>
85 </head>
86 <body>
88 <!-- Both boxes should look the same. You should see no red. -->
89 <div class="main box">
90 <img><img><img class="repainted"><img>
91 <div class="negative child"></div>
92 </div>
94 <div class="main box" style="overflow: hidden;">
95 <img><img><img class="repainted"><img>
96 <div class="negative child"></div>
97 </div>
99 <pre id="layer-tree"></pre>
100 </body>
101 </html>