Chromium Code Reviews| Index: LayoutTests/touchadjustment/simple-shadow-dom.html |
| diff --git a/LayoutTests/touchadjustment/simple-shadow-dom.html b/LayoutTests/touchadjustment/simple-shadow-dom.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..47d7974b3bd97d71b13a980bb6f528855b8a3500 |
| --- /dev/null |
| +++ b/LayoutTests/touchadjustment/simple-shadow-dom.html |
| @@ -0,0 +1,55 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
|
Rick Byers
2014/07/07 18:25:44
nit: for new tests we generally avoid adding any u
Zeeshan Qureshi
2014/07/09 16:10:15
Oh I thought you needed the tags if you added <hea
|
| +<style> |
| +#targetDiv { |
| + background: #00f; |
| + height: 100px; |
| + width: 100px; |
| + position: absolute; |
| + left: 0px; |
| + top: 0px; |
| +} |
| +</style> |
| +</head> |
| +<body> |
| +<div id="targetDiv"></div> |
| + |
| +<script src="../resources/js-test.js"></script> |
| +<script src="resources/touchadjustment.js"></script> |
| +<script> |
| +function addShadowDOM() { |
| + var targetDiv = document.getElementById("targetDiv"); |
| + var root = targetDiv.createShadowRoot(); |
| + var shadowDiv = document.createElement("div"); |
| + shadowDiv.style.width = "50px"; |
| + shadowDiv.style.height = "50px"; |
| + shadowDiv.style.background = "#ff0"; |
| + shadowDiv.style.position = "absolute"; |
| + shadowDiv.style.left = "0px"; |
| + shadowDiv.style.top = "0px"; |
| + shadowDiv.id = 'shadowDiv'; |
| + shadowDiv.addEventListener('click', function() {}, false); |
| + root.appendChild(shadowDiv); |
| + return shadowDiv; |
| +} |
| + |
| +function runTouchTests() { |
| + var shadowDiv = addShadowDOM(); |
| + element = document.getElementById("targetDiv"); |
| + element.addEventListener('click', function() {}, false); |
|
Rick Byers
2014/07/07 18:25:44
what are these two handlers for? Are you just try
Zeeshan Qureshi
2014/07/09 16:10:14
Yes, I borrowed this from the existing shadow dom
|
| + document.addEventListener('click', function() {}, false); |
| + testTouchPoint(touchPoint(25, 25, 10), shadowDiv, /* allowTextNodes */ false, /* allowShadowDOM */ true); |
| +} |
| + |
| +function runTests() |
| +{ |
| + if (window.testRunner && window.internals && internals.touchNodeAdjustedToBestClickableNode) { |
| + description('Test that a hit right in the middle of a shadow dom node returns it and not its host.') |
| + runTouchTests(); |
| + } |
| +} |
| +runTests(); |
| +</script> |
| +</body> |
| +</html> |