зеркало из https://github.com/mozilla/pjs.git
Bug 681667 - Create a test_form_attributes_reflection.html with novalidate check. r=Ms2ger
The other attribute reflection tests will be done with bug 682239.
This commit is contained in:
Родитель
614e8bdc51
Коммит
6abf2c671a
|
@ -63,6 +63,7 @@ _TEST_FILES = \
|
|||
test_validation.html \
|
||||
test_maxlength_attribute.html \
|
||||
test_datalist_element.html \
|
||||
test_form_attributes_reflection.html \
|
||||
$(NULL)
|
||||
|
||||
libs:: $(_TEST_FILES)
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for HTMLFormElement attributes reflection</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="../reflect.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for HTMLFormElement attributes reflection **/
|
||||
|
||||
// TODO: acceptCharset
|
||||
// TODO: action
|
||||
// TODO: autocomplete
|
||||
// TODO: enctype
|
||||
// TODO: encoding
|
||||
// TODO: method
|
||||
// TODO: name
|
||||
|
||||
// .noValidate
|
||||
reflectBoolean({
|
||||
element: document.createElement("form"),
|
||||
attribute: "noValidate",
|
||||
});
|
||||
|
||||
// TODO: target
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -31,35 +31,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=556013
|
|||
|
||||
/** Test for Bug 556013 **/
|
||||
|
||||
var form = document.createElement('form');
|
||||
|
||||
function checkNoValidateAttribute(aForm)
|
||||
{
|
||||
ok("noValidate" in form, "noValidate should be a form element IDL attribute");
|
||||
|
||||
ok(!aForm.noValidate, "aForm novalidate attribute should be disabled");
|
||||
is(aForm.getAttribute('novalidate'), null,
|
||||
"aForm novalidate attribute should be disabled");
|
||||
|
||||
aForm.noValidate = true;
|
||||
ok(aForm.noValidate, "aForm novalidate attribute should be enabled");
|
||||
isnot(aForm.getAttribute('novalidate'), null,
|
||||
"aForm novalidate attribute should be enabled");
|
||||
|
||||
aForm.removeAttribute('novalidate');
|
||||
aForm.setAttribute('novalidate', '');
|
||||
ok(aForm.noValidate, "aForm novalidate attribute should be enabled");
|
||||
isnot(aForm.getAttribute('novalidate'), null,
|
||||
"aForm novalidate attribute should be enabled");
|
||||
|
||||
aForm.removeAttribute('novalidate');
|
||||
ok(!aForm.noValidate, "aForm novalidate attribute should be disabled");
|
||||
is(aForm.getAttribute('novalidate'), null,
|
||||
"aForm novalidate attribute should be disabled");
|
||||
}
|
||||
|
||||
checkNoValidateAttribute(form);
|
||||
|
||||
/**
|
||||
* novalidate should prevent form validation, thus not blocking form submission.
|
||||
*
|
||||
|
|
Загрузка…
Ссылка в новой задаче