Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/html/tabindex-nonfocusable.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/html/tabindex-nonfocusable.html b/third_party/WebKit/LayoutTests/fast/html/tabindex-nonfocusable.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..078c48273402619d8e5365038421609936d44877 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/html/tabindex-nonfocusable.html |
| @@ -0,0 +1,42 @@ |
| +<!DOCTYPE html> |
|
tkent
2016/09/01 23:27:24
Tests for tabIndex are put to LayoutTests/fast/eve
|
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<body> |
| + <a id="a"></a> |
| + <input type="hidden" id="input-hidden"></input> |
| + <input disabled id="input-disabled"></input> |
| + <select disabled id="select-disabled"></select> |
| + <textarea disabled id="textarea-disabled"></textarea> |
| + <button disabled id="button-disabled"></button> |
| + <fieldset id="fieldset"><output id="output"></output></fieldset> |
| + <script> |
| + var idTagList = [ |
| + {id:"a", tag:"HYPERLINK <a> without href"}, |
| + {id:"input-hidden", tag:"INPUT[type=hidden]"}, |
| + {id:"input-disabled", tag:"INPUT[disabled]"}, |
| + {id:"select-disabled", tag:"SELECT[disabled]"}, |
| + {id:"textarea-disabled", tag:"TEXTAREA[disabled]"}, |
| + {id:"button-disabled", tag:"BUTTON[disabled]"}, |
| + ]; |
| + |
| + for (var idTag of idTagList) { |
| + var id = idTag.id; |
| + var tag = idTag.tag; |
| + test(function() { |
| + var elm = document.getElementById(id); |
| + assert_true(elm.tabIndex == 0); |
|
tkent
2016/09/01 23:27:24
assert_equal(elm.tabIndex, 0)
lunalu1
2016/09/02 01:07:38
Done.
|
| + }, 'Default tabIndex value of tag' + tag + ' should be 0'); |
| + } |
| + |
| + test(function() { |
| + var elm = document.getElementById("output"); |
| + assert_true(elm.tabIndex == -1); |
| + }, 'Default tabIndex value of tag OUTPUT should be -1'); |
| + |
| + test(function() { |
| + var elm = document.getElementById("fieldset"); |
| + assert_true(elm.tabIndex == -1); |
| + }, 'Default tabIndex value of tag FIELDSET should be -1'); |
| + </script> |
| +</body> |
| + |