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

Side by Side Diff: LayoutTests/imported/web-platform-tests/html/semantics/disabled-elements/disabledElement.html

Issue 1144143009: W3C Test: Import web-platform-tests/html/semantics (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 <meta charset=utf-8>
3 <title>Disabled elements</title>
4 <link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org">
5 <link rel=help href="https://html.spec.whatwg.org/multipage/#disabled-elements">
6 <script src="../../../../../resources/testharness.js"></script>
7 <script src="../../../../../resources/testharnessreport.js"></script>
8 <div id="log"></div>
9 <button disabled>button</button>
10 <input disabled>
11 <select disabled>
12 <optgroup label="options" disabled>
13 <option value="option1" disabled>option1
14 <option value="option2">option2
15 </select>
16 <textarea disabled>textarea</textarea>
17 <fieldset disabled>
18 <input type=radio name=c value=0 checked>
19 <input type=radio name=c value=1>
20 </fieldset>
21 <a href="http://www.w3.org/" disabled>w3</a>
22 <span tabindex=0 disabled>foobar</span>
23
24 <script>
25 test(function(){
26 assert_equals(document.activeElement, document.body);
27 }, "The body element must be the active element if no element is focused");
28
29 ["button", "input", "select", "optgroup", "option", "textarea", "input[type=ra dio]"].forEach(function(el) {
30 test(function() {
31 var element = document.querySelector(el);
32 element.focus();
33 assert_equals(document.activeElement, document.body, "activeElement after focus on a disabled <" + el + "> remains unchanged");
34 }, "A disabled <" + el + "> should not be focusable");
35 });
36
37 ["a", "span"].forEach(function(el) {
38 test(function() {
39 var element = document.querySelector(el);
40 element.focus();
41 assert_equals(document.activeElement, element, "focus on a <" + el + "> wi th a disabled attribute should make it the activeElement");
42 }, "A disabled <" + el + "> should be focusable");
43 });
44 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698