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

Side by Side Diff: LayoutTests/fast/dom/shadow/tabstop-property.html

Issue 1144953007: Remove tabStop feature (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p>This is basic behavior test for tabStop attribute.</p>
8 <pre id="console"></pre>
9 <script>
10 var div;
11
12 function resetAttributes(el)
13 {
14 el.removeAttribute("tabindex");
15 el.removeAttribute("tabstop");
16 }
17
18 function tabStopShouldBe(el, expected)
19 {
20 shouldBe(el + ".tabStop", expected);
21 shouldBeEqualToString(el + ".getAttribute('tabstop')", expected);
22 }
23
24 function test() {
25 debug("Testing tabStop property and attribute");
26
27 debug("Test tabStop normal assignment behavior");
28 div = document.createElement("div");
29
30 resetAttributes(div);
31 var flag = div.tabStop;
32 shouldBeFalse("div.tabStop");
33
34 div.tabStop = flag;
35 tabStopShouldBe("div", "false");
36
37 div.removeAttribute('tabstop');
38 shouldBeFalse("div.tabStop");
39 shouldBeFalse("div.hasAttribute('tabstop')");
40
41 div.tabStop = true;
42 tabStopShouldBe("div", "true");
43
44 div.removeAttribute('tabstop');
45 shouldBeFalse("div.tabStop");
46 shouldBeFalse("div.hasAttribute('tabstop')");
47
48
49 debug("Test tabStop value implicitly set by tabindex property");
50 resetAttributes(div);
51 div.tabIndex = 0;
52 shouldBeTrue("div.tabStop");
53
54 div.tabIndex = -1;
55 shouldBeFalse("div.tabStop");
56
57 div.tabIndex = 1;
58 shouldBeTrue("div.tabStop");
59
60 resetAttributes(div);
61 shouldBeFalse("div.tabStop");
62
63
64 debug("Test explicit tabStop not overridable by tabindex attribute");
65 resetAttributes(div);
66 div.tabStop = false;
67 div.setAttribute("tabindex", "0");
68 tabStopShouldBe("div", "false");
69
70 div.tabStop = true;
71 div.setAttribute("tabindex", "-1");
72 tabStopShouldBe("div", "true");
73
74 div.tabStop = false;
75 div.setAttribute("tabIndex", "1");
76 tabStopShouldBe("div", "false");
77
78 resetAttributes(div);
79 shouldBeFalse("div.tabStop");
80 shouldBeFalse("div.hasAttribute('tabstop')");
81
82
83 debug("Test tabStop change with explicit tabindex change");
84 resetAttributes(div);
85
86 div.tabIndex = 0;
87 shouldBeTrue("div.tabStop");
88 div.tabStop = false;
89 tabStopShouldBe("div", "false");
90 resetAttributes(div);
91
92 div.tabIndex = -1;
93 shouldBeFalse("div.tabStop");
94 div.tabStop = true;
95 tabStopShouldBe("div", "true");
96 resetAttributes(div);
97
98 debug("Test tabStop with invalid value");
99 resetAttributes(div);
100
101 div.tabIndex = 0;
102 div.tabStop = false;
103 tabStopShouldBe("div", "false");
104 div.setAttribute("tabstop", "invalid");
105 shouldBeTrue("div.tabStop");
106 shouldBeEqualToString("div.getAttribute('tabstop')", "invalid");
107
108 div.tabIndex = -1;
109 div.tabStop = true;
110 tabStopShouldBe("div", "true");
111 div.setAttribute("tabstop", "invalid");
112 shouldBeFalse("div.tabStop");
113 shouldBeEqualToString("div.getAttribute('tabstop')", "invalid");
114 }
115
116 test();
117 debug('Test finished.');
118 </script>
119 </body>
120 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698