summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/reflections/enable-disable-compositing-reflection.html
blob: b69675fdda898216a74895aebd423e187bd7a31a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<style>
  body {
    margin: 0;
  }

  #indicator {
    position: absolute;
    width: 100px;
    height: 100px;
    left: 0px;
    top: 100px;
    background-color: red;
  }
  #box {
    width: 100px;
    height: 100px;
    background-color: green;
    -webkit-box-reflect: below;
  }
</style>
<script type="text/javascript">
  if (window.testRunner)
    testRunner.waitUntilDone();

  var compositingOn = false;
  function toggleCompositing()
  {
    compositingOn = !compositingOn;
    var box = document.getElementById('box');
    box.style.transform = compositingOn ? 'translate3d(50px, 50px, 0)'
                                            : 'none';
  }
  
  function doTest()
  {
    window.setTimeout(function() {
      toggleCompositing(); // remove
      
      window.setTimeout(function() {
        toggleCompositing(); // add
      
        if (window.testRunner)
          testRunner.notifyDone();
      }, 0);
    }, 50);
  }
  
  window.addEventListener('load', doTest, false);
</script>
<!-- You should see a single green rectangle and no red below. -->
<div id="indicator"></div>
<div id="box"></div>