test_bug1534562.html (1651B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1534562 5 --> 6 <head> 7 <meta charset="utf-8"> 8 <title>Test for Bug 1534562</title> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <script src="/tests/SimpleTest/EventUtils.js"></script> 11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 12 <script type="application/javascript"> 13 14 /** Test for Bug 1534562 */ 15 16 function runTest() { 17 var host = document.getElementById("host"); 18 var shadow = host.attachShadow({mode: 'open'}); 19 var shadowDiv = document.createElement('div'); 20 shadowDiv.style.cssText = "height: 100%; width: 100%"; 21 shadowDiv.onpointerdown = function (e) { 22 shadowDiv.setPointerCapture(e.pointerId); 23 }; 24 var shadowDivGotPointerMove = false; 25 shadowDiv.onpointermove = function(e) { 26 shadowDivGotPointerMove = true; 27 } 28 shadow.appendChild(shadowDiv); 29 host.offsetLeft; // Flush layout. 30 31 synthesizeMouseAtCenter(shadowDiv, { type: "mousedown" }); 32 synthesizeMouseAtCenter(document.getElementById("lightDOM"), { type: "mousemove" }); 33 ok(shadowDivGotPointerMove, "shadowDiv should have got pointermove event."); 34 synthesizeMouseAtCenter(document.getElementById("lightDOM"), { type: "mouseup" }); 35 SimpleTest.finish(); 36 } 37 38 SimpleTest.waitForExplicitFinish(); 39 SimpleTest.waitForFocus(runTest); 40 41 42 </script> 43 </head> 44 <body> 45 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1534562">Mozilla Bug 1534562</a> 46 <div id="host" style="height: 50px; width: 50px;"> 47 </div> 48 <div id="lightDOM" style="height: 50px; width: 50px;"> 49 </div> 50 </body> 51 </html>