summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/compositing/plugins/invalidate_rect.html
blob: b2c35fcab2d0459731c3096c9e6149c11c4714b2 (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
<!DOCTYPE html>

<html>
<head>

  <style type="text/css">
    #transform {
      -webkit-transform: rotateZ(0deg) rotateX(0deg) rotateY(0deg);
    }
  </style>

  <script>
    if (window.testRunner)
        testRunner.dumpAsText();

    var paintCount = 0;

    function onLoad()
    {
      testRunner.display();
      paintCount = 0;
      document.getElementById('testPlugin').invalidateRect(0, 0, 200, 200);
      testRunner.displayInvalidatedRegion();
      if (paintCount > 0)
          document.getElementById('result').innerHTML = "SUCCESS";
    }

    function didPaint()
    {
      paintCount++;
    }
  </script>
</head>
<body onload="onLoad();">
  This tests that NPN_InvalidateRect works correctly.

  <div id="result">FAILURE</div>

  <!-- force this page to be composited -->
  <div id="transform">
  </div>

  <!-- Move the plugin to the middle of the page. This ensures that invalidate() will invalidate the correct region. -->
  <div style="position: absolute; left: 300px; top: 300px; height: 400px; width: 400px; padding: 1em;">

    <embed id="testPlugin" type="application/x-webkit-test-netscape" width="200" height="200" onpaintevent="didPaint()" windowedPlugin="false"></embed>

  </div>
</body>
</html>