| Index: third_party/WebKit/LayoutTests/fast/dom/inert/synthetic-click-inert.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/inert/synthetic-click-inert.html b/third_party/WebKit/LayoutTests/fast/dom/inert/synthetic-click-inert.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6a892a56d5220e78b6b9a95d91c0f02c19340ca3
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/dom/inert/synthetic-click-inert.html
|
| @@ -0,0 +1,38 @@
|
| +<!DOCTYPE html>
|
| +<html>
|
| +<head>
|
| +<script src="../../../resources/testharness.js"></script>
|
| +<script src="../../../resources/testharnessreport.js"></script>
|
| +</head>
|
| +<body>
|
| +<button inert>Click me</button>
|
| +<div id="div" inert>Click me too</div>
|
| +<script>
|
| +button = document.querySelector('button');
|
| +div = document.getElementById('div');
|
| +clicked = null;
|
| +
|
| +function testClick(element) {
|
| + element.addEventListener('click', function(e) { clicked = element; });
|
| + expectedElement = element;
|
| +
|
| + clicked = null;
|
| + element.click();
|
| + assert_equals(clicked, expectedElement);
|
| +
|
| + clicked = null;
|
| + element.dispatchEvent(new Event('click'));
|
| + assert_equals(clicked, expectedElement);
|
| +}
|
| +
|
| +test(function() {
|
| + testClick(button);
|
| +}, "Programmatic click events may still be sent to inert button");
|
| +
|
| +test(function() {
|
| + testClick(div);
|
| +}, "Programmatic click events may still be sent to inert div");
|
| +
|
| +</script>
|
| +</body>
|
| +</html>
|
|
|