diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/html/semantics/disabled-elements/disabledElement.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/html/semantics/disabled-elements/disabledElement.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/disabled-elements/disabledElement.html | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/disabled-elements/disabledElement.html b/testing/web-platform/tests/html/semantics/disabled-elements/disabledElement.html new file mode 100644 index 000000000..03f57424d --- /dev/null +++ b/testing/web-platform/tests/html/semantics/disabled-elements/disabledElement.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>Disabled elements</title> +<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org"> +<link rel=help href="https://html.spec.whatwg.org/multipage/#disabled-elements"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="log"></div> +<button disabled>button</button> +<input disabled> +<select disabled> + <optgroup label="options" disabled> + <option value="option1" disabled>option1 + <option value="option2">option2 +</select> +<textarea disabled>textarea</textarea> +<fieldset disabled> + <input type=radio name=c value=0 checked> + <input type=radio name=c value=1> +</fieldset> +<a href="http://www.w3.org/" disabled>w3</a> +<span tabindex=0 disabled>foobar</span> + +<script> + test(function(){ + assert_equals(document.activeElement, document.body); + }, "The body element must be the active element if no element is focused"); + + ["button", "input", "select", "optgroup", "option", "textarea", "input[type=radio]"].forEach(function(el) { + test(function() { + var element = document.querySelector(el); + element.focus(); + assert_equals(document.activeElement, document.body, "activeElement after focus on a disabled <" + el + "> remains unchanged"); + }, "A disabled <" + el + "> should not be focusable"); + }); + + ["a", "span"].forEach(function(el) { + test(function() { + var element = document.querySelector(el); + element.focus(); + assert_equals(document.activeElement, element, "focus on a <" + el + "> with a disabled attribute should make it the activeElement"); + }, "A disabled <" + el + "> should be focusable"); + }); +</script> |