blob: 652d784dd1c578f5b36bb6885651444f26c7673a [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
<script src="resources/shadow-dom.js"></script>
</head>
<body>
<p id="description"></p>
<div id="sandbox">
<details id="details">
<div id="details-child"></div>
<summary id="summary">
<div id="summary-child"></div>
</summary>
</details>
</div>
<pre id="console"></pre>
<script>
['sandbox', 'details', 'details-child', 'summary', 'summary-child'].forEach(function(path) {
getNodeInComposedTree(path).addEventListener('click', function(event) {
debug('\nevent.path on node ' + dumpNode(event.currentTarget));
debug(dumpNodeList(event.path));
});
});
var clickEvent = document.createEvent("MouseEvents");
clickEvent.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
debug("\nDispaching a click event on #details-child");
document.getElementById('details-child').dispatchEvent(clickEvent);
debug("\nDispaching a click event on #summary-child");
document.getElementById('summary-child').dispatchEvent(clickEvent);
</script>
</body>
</html>