Bug 658282 (1/2) - Improve css-invalid/input/ test suite. r=bz

This commit is contained in:
Mounir Lamouri 2011-05-20 00:32:36 +02:00
Родитель f01c81013a
Коммит 79bade5b8b
20 изменённых файлов: 70 добавлений и 75 удалений

Просмотреть файл

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<input type='button' style="background-color: green;"> <input type='button' class='ref'>
</body> </body>
</html> </html>

Просмотреть файл

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<input value='foo@bar.com' style="background-color: green;"> <input value='foo@bar.com' class='ref'>
</body> </body>
</html> </html>

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<fieldset> <fieldset>
<legend> <legend>
<input style="background-color: green;"> <input class='ref'>
</legend> </legend>
</fieldset> </fieldset>
</body> </body>

Просмотреть файл

@ -1,9 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<fieldset> <fieldset>
<fieldset> <fieldset>
<input style="background-color: green;"> <input class='ref'>
</fieldset> </fieldset>
</fieldset> </fieldset>
</body> </body>

Просмотреть файл

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<input type='image' style="background-color: green;"> <input type='image' class='ref'>
</body> </body>
</html> </html>

Просмотреть файл

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<link rel='stylesheet' type='text/css' href='style.css'>
<body>
<input type='radio' class='ref' checked>
<input type='radio' class='ref'>
</body>
</html>

Просмотреть файл

@ -4,14 +4,8 @@
radio should not be invalid. --> radio should not be invalid. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('i1').setCustomValidity('foo'); <body onload="document.getElementById('i1').setCustomValidity('foo');
if (!document.getElementById('i1').mozMatchesSelector(':invalid') ||
document.getElementById('i2').mozMatchesSelector(':invalid')) {
document.body.textContent='FAIL';
} else {
document.body.textContent='SUCCESS';
}
document.documentElement.className='';"> document.documentElement.className='';">
<input id='i1' name='foo' type='radio'> <input class='invalid' id='i1' name='foo' type='radio'>
<input id='i2' name='foo' type='radio'> <input class='notinvalid' id='i2' name='foo' type='radio'>
</body> </body>
</html> </html>

Просмотреть файл

@ -4,14 +4,8 @@
group, all radio should not suffer from being missing. --> group, all radio should not suffer from being missing. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('i1').checked = true; <body onload="document.getElementById('i1').checked = true;
if (document.getElementById('i1').mozMatchesSelector(':invalid') ||
document.getElementById('i2').mozMatchesSelector(':invalid')) {
document.body.textContent='FAIL';
} else {
document.body.textContent='SUCCESS';
}
document.documentElement.className='';"> document.documentElement.className='';">
<input id='i1' name='foo' type='radio' required> <input class='notinvalid' id='i1' name='foo' type='radio' required>
<input id='i2' name='foo' type='radio'> <input class='notinvalid' id='i2' name='foo' type='radio'>
</body> </body>
</html> </html>

Просмотреть файл

@ -4,14 +4,8 @@
group, all radio should not suffer from being missing. --> group, all radio should not suffer from being missing. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body onload="document.getElementById('i1').required = false; <body onload="document.getElementById('i1').required = false;
if (document.getElementById('i1').mozMatchesSelector(':invalid') ||
document.getElementById('i2').mozMatchesSelector(':invalid')) {
document.body.textContent='FAIL';
} else {
document.body.textContent='SUCCESS';
}
document.documentElement.className='';"> document.documentElement.className='';">
<input id='i1' name='foo' type='radio' required> <input class='notinvalid' id='i1' name='foo' type='radio' required>
<input id='i2' name='foo' type='radio'> <input class='notinvalid' id='i2' name='foo' type='radio'>
</body> </body>
</html> </html>

Просмотреть файл

@ -1,12 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="reftest-wait"> <html>
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body onload="if (document.getElementById('i').mozMatchesSelector(':invalid')) { <body>
document.body.textContent='FAIL'; <input class='notinvalid' id='i' type='radio' checked required>
} else { <input class='notinvalid' type='radio'> <!-- adding this one so we don't have to create a second ref -->
document.body.textContent='SUCCESS';
}
document.documentElement.className='';">
<input id='i' type='radio' checked required>
</body> </body>
</html> </html>

Просмотреть файл

