Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/inert/synthetic-click-inert.html

Issue 2088453002: Implement the inert attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move flat tree checks up to the top of isInert Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698