Index: third_party/WebKit/LayoutTests/fast/dom/inert/simulated-click-inert.html |
diff --git a/third_party/WebKit/LayoutTests/fast/dom/inert/simulated-click-inert.html b/third_party/WebKit/LayoutTests/fast/dom/inert/simulated-click-inert.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5d99a52c0dbc1d746710f374dfdad9d90b091131 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/dom/inert/simulated-click-inert.html |
@@ -0,0 +1,42 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../../resources/testharness.js"></script> |
+<script src="../../../resources/testharnessreport.js"></script> |
+</head> |
+<body onload="runTest()"> |
+ <p>Ensure that simulated click is still dispatched to an inert node. |
+ To test manually, click the CLICK ME label and verify it does change the value of the checkbox.</p> |
+ <div inert id="container"> |
+ <div> |
+ </div> |
+ <input type="checkbox" id="target"> |
+ </div> |
+ <label for="target">CLICK ME</label> |
+<script> |
+function clickOn(element) |
+{ |
+ if (!window.eventSender) |
+ return; |
+ |
+ var absoluteTop = 0; |
+ var absoluteLeft = 0; |
+ for (var parentNode = element; parentNode; parentNode = parentNode.offsetParent) { |
+ absoluteLeft += parentNode.offsetLeft; |
+ absoluteTop += parentNode.offsetTop; |
+ } |
+ |
+ var x = absoluteLeft + element.offsetWidth / 2; |
+ var y = absoluteTop + element.offsetHeight / 2; |
+ eventSender.mouseMoveTo(x, y); |
+ eventSender.mouseDown(); |
+ eventSender.mouseUp(); |
+} |
+ |
+test(function() { |
+ clickOn(document.querySelector('label')); |
+ assert_true(document.getElementById('target').checked); |
+}, "Simulated click should still be dispatched to an inert node."); |
+</script> |
+</body> |
+</html> |