Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / touch / compositor-touch-hit-rects-trigger-commit.html
blob3ad150a7381f9c16a95260ea8cf3fb14c712001a
1 <!DOCTYPE html>
2 <html>
3 <head>
5 <style>
6 #touchElement {
7 width: 20px;
8 height: 20px;
10 </style>
12 </head>
13 <body>
15 <p id="description">
16 This tests checks that deferred compositing is still invoked when nothing except touch hit rects change.
17 The trickiness is that touch hit rects cannot be recomputed until after compositing is updated, so
18 there is a risk of accidentally skipping updating touch rects unless we ping the compositor correctly.
19 </p>
21 <div id="touchElement"></div>
23 <pre id="result"></pre>
25 <script>
27 function dummyListener() { }
29 if (window.testRunner)
30 testRunner.dumpAsText();
32 if (window.internals) {
33 window.internals.forceCompositingUpdate(document);
34 document.getElementById("touchElement").addEventListener("touchmove", dummyListener, false);
35 window.internals.forceCompositingUpdate(document);
37 var rects = window.internals.touchEventTargetLayerRects(document);
38 if (rects && rects.length == 1)
39 document.getElementById("result").innerHTML = "PASS";
40 else
41 document.getElementById("result").innerHTML = "FAIL";
43 } else {
44 document.getElementById("result").innerHTML = "This test can only be run as a layout test.";
47 </script>
48 </body>