Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / touchadjustment / context-menu-shadow-node.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <title>Touch Adjustment : Handle long press on a shadow DOM element - bug 96313</title>
5     <script src="../resources/js-test.js"></script>
6     <script src="resources/touchadjustment.js"></script>
7     <style>
8         #sandbox {
9             background: #00f;
10             position: absolute;
11             top: 0px;
12             left: 0px;
13             width: 100px;
14             height: 100px;
15         }
16         #description {
17           margin-top: 110px;
18         }
19     </style>
20 </head>
21
22 <body>
23
24 <div id="sandbox"></div>
25 <p id='description'></p>
26 <div id='console'></div>
27
28 <script>
29     var sandbox = document.getElementById('sandbox');
30
31     function addShadowDOM() {
32         var targetDiv = document.getElementById("sandbox");
33         var root = targetDiv.createShadowRoot();
34         var shadowDiv = document.createElement("div");
35         shadowDiv.style.width = "20px";
36         shadowDiv.style.height = "20px";
37         shadowDiv.style.background = "#ff0";
38         shadowDiv.style.position = "absolute";
39         shadowDiv.style.right = "10px";
40         shadowDiv.style.top = "10px";
41         root.appendChild(shadowDiv);
42     }
43
44     function runTests()
45     {
46         if (window.testRunner && window.internals && internals.touchNodeAdjustedToBestContextMenuNode) {
47             description('Test touch adjustment for context-menu gestures on a shadow-DOM element.');
48             addShadowDOM();
49             // Test that a long press centered on a shadow-DOM element does not crash.
50             testTouchPointContextMenu(touchPoint(80, 20, 10), null);
51         }
52     }
53     runTests();
54 </script>
55 </body>
56 </html>