@ -1,12 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="reftest-wait"> <html>
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body onload="if (!document.getElementById('i').mozMatchesSelector(':invalid')) { <body>
document.body.textContent='FAIL'; <input class='invalid' id='i' type='radio' required>
} else { <input class='notinvalid' type='radio'> <!-- adding this one so we don't have to create a second ref -->
document.body.textContent='SUCCESS';
}
document.documentElement.className='';">
<input id='i' type='radio' required>
</body> </body>
</html> </html>

Просмотреть файл

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<link rel='stylesheet' type='text/css' href='style.css'>
<body>
<input type='radio' class='ref'>
<input type='radio' class='ref'>
</body>
</html>

Просмотреть файл

@ -1,16 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html class="reftest-wait"> <html>
<!-- Test: if one radio in a group has the required attribute and no radio is <!-- Test: if one radio in a group has the required attribute and no radio is
checked, all radio in the group should suffer from being missing. --> checked, all radio in the group should suffer from being missing. -->
<link rel='stylesheet' type='text/css' href='style.css'> <link rel='stylesheet' type='text/css' href='style.css'>
<body onload="if (!document.getElementById('i1').mozMatchesSelector(':invalid') || <body>
!document.getElementById('i2').mozMatchesSelector(':invalid')) { <input class='invalid' id='i1' name='foo' type='radio' required>
document.body.textContent='FAIL'; <input class='invalid' id='i2' name='foo' type='radio'>
} else {
document.body.textContent='SUCCESS';
}
document.documentElement.className='';">
<input id='i1' name='foo' type='radio' required>
<input id='i2' name='foo' type='radio'>
</body> </body>
</html> </html>

Просмотреть файл

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<input style="background-color: green;"> <input class='ref'>
</body> </body>
</html> </html>

Просмотреть файл

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<input type='submit' style="background-color: green;"> <input type='submit' class='ref'>
</body> </body>
</html> </html>

Просмотреть файл

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<input value='http://mozilla.org/' style="background-color: green;"> <input value='http://mozilla.org/' class='ref'>
</body> </body>
</html> </html>

Просмотреть файл

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<link rel='stylesheet' type='text/css' href='style.css'>
<body> <body>
<input value='foo' style="background-color: green;"> <input value='foo' class='ref'>
</body> </body>
</html> </html>

Просмотреть файл

@ -23,12 +23,12 @@ fails-if(Android) == input-dyn-disabled.html input-ref.html
== input-disabled-fieldset-1.html input-fieldset-ref.html == input-disabled-fieldset-1.html input-fieldset-ref.html
== input-disabled-fieldset-2.html input-fieldset-ref.html == input-disabled-fieldset-2.html input-fieldset-ref.html
== input-fieldset-legend.html input-fieldset-legend-ref.html == input-fieldset-legend.html input-fieldset-legend-ref.html
== input-radio-required.html success-ref.html == input-radio-required.html input-radio-ref.html
== input-radio-customerror.html success-ref.html == input-radio-customerror.html input-radio-ref.html
== input-radio-dyn-valid-1.html success-ref.html == input-radio-dyn-valid-1.html input-radio-checked-ref.html
== input-radio-dyn-valid-2.html success-ref.html == input-radio-dyn-valid-2.html input-radio-ref.html
== input-radio-nogroup-required-valid.html success-ref.html == input-radio-nogroup-required-valid.html input-radio-ref.html
== input-radio-nogroup-required-invalid.html success-ref.html == input-radio-nogroup-required-invalid.html input-radio-checked-ref.html
== input-submit.html input-submit-ref.html == input-submit.html input-submit-ref.html
== input-image.html input-image-ref.html == input-image.html input-image-ref.html
# input type='hidden' shouldn't show # input type='hidden' shouldn't show

Просмотреть файл

@ -1,18 +1,26 @@
/* Override default style */ /* Override default style */
input {
-moz-appearance: none;
background: none;
}
input:invalid { input:invalid {
box-shadow: none; box-shadow: none;
} }
input.notinvalid { input.notinvalid {
background-color: green; box-shadow: 0 0 1.5px 1px green;
} }
input.notinvalid:invalid { input.notinvalid:invalid {
background-color: red; box-shadow: 0 0 1.5px 1px red;
} }
input.invalid { input.invalid {
background-color: red; box-shadow: 0 0 1.5px 1px red;
} }
input.invalid:invalid { input.invalid:invalid {
background-color: green; box-shadow: 0 0 1.5px 1px green;
}
input.ref {
box-shadow: 0 0 1.5px 1px green;
} }

Просмотреть файл

@ -1,6 +0,0 @@
<!DOCTYPE html>
<html>
<body>
SUCCESS
</body>
</html>