Bug 762047 - Improve content/html/content/tests/forms/test_progress_element.html. r=Ms2ger

This commit is contained in:
Mounir Lamouri 2012-06-07 20:46:53 +02:00
parent e3536e8820
commit d64e55ab0d

View File

@ -27,16 +27,7 @@ and
function checkFormIDLAttribute(aElement)
{
var form = document.forms[0];
var content = document.getElementById('content');
content.removeChild(form);
content.appendChild(aElement);
is(aElement.form, null, "The form IDL attribute should be null");
// Cleaning-up.
content.appendChild(form);
form.appendChild(aElement);
is("form" in aElement, false, "<progress> shouldn't have a form attribute");
}
function checkAttribute(aElement, aAttribute, aNewValue, aExpectedValueForIDL)
@ -225,6 +216,20 @@ function checkFormListedElement(aElement)
is(document.forms[0].elements.length, 0, "the form should have no element");
}
function checkLabelable(aElement)
{
var content = document.getElementById('content');
var label = document.createElement('label');
content.appendChild(label);
label.appendChild(aElement);
is(label.control, aElement, "progress should be labelable");
// Cleaning-up.
content.removeChild(label);
content.appendChild(aElement);
}
function checkNotResetableAndFormSubmission(aElement)
{
// Creating an input element to check the submission worked.
@ -297,6 +302,8 @@ checkIndeterminatePseudoClass();
checkFormListedElement(p);
checkLabelable(p);
checkNotResetableAndFormSubmission(p);
</script>