mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Adding test cases pr. bzs request. Bug 84400
This commit is contained in:
parent
a366580fad
commit
78e9dbdfd6
184
layout/html/tests/style/bugs/bug84400-1.html
Normal file
184
layout/html/tests/style/bugs/bug84400-1.html
Normal file
@ -0,0 +1,184 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Testing controls that should match :enabled/:disabled</title>
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-selectors/#enableddisabled"/>
|
||||
<link rel="help" href="http://whatwg.org/specs/web-forms/current-work/#relation"/>
|
||||
<style type="text/css">
|
||||
input, textarea, button, *.hideme { display: none; }
|
||||
div { margin-bottom: 1em; }
|
||||
|
||||
span, option, optgroup { background-color: red; }
|
||||
*:enabled + span.true, option.true:enabled, optgroup.true:enabled { color: lime; background-color: lime; }
|
||||
*:disabled + span.false, option.false:disabled, optgroup.false:disabled { color: lime; background-color: lime; }
|
||||
|
||||
#test + span { background-color: red; }
|
||||
#test:enabled + span { color: lime; background-color: lime; }
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
// Runs through i1, i2, .... in and toggles the |disabled| attribute
|
||||
function onLoad() {
|
||||
var i = 1;
|
||||
var el = document.getElementById("i1");
|
||||
while (el) {
|
||||
if (el.hasAttribute("disabled")) {
|
||||
el.removeAttribute("disabled");
|
||||
} else {
|
||||
el.setAttribute("disabled", "disabled");
|
||||
}
|
||||
++i;
|
||||
el = document.getElementById("i" + i);
|
||||
}
|
||||
if (i != 31) {
|
||||
alert("onLoad() handler failed!");
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener("load", onLoad, false);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
There should be no red in the following (note: form styling should be enabled).
|
||||
</div>
|
||||
|
||||
<form method="get" action=".">
|
||||
<div>
|
||||
input:
|
||||
<input/> <span class="true">FAIL</span>
|
||||
<input disabled="disabled"/> <span class="false">FAIL</span>
|
||||
<input id="i1"/> <span class="false">FAIL</span>
|
||||
<input id="i2" disabled="disabled"/> <span class="true">FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
password:
|
||||
<input type="password"/> <span class="true">FAIL</span>
|
||||
<input type="password" disabled="disabled"/> <span class="false">FAIL</span>
|
||||
<input type="password" id="i3"/> <span class="false">FAIL</span>
|
||||
<input type="password" id="i4" disabled="disabled"/> <span class="true">FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
checkbox:
|
||||
<input type="checkbox"/> <span class="true">FAIL</span>
|
||||
<input type="checkbox" disabled="disabled"/> <span class="false">FAIL</span>
|
||||
<input type="checkbox" id="i5"/> <span class="false">FAIL</span>
|
||||
<input type="checkbox" id="i6" disabled="disabled"/> <span class="true">FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
radio:
|
||||
<input type="radio"/> <span class="true">FAIL</span>
|
||||
<input type="radio" disabled="disabled"/> <span class="false">FAIL</span>
|
||||
<input type="radio" id="i7"/> <span class="false">FAIL</span>
|
||||
<input type="radio" id="i8" disabled="disabled"/> <span class="true">FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
submit:
|
||||
<input type="submit"/> <span class="true">FAIL</span>
|
||||
<input type="submit" disabled="disabled"/> <span class="false">FAIL</span>
|
||||
<input type="submit" id="i9"/> <span class="false">FAIL</span>
|
||||
<input type="submit" id="i10" disabled="disabled"/> <span class="true">FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
reset:
|
||||
<input type="reset"/> <span class="true">FAIL</span>
|
||||
<input type="reset" disabled="disabled"/> <span class="false">FAIL</span>
|
||||
<input type="reset" id="i11"/> <span class="false">FAIL</span>
|
||||
<input type="reset" id="i12" disabled="disabled"/> <span class="true">FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
file:
|
||||
<input type="file"/> <span class="true">FAIL</span>
|
||||
<input type="file" disabled="disabled"/> <span class="false">FAIL</span>
|
||||
<input type="file" id="i13"/> <span class="false">FAIL</span>
|
||||
<input type="file" id="i14" disabled="disabled"/> <span class="true">FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
hidden:
|
||||
<input type="hidden"/> <span class="true">FAIL</span>
|
||||
<input type="hidden" disabled="disabled"/> <span class="false">FAIL</span>
|
||||
<input type="hidden" id="i15"/> <span class="false">FAIL</span>
|
||||
<input type="hidden" id="i16" disabled="disabled"/> <span class="true">FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
image:
|
||||
<input type="image"/> <span class="true">FAIL</span>
|
||||
<input type="image" disabled="disabled"/> <span class="false">FAIL</span>
|
||||
<input type="image" id="i17"/> <span class="false">FAIL</span>
|
||||
<input type="image" id="i18" disabled="disabled"/> <span class="true">FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
button (input):
|
||||
<input type="button"/> <span class="true">FAIL</span>
|
||||
<input type="button" disabled="disabled"/> <span class="false">FAIL</span>
|
||||
<input type="button" id="i19"/> <span class="false">FAIL</span>
|
||||
<input type="button" id="i20" disabled="disabled"/> <span class="true">FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
textarea:
|
||||
<textarea cols="5" rows="5"></textarea> <span class="true">FAIL</span>
|
||||
<textarea cols="5" rows="5" disabled="disabled"></textarea> <span class="false">FAIL</span>
|
||||
<textarea cols="5" rows="5" id="i21"></textarea> <span class="false">FAIL</span>
|
||||
<textarea cols="5" rows="5" id="i22" disabled="disabled"></textarea> <span class="true">FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
button:
|
||||
<button>bogus</button> <span class="true">FAIL</span>
|
||||
<button disabled="disabled">bogus</button> <span class="false">FAIL</span>
|
||||
<button id="i23">bogus</button> <span class="false">FAIL</span>
|
||||
<button id="i24" disabled="disabled">bogus</button> <span class="true">FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
select:
|
||||
<select class="hideme"><option>bogus</option></select> <span class="true">FAIL</span>
|
||||
<select class="hideme" disabled="disabled"><option>bogus</option></select> <span class="false">FAIL</span>
|
||||
<select class="hideme" id="i25"><option>bogus</option></select> <span class="false">FAIL</span>
|
||||
<select class="hideme" id="i26" disabled="disabled"><option>bogus</option></select> <span class="true">FAIL</span>
|
||||
|
||||
</div>
|
||||
|
||||
<div>
|
||||
option:
|
||||
<select size="4">
|
||||
<option class="true">FAIL</option>
|
||||
<option class="false" disabled="disabled">FAIL</option>
|
||||
<option class="false" id="i27">FAIL</option>
|
||||
<option class="true" id="i28" disabled="disabled">FAIL</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
optgroup:
|
||||
<select size="4">
|
||||
<optgroup class="true" label="FAIL">
|
||||
<option class="hideme">bogus</option>
|
||||
</optgroup>
|
||||
<optgroup class="false" disabled="disabled" label="FAIL">
|
||||
<option class="hideme">bogus</option>
|
||||
</optgroup>
|
||||
<optgroup class="false" id="i29" label="FAIL">
|
||||
<option class="hideme">bogus</option>
|
||||
</optgroup>
|
||||
<optgroup class="true" disabled="disabled" id="i30" label="FAIL">
|
||||
<option class="hideme">bogus</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
78
layout/html/tests/style/bugs/bug84400-2.html
Normal file
78
layout/html/tests/style/bugs/bug84400-2.html
Normal file
@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Testing controls that should not match :enabled/:disabled</title>
|
||||
<link rel="help" href="http://www.w3.org/TR/css3-selectors/#enableddisabled"/>
|
||||
<link rel="help" href="http://whatwg.org/specs/web-forms/current-work/#relation"/>
|
||||
<style type="text/css">
|
||||
input, label, object, *.hideme { display: none; }
|
||||
div { margin-bottom: 1em; }
|
||||
|
||||
span, legend { color: lime; background-color: lime; }
|
||||
*:enabled + span, legend:enabled { background-color: red; }
|
||||
*:disabled + span, legend:disabled { background-color: red; }
|
||||
|
||||
#test + span { background-color: red; }
|
||||
#test:enabled + span { color: lime; background-color: lime; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
There should be no red in the following (note: form styling should be enabled).
|
||||
</div>
|
||||
|
||||
<form method="get" action=".">
|
||||
<div>
|
||||
Make sure that :default is actually implemented:
|
||||
<input id="test"/> <span>FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
label:
|
||||
<label>bogus</label> <span>FAIL</span>
|
||||
<label disabled="disabled">bogus</label> <span>FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
fieldset:
|
||||
<fieldset class="hideme"><legend>bogus</legend></fieldset> <span>FAIL</span>
|
||||
<fieldset class="hideme" disabled="disabled"><legend>bogus</legend></fieldset> <span>FAIL</span>
|
||||
<fieldset class="hideme"><legend disabled="disabled">bogus</legend></fieldset> <span>FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
legend:
|
||||
<fieldset><legend>FAIL</legend></fieldset>
|
||||
<fieldset><legend disabled="disabled">FAIL</legend></fieldset>
|
||||
<fieldset disabled="disabled"><legend>FAIL</legend></fieldset>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
div (inside form):
|
||||
<div class="hideme">bogus</div> <span>FAIL</span>
|
||||
<div class="hideme" disabled="disabled">bogus</div> <span>FAIL</span>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<div>
|
||||
div (outside form):
|
||||
<div class="hideme">bogus</div> <span>FAIL</span>
|
||||
<div class="hideme" disabled="disabled">bogus</div> <span>FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
object:
|
||||
<object>bogus</object> <span>FAIL</span>
|
||||
<object disabled="disabled">bogus</object> <span>FAIL</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
form:
|
||||
<form class="hideme" method="get" action="."><p><input/></p></form> <span>FAIL</span>
|
||||
<form class="hideme" method="get" action="." disabled="disabled"><p><input/></p></form> <span>FAIL</span>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
28
layout/html/tests/style/bugs/bug84400-3.html
Normal file
28
layout/html/tests/style/bugs/bug84400-3.html
Normal file
@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<title>testing :disabled and :enabled</title>
|
||||
<style>
|
||||
input{ background:red }
|
||||
#i1:enabled { background:lime }
|
||||
#i2:disabled { background:lime }
|
||||
#i3:enabled { background:lime }
|
||||
#i4:disabled { background:lime }
|
||||
#i5:disabled { background:lime }
|
||||
#i6:enabled { background:lime }
|
||||
</style>
|
||||
<script>
|
||||
window.addEventListener("load",enabledDisabled,false);
|
||||
function enabledDisabled(){
|
||||
document.getElementById('i3').removeAttribute('disabled');
|
||||
document.getElementById('i4').disabled = true;
|
||||
document.getElementById('i5').setAttribute('disabled','disabled');
|
||||
document.getElementById('i6').disabled = false;
|
||||
}
|
||||
</script>
|
||||
<p>Note: form styling should be enabled.
|
||||
<p>There should be no red:
|
||||
<p><input id="i1">
|
||||
<p><input disabled="disabled" id="i2">
|
||||
<p><input disabled="disabled" id="i3">
|
||||
<p><input id="i4">
|
||||
<p><input id="i5">
|
||||
<p><input disabled="disabled" id="i6">
|
@ -1,3 +1,6 @@
|
||||
bug224188.html
|
||||
bug224737.html
|
||||
bug273719.html
|
||||
bug84400-1.html
|
||||
bug84400-2.html
|
||||
bug84400-3.html
|
||||
|
Loading…
Reference in New Issue
Block a user