OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <title>Tabindex on svg elements tests</title> | 2 <title>Tabindex on svg elements tests</title> |
3 <script src=../../resources/testharness.js></script> | 3 <script src=../../resources/testharness.js></script> |
4 <script src=../../resources/testharnessreport.js></script> | 4 <script src=../../resources/testharnessreport.js></script> |
5 <body> | 5 <body> |
6 <div id="testcontainer"><svg id="testroot" width="1" height="1"/></div> | 6 <div id="testcontainer"><svg id="testroot" width="1" height="1"/></div> |
7 <div id=log></div> | 7 <div id=log></div> |
8 <script> | 8 <script> |
9 var svg = document.getElementById("testroot"); | 9 var svg = document.getElementById("testroot"); |
10 function isFocusable(elm) { | 10 function isFocusable(elm) { |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 var element = svg.firstElementChild; | 178 var element = svg.firstElementChild; |
179 while(element) { | 179 while(element) { |
180 test(function() { | 180 test(function() { |
181 try { | 181 try { |
182 element.firstElementChild.focus(); | 182 element.firstElementChild.focus(); |
183 assert_equals(document.activeElement, isFocusable(elemen
t.firstElementChild) ? element.firstElementChild : document.body); | 183 assert_equals(document.activeElement, isFocusable(elemen
t.firstElementChild) ? element.firstElementChild : document.body); |
184 } | 184 } |
185 finally { | 185 finally { |
186 document.body.focus(); | 186 document.body.focus(); |
187 } | 187 } |
188 » }, element.firstElementChild.nodeName + ".focus() without tabindex set."
); | 188 » }, element.firstElementChild.nodeName + ".focus() without tabindex set (
as text child.)"); |
189 test(function() { | 189 test(function() { |
190 try { | 190 try { |
191 element.firstElementChild.setAttribute("tabindex", "1"); | 191 element.firstElementChild.setAttribute("tabindex", "1"); |
192 element.firstElementChild.focus(); | 192 element.firstElementChild.focus(); |
193 assert_equals(document.activeElement, isFocusableWithTab
index(element.firstElementChild) ? element.firstElementChild : document.body); | 193 assert_equals(document.activeElement, isFocusableWithTab
index(element.firstElementChild) ? element.firstElementChild : document.body); |
194 element.firstElementChild.removeAttribute("tabindex"); | 194 element.firstElementChild.removeAttribute("tabindex"); |
195 } | 195 } |
196 finally { | 196 finally { |
197 document.body.focus(); | 197 document.body.focus(); |
198 } | 198 } |
199 » }, element.firstElementChild.nodeName + ".focus() with tabindex set."); | 199 » }, element.firstElementChild.nodeName + ".focus() with tabindex set (as
text child.)"); |
200 | 200 |
201 element.parentNode.removeChild(element); | 201 element.parentNode.removeChild(element); |
202 element = svg.firstElementChild; | 202 element = svg.firstElementChild; |
203 } | 203 } |
204 </script> | 204 </script> |
205 </body> | 205 </body> |
OLD | NEW |