mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision 0d318188757a9c996e20b82db201fd04de5aa255
This commit is contained in:
parent
b2a5225831
commit
1a81b18b9f
12321 changed files with 544385 additions and 6 deletions
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue