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

Unified Diff: LayoutTests/fast/dom/shadow/istabstop-property.html

Issue 917613004: Add isTabStop attribute to Element (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revert status to experimental Created 5 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: LayoutTests/fast/dom/shadow/istabstop-property.html
diff --git a/LayoutTests/fast/dom/shadow/istabstop-property.html b/LayoutTests/fast/dom/shadow/istabstop-property.html
new file mode 100644
index 0000000000000000000000000000000000000000..ead6686d31a590c6502a5ad2dd61da21d32337ab
--- /dev/null
+++ b/LayoutTests/fast/dom/shadow/istabstop-property.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+</head>
+<body>
+<p>This is basic behavior test for isTabStop attribute.</p>
+<pre id="console"></pre>
+<script>
+var div;
+
+function test() {
+ debug("Testing isTabStop property and attribute");
+
+ debug("Test isTabStop normal assignment behavior");
+ div = document.createElement("div");
+ var flag = div.isTabStop;
+ shouldBe("div.isTabStop", "false");
+
+ div.isTabStop = flag;
+ shouldBe("div.isTabStop", "false");
+
+ div.removeAttribute('isTabstop');
+ shouldBe("div.isTabStop", "false");
+
+ debug("Test isTabStop override by tabindex property");
+ div.tabIndex = 0;
+ shouldBe("div.isTabStop", "true");
+
+ div.tabIndex = -1;
+ shouldBe("div.isTabStop", "false");
+
+ div.tabIndex = 1;
+ shouldBe("div.isTabStop", "true");
+
+ debug("Test isTabStop override by tabindex attribute");
+ div.isTabStop = false;
+ div.setAttribute("tabindex", "0");
+ shouldBe("div.isTabStop", "true");
+
+ div.isTabStop = true;
+ div.setAttribute("tabindex", "-1");
+ shouldBe("div.isTabStop", "false");
+
+ div.isTabStop = false;
+ div.setAttribute("tabIndex", "1");
+ shouldBe("div.isTabStop", "true");
+
+ debug("Test isTabStop change after tabindex change");
+ div.tabIndex = 0;
+ div.isTabStop = false;
+ shouldBe("div.isTabStop", "false");
+
+ div.tabIndex = -1;
+ div.isTabStop = true;
+ shouldBe("div.isTabStop", "true");
+
+ debug("Test isTabStop change before tabindex change which will be overridden");
+ div.isTabStop = false;
+ div.tabIndex = 0;
+ shouldBe("div.isTabStop", "true");
+
+ div.isTabStop = true;
+ div.tabIndex = -1;
+ shouldBe("div.isTabStop", "false");
+}
+
+function run_test() {
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ test();
+
+ debug('Test finished.');
+}
+
+run_test();
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698