OLD | NEW |
---|---|
(Empty) | |
1 <body> | |
2 <p id="discription"> | |
3 This test makes sure that touch hit rects are reported for fullscreen HTML5 | |
4 video control elements when | |
5 RuntimeEnabledFeatures::overlayFullscreenVideoEnabled() is true. | |
6 </p> | |
7 <video id="video" width="300"></video> | |
8 <script src="../../../../fullscreen/full-screen-test.js"></script> | |
9 <script> | |
10 window.onload = function () { | |
11 document.addEventListener('touchstart', function() { }); | |
12 | |
13 function nameForNode(node) { | |
14 if (!node) | |
15 return "[unknown-node]"; | |
16 var name = node.nodeName; | |
17 if (node.id) | |
18 name += '#' + node.id; | |
19 return name; | |
20 } | |
21 | |
22 function logRects(fullscreen) { | |
Rick Byers
2014/06/10 21:39:57
rather than copy/paste code from the touch hit tes
| |
23 var rects = window.internals.touchEventTargetLayerRects(document); | |
24 for ( var i = 0; i < rects.length; ++i) { | |
25 var node = rects[i].layerAssociatedNode; | |
26 var r = rects[i].layerRelativeRect; | |
27 var nameSuffix = ""; | |
28 if (rects[i].layerType) | |
29 nameSuffix += " " + rects[i].layerType; | |
30 var offsetX = rects[i].associatedNodeOffsetX; | |
31 var offsetY = rects[i].associatedNodeOffsetY; | |
32 if (offsetX || offsetY) | |
33 nameSuffix += "[" + offsetX + "," + offsetY + "]" | |
34 var name = nameForNode(node); | |
35 logResult((name != '#document') == fullscreen, name + nameSuffix + " (" | |
36 + r.left + ", " + r.top + ", " + r.width + ", " + r.height + ")" ); | |
37 } | |
38 } | |
39 | |
40 consoleWrite("Should have single rect on document before fullscreen"); | |
41 logRects(false); | |
42 | |
43 waitForEvent(document, 'webkitfullscreenchange', function() { | |
44 consoleWrite("Should report another rect which is not on the document"); | |
45 logRects(true); | |
46 endTest(); | |
47 }); | |
48 | |
49 runWithKeyDown(function(){document.querySelector('#video').webkitRequestFull Screen()}); | |
50 } | |
51 </script> | |
52 </body> | |
OLD | NEW |