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

Side by Side Diff: LayoutTests/imported/web-platform-tests/html/semantics/forms/the-button-element/button-validation.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>button element validation</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/#the-button-elemen t">
6 <script src="../../../../../../resources/testharness.js"></script>
7 <script src="../../../../../../resources/testharnessreport.js"></script>
8 <div id="log"></div>
9 <button id=btn1>button</button>
10 <button id=btn2 type=submit>button</button>
11 <button id=btn3 type=reset>button</button>
12 <button id=btn4 type=button>button</button>
13 <button id=btn5 type=menu>button</button>
14 <button id=btn6 type=foobar>button</button>
15 <script>
16 function willValid(element, expectedType, willValidate, desc) {
17 test(function(){
18 assert_equals(element.type, expectedType);
19 assert_equals(element.willValidate, willValidate);
20 }, desc);
21 }
22
23 willValid(document.getElementById('btn1'), "submit", true, "missing type attri bute");
24 willValid(document.getElementById('btn2'), "submit", true, "submit type attrib ute");
25 willValid(document.getElementById('btn3'), "reset", false, "reset type attribu te");
26 willValid(document.getElementById('btn4'), "button", false, "button type attri bute");
27 willValid(document.getElementById('btn5'), "menu", false, "menu type attribute ");
28 willValid(document.getElementById('btn6'), "submit", true, "invalid type attri bute");
29 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698