Adding tests

This commit is contained in:
bzbarsky@mit.edu 2007-12-20 19:36:38 -08:00
parent 55ba1f1426
commit de533c747b
90 changed files with 1551 additions and 0 deletions

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head/>
<body>
<select size="2">
<option id="one" style="color: green" disabled="disabled">Should be green</option>
<option id="two" style="color: blue">Should be blue</option>
</select>
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head/>
<body>
<form>
<br>
<input type="radio" name="group1" id="two" checked="true" value="2"/>
<label style="color: green" for="two">Should be no red</label>
<input type="radio" name="group1" id="three" value="3"/>
<label style="color: green" for="three">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<style>
input ~ label {color: red}
input[checked]:checked ~ label {color: green}
input[checked]:checked:not(:default) + label {color: red}
</style>
</head>
<body onload='var e1 = document.getElementById("one");
var l1 = document.getElementById("l1");
e1.parentNode.removeChild(e1);
l1.parentNode.removeChild(l1);
document.getElementById("two").setAttribute("checked", "true");'>
<form>
<input type="radio" name="group1" id="one" value="1" default="true" checked/>
<label id="l1" for="one">Should be no red</label><br>
<input type="radio" name="group1" id="two" value="2"/>
<label for="two">Should be no red</label>
<input type="radio" name="group1" id="three" value="3"/>
<label for="three">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head/>
<body>
<form>
<input type="radio" name="group1" id="two" value="2"/>
<label style="color: green" for="two">Should be no red</label><br>
<input type="radio" name="group1" id="three" value="3"/>
<label style="color: green" for="three">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<style>
input ~ label {color: red}
input[checked]:checked:default ~ label {color: red}
input:not(:default):not(:checked):not([checked]) ~ label {color:green}
</style>
</head>
<body onload='document.getElementById("one").removeAttribute("checked");'>
<form>
<input type="radio" name="group1" id="one" value="1" default="true" checked/>
<label for="one">Should be no red</label><br>
<input type="radio" name="group1" id="two" value="2"/>
<label for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: green}
</style>
</head>
<body>
<form>
<input type="checkbox" name="group1" id="one" value="1" checked="checked"/>
<label id="l1" for="one">Should be no red</label><br>
<input type="checkbox" name="group1" id="two" value="2"/>
<label id="l2" for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: red}
input:default + label {color: green}
input:not(:checked):not([checked]):not(:default) + label {color:green}
</style>
</head>
<body onload='document.getElementById("one").setAttribute("checked", "true");
document.getElementById("two").removeAttribute("checked");'>
<form>
<input type="checkbox" name="group1" id="one" value="1"/>
<label id="l1" for="one">Should be no red</label><br>
<input type="checkbox" name="group1" id="two" value="2" checked="true"/>
<label id="l2" for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: red}
input[checked]:default:checked ~ label {color: green}
</style>
</head>
<body onload='var e1 = document.getElementById("one");
e1.setAttribute("checked", "false");
document.getElementById("two").removeAttribute("checked");'>
<form>
<input type="checkbox" name="group1" id="one" value="1"/>
<label for="one">Should be no red</label><br>
<input type="checkbox" name="group1" id="two" value="2" checked/>
<label for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<style>
input ~ label {color: red}
input:not(:default):not(:checked):not([checked]) ~ label {color:red}
input[checked]:checked:default ~ label {color: green}
</style>
</head>
<body onload='document.getElementById("one").setAttribute("checked", "checked");'>
<form>
<input type="checkbox" name="group1" id="one" value="1"/>
<label for="one">Should be no red</label><br>
<input type="checkbox" name="group1" id="two" value="2"/>
<label for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: green}
</style>
</head>
<body>
<form>
<input type="checkbox" name="group1" id="one" value="1"/>
<label id="l1" for="one">Should be no red</label><br>
<input type="checkbox" name="group1" id="two" value="2" checked="checked"/>
<label id="l2" for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<style>
input ~ label {color: red}
input[checked]:default + label {color: green}
input:not(:default):not([checked]) + label {color:green}
</style>
</head>
<body onload='document.getElementById("two").setAttribute("checked", "true");'>
<form>
<input type="checkbox" name="group1" id="one" value="1"/>
<label for="one">Should be no red</label><br>
<input type="checkbox" name="group1" id="two" value="2"/>
<label for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: red}
input[checked]:checked:default + label {color: green}
input:not(:checked) + label {color: green}
</style>
</head>
<body onload='document.getElementById("two").setAttribute("checked", "true");'>
<form>
<input type="checkbox" name="group1" id="one" value="1"/>
<label for="one">Should be no red</label><br>
<input type="checkbox" name="group1" id="two" value="2"/>
<label for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<body>
<form id="form"><input type="checkbox" id="two" checked="true"/>
<label for="two" style="color: green">Should be no red</label><input type="checkbox" name="group1" id="one" value="1"/>
<label for="one" style="color: green">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: red}
input[checked]:checked:default ~ label {color: green}
</style>
</head>
<body onload='var form = document.getElementById("form");
var input2 = document.createElement("input");
input2.setAttribute("type", "checkbox");
input2.setAttribute("id", "two");
input2.setAttribute("checked", "true");
form.insertBefore(input2, form.firstChild);
var label2 = document.createElement("label");
label2.setAttribute("for", "two");
var text2 = document.createTextNode("Should be no red");
label2.appendChild(text2);
form.insertBefore(label2, document.getElementById("one"));'>
<form id="form">
<input type="checkbox" name="group1" id="one" value="1"/>
<label for="one">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: green}
</style>
</head>
<body>
<form>
<br>
<input type="checkbox" name="group1" id="two" value="2" checked="true"/>
<label for="two">Should be no red</label>
<input type="checkbox" name="group1" id="three" value="3"/>
<label for="three">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<style>
input ~ label {color: red}
input[checked]:checked ~ label {color: green}
input[checked]:checked:not(:default) + label {color: red}
</style>
</head>
<body onload='var e1 = document.getElementById("one");
var l1 = document.getElementById("l1");
e1.parentNode.removeChild(e1);
l1.parentNode.removeChild(l1);
document.getElementById("two").setAttribute("checked", "true");'>
<form>
<input type="checkbox" name="group1" id="one" value="1" default="true" checked/>
<label id="l1" for="one">Should be no red</label><br>
<input type="checkbox" name="group1" id="two" value="2"/>
<label for="two">Should be no red</label>
<input type="checkbox" name="group1" id="three" value="3"/>
<label for="three">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: green}
</style>
</head>
<body>
<form>
<input type="checkbox" name="group1" id="one" value="1"/>
<label for="one">Should be no red</label><br>
<input type="checkbox" name="group1" id="two" value="2"/>
<label for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<style>
input ~ label {color: red}
input[checked]:checked:default ~ label {color: red}
input:not(:default):not(:checked):not([checked]) ~ label {color:green}
</style>
</head>
<body onload='document.getElementById("one").removeAttribute("checked");'>
<form>
<input type="checkbox" name="group1" id="one" value="1" checked/>
<label for="one">Should be no red</label><br>
<input type="checkbox" name="group1" id="two" value="2"/>
<label for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: green}
</style>
</head>
<body>
<form>
<input type="checkbox" name="group1" id="one" value="1" checked="checked"/>
<label for="one">Should be no red</label><br>
<input type="checkbox" name="group1" id="two" value="2"/>
<label for="two">Should be no red</label><br>
<input type="checkbox" name="group1" id="three" value="3"/>
<label for="three">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<style>
input ~ label {color: red}
input:not(:default):not(:checked):not([checked]) ~ label {color:red}
input[checked]:checked:default ~ input:not(:checked):not([checked]):not(:default) + label {color: green}
input:checked:default + label {color: green}
</style>
</head>
<body onload='document.getElementById("two").setAttribute("checked", "true");
document.getElementById("one").setAttribute("checked", "checked");
document.getElementById("two").removeAttribute("checked");'>
<form>
<input type="checkbox" name="group1" id="one" value="1"/>
<label for="one">Should be no red</label><br>
<input type="checkbox" name="group1" id="two" value="2"/>
<label for="two">Should be no red</label><br>
<input type="checkbox" name="group1" id="three" value="3"/>
<label for="three">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<body>
<label style="color: green" for="ffximage">Text should be green</label>
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<style>
label {color: red}
img:not(:-moz-broken) ~ label {color: green}
img { display: none; }
</style>
</head>
<body onload='var i1 = document.getElementById("ffximage");
i1.onload =
function() { document.documentElement.className = ""; };
i1.setAttribute("src", "solidblue.png");'>
<img src="no-such-scheme:nothing" id="ffximage"/>
<label for="ffximage">Text should be green</label>
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<style>
img:-moz-broken ~ label {color: green}
label {color: red}
img { display: none; }
</style>
</head>
<body>
<img src="no-such-scheme:nothing" id="ffximage"/>
<label for="ffximage">Text should be green</label>
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<style>
label {color: red}
input:not(:-moz-broken) ~ label {color: green}
input { display: none }
</style>
</head>
<body onload='var i1 = document.getElementById("ffximage");
i1.onload =
function() { document.documentElement.className = ""; };
i1.setAttribute("src", "solidblue.png");'>
<input type="image" src="no-such-scheme:nothing" id="ffximage"/>
<label for="ffximage">Text should be green</label>
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<style>
label {color: red}
object:not(:-moz-broken) ~ label {color: green}
object { display: none }
</style>
</head>
<body onload='var i1 = document.getElementById("ffximage");
i1.onload =
function() { document.documentElement.className = ""; };
i1.setAttribute("data", "solidblue.png");'>
<object type="image/png" data="no-such-scheme:nothing" id="ffximage"></object>
<label for="ffximage">Text should be green</label>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<style>
label {color: red}
img[src*="solidblue"]:not(:-moz-broken) + label {color: green}
img { display: none; }
</style>
</head>
<body onload='var i1 = document.getElementById("ffximage");
i1.onload =
function() { document.documentElement.className = ""; };
i1.setAttribute("src", "solidblue.png");'>
<img src="solidblue.png">
<img src="no-such-scheme:nothing" id="ffximage"/>
<label for="ffximage">Text should be green</label>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<style>
label {color: red}
input[src*="solidblue"]:not(:-moz-broken) + label {color: green}
input, img { display: none }
</style>
</head>
<body onload='var i1 = document.getElementById("ffximage");
i1.onload =
function() { document.documentElement.className = ""; };
i1.setAttribute("src", "solidblue.png");'>
<img src="solidblue.png">
<input type="image" src="no-such-scheme:nothing" id="ffximage"/>
<label for="ffximage">Text should be green</label>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<style>
label {color: red}
object[data*="solidblue"]:not(:-moz-broken) + label {color: green}
object, img { display: none }
</style>
</head>
<body onload='var i1 = document.getElementById("ffximage");
i1.onload =
function() { document.documentElement.className = ""; };
i1.setAttribute("data", "solidblue.png");'>
<img src="solidblue.png">
<object type="image/png" data="no-such-scheme:nothing" id="ffximage"></object>
<label for="ffximage">Text should be green</label>
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<style>
input:-moz-broken + label {color: red}
label {color: green}
input { display: none }
</style>
</head>
<body>
<input type="text" src="solidblue.png" id="ffximage"/>
<label for="ffximage">Text should be green</label>
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<style>
input:-moz-broken + label {color: red}
label {color: green}
input { display: none }
</style>
</head>
<body>
<input type="text" src="no-such-scheme:nothing" id="ffximage"/>
<label for="ffximage">Text should be green</label>
</body>
</html>

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<body
<label for="ffximage" style="color: green">Should be no red</label>
<br>
<span style="color: green" >Should be no red</span>
</body>
</html

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<style>
span {color: red}
label {color: red}
input[disabled]:disabled ~ span {color: green}
input[disabled]:disabled + label {color: green}
input { display: none; }
</style>
</head>
<body onload='var i1 = document.getElementById("ffximage");
i1.setAttribute("disabled", "disabled");'>
<input type="image" id="ffximage"/>
<label for="ffximage">Should be no red</label>
<br>
<span>Should be no red</span>
</body>
</html

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<style>
option {color: blue}
option:disabled {color: green}
option#one:not([disabled]):not(:disabled) + option#two {color: red}
</style>
</head>
<body onload='var elem = document.getElementById("one");
elem.setAttribute("disabled", "disabled");'>
<select size="2">
<option id="one">Should be green</option>
<option id="two">Should be blue</option>
</select>
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<style>
option {color: blue}
option:disabled {color: green}
option#one:not([disabled]):enabled + option#two {color: red}
</style>
</head>
<body onload='var elem = document.getElementById("one");
elem.setAttribute("disabled", "disabled");'>
<select size="2">
<option id="one">Should be green</option>
<option id="two">Should be blue</option>
</select>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head/>
<body>
<select size="2">
<option id="one" style="color: green" disabled="disabled">Should be green</option>
<option id="two" style="color: red">Should be blue</option>
</select>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head/>
<body>
<select size="2">
<option id="one" style="color: red" disabled="disabled">Should be green</option>
<option id="two" style="color: blue">Should be blue</option>
</select>
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<style>
option {color: green}
</style>
</head>
<body>
<select size="2">
<option id="one" disabled="disabled">Should be no red</option>
<option id="two">Should be no red</option>
</select>
</body>
</html>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="4in" height="3in" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<desc>This graphic links to an external image
</desc>
<image id="i1" x="200" y="200" width="100px" height="80px"
xlink:href="solidblue.png">
</image>
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="green"/>
</svg>

After

Width:  |  Height:  |  Size: 523 B

View File

@ -0,0 +1,2 @@
image:not(:-moz-broken) ~ circle {fill: green}
circle {fill: red}

View File

@ -0,0 +1,30 @@
<?xml version="1.0" standalone="no"?>
<?xml-stylesheet href="315920-20-style.css" type="text/css"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="4in" height="3in" version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
class="reftest-wait">
<desc>This graphic links to an external image
</desc>
<script type="text/javascript"> <![CDATA[
function onloadHandler() {
var image = document.getElementById("i1");
image.addEventListener("load",
function() {
document.documentElement.removeAttribute("class");
},
false);
image.setAttributeNS("http://www.w3.org/1999/xlink",
"href", "solidblue.png");
}
window.addEventListener("load", onloadHandler, false);
]]>
</script>
<image id="i1" x="200" y="200" width="100px" height="80px"
xlink:href="no-such-scheme:nothing">
</image>
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,13 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="4in" height="3in" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<desc>This graphic links to an external image
</desc>
<image id="i1" x="200" y="200" width="100px" height="80px"
xlink:href="broken.png">
</image>
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="green"/>
</svg>

After

Width:  |  Height:  |  Size: 520 B

View File

@ -0,0 +1,2 @@
circle {fill: red}
image:-moz-broken ~ circle {fill: green}

View File

@ -0,0 +1,29 @@
<?xml version="1.0" standalone="no"?>
<?xml-stylesheet href="315920-21-style.css" type="text/css"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="4in" height="3in" version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
class="reftest-wait">
<desc>This graphic links to an external image
</desc>
<script type="text/javascript"> <![CDATA[
function onloadHandler() {
var image = document.getElementById("i1");
image.addEventListener("error",
function() {
document.documentElement.removeAttribute("class");
},
false);
image.setAttributeNS("http://www.w3.org/1999/xlink",
"href", "no-such-scheme:nothing");
}
window.addEventListener("load", onloadHandler, false);
]]>
</script>
<image id="i1" x="200" y="200" width="100px" height="80px">
</image>
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: green}
</style>
</head>
<body>
<div>
<input id="one" disabled="disabled"/>
<label for="one">Should be no red</label>
</div>
<div>
<input id="two"/>
<label for="two">Should be no red</label>
</div>
</body>
</html>

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: red}
#one[disabled]:disabled + label {color: green}
#two:not([disabled]):not(:disabled) + label {color: green}
</style>
</head>
<body onload='var elem = document.getElementById("one");
elem.setAttribute("disabled", "disabled");
document.getElementById("two").removeAttribute("disabled")'>
<div>
<input id="one"/>
<label for="one">Should be no red</label>
</div>
<div>
<input id="two" disabled="disabled"/>
<label for="two">Should be no red</label>
</div>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: green}
</style>
</head>
<body>
<div>
<input id="one" disabled="disabled"/>
<label for="one">Should be no red</label>
</div>
<div>
<input id="two"/>
<label for="two">Should be no red</label>
</div>
</body>
</html>

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: red}
#one[disabled]:not(:enabled) + label {color: green}
#two:not([disabled]):enabled + label {color: green}
</style>
</head>
<body onload='var elem = document.getElementById("one");
elem.setAttribute("disabled", "disabled");
document.getElementById("two").removeAttribute("disabled")'>
<div>
<input id="one"/>
<label for="one">Should be no red</label>
</div>
<div>
<input id="two" disabled="disabled"/>
<label for="two">Should be no red</label>
</div>
</body>
</html>

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<style>
span {color: green}
</style>
</head>
<body>
<span>Should be no red</span>
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<style>
span {color: red}
input[type=text][disabled]:disabled + span {color: green}
input[type=submit]:disabled + span {color: red}
input { display: none }
</style>
</head>
<body onload='document.getElementById("one").setAttribute("disabled", "disabled");
document.getElementById("one").setAttribute("type", "text");'>
<input type="submit" id="one"/>
<span>Should be no red </span>
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<style>
span {color: green}
</style>
</head>
<body>
<span>Should be no red </span><br>
<span>Should be no red </span><br>
<span style="color:blue">Should be no red </span>
</body>
</html>

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<style>
span {color: red}
input[type=submit]:not([disabled]):not(:disabled) ~ span {color: green}
input[type=submit][disabled]:disabled + span {color: blue}
input[type=text] + span {color: red}
input { display: none }
</style>
</head>
<body onload='document.getElementById("one").setAttribute("type", "submit");
document.getElementById("two").setAttribute("type", "submit");
document.getElementById("two").setAttribute("disabled", "disabled");
document.getElementById("one").removeAttribute("disabled");'>
<input type="text" id="one" disabled="disabled"/>
<span>Should be no red </span><br>
<span>Should be no red </span><br>
<input type="text" id="two"/>
<span>Should be no red </span>
</body>
</html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<style>
span {color: green}
</style>
</head>
<body>
<div>
<input type="checkbox" id="one" checked="checked"/>
<span>Should be no red </span>
</div>
<div>
<input type="checkbox" id="one" checked="checked"/>
<span>Should be no red </span>
</div>
</body>
</html>

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<style>
span {color: red}
#one:checked + span {color: green}
#two:default + span {color: green}
</style>
</head>
<body onload='document.getElementById("one").setAttribute("type", "checkbox");
document.getElementById("two").setAttribute("type", "checkbox");'>
<div>
<input type="text" id="one" checked="checked"/>
<span>Should be no red </span>
</div>
<div>
<input type="text" id="two" checked="checked"/>
<span>Should be no red </span>
</div>
</body>
</html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<style>
span {color: green}
</style>
</head>
<body>
<div>
<input id="one" checked="checked"/>
<span>Should be no red </span>
</div>
<div>
<input id="one" checked="checked"/>
<span>Should be no red </span>
</div>
</body>
</html>

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<style>
span {color: green}
#one:checked + span {color: red}
#two:default + span {color: red}
</style>
</head>
<body onload='document.getElementById("one").removeAttribute("type");
document.getElementById("two").removeAttribute("type");'>
<div>
<input type="text" id="one" checked="checked" type="checkbox"/>
<span>Should be no red </span>
</div>
<div>
<input type="text" id="two" checked="checked" type="checkbox"/>
<span>Should be no red </span>
</div>
</body>
</html>

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<body>
<select size="7">
<optgroup id="ogone" label="opt group 1" style="color:green" disabled="disabled">
<option id="one" style="color:green">Should be no red</option>
<option id="two" style="color:green">Should be no red</option>
</optgroup>
<optgroup id="ogtwo" label="opt group 2" style="color:blue">
<option id=three style="color:blue">Should be no red</option>
<option id=four style="color:blue">Should be no red</option>
</optgroup>
</select>
</body>
</html>

View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<style>
optgroup {color: red}
option {color: red}
optgroup[disabled]:disabled {color: green}
optgroup[disabled]:disabled + optgroup:not([disabled]):not(:disabled) {color: blue}
optgroup[disabled]:disabled > option{color: green}
optgroup:not([disabled]):not(:disabled) > option {color: blue}
</style>
</head>
<body onload='document.getElementById("ogone").setAttribute("disabled", "disabled");'>
<select size="7">
<optgroup id="ogone" label="opt group 1">
<option id="one">Should be no red</option>
<option id="two">Should be no red</option>
</optgroup>
<optgroup id="ogtwo" label="opt group 2">
<option id=three>Should be no red</option>
<option id=four>Should be no red</option>
</optgroup>
</select>
</body>
</html>

View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<style>
optgroup {color: red}
option {color: red}
optgroup[disabled]:disabled {color: green}
optgroup[disabled]:disabled + optgroup:not([disabled]):not(:disabled) {color: blue}
optgroup[disabled]:disabled > option{color: green}
optgroup:not([disabled]):not(:disabled) > option {color: blue}
</style>
</head>
<body onload='document.getElementById("ogtwo").removeAttribute("disabled");'>
<select size="7">
<optgroup id="ogone" label="opt group 1" disabled="disabled">
<option id="one">Should be no red</option>
<option id="two">Should be no red</option>
</optgroup>
<optgroup id="ogtwo" label="opt group 2" disabled="disabled">
<option id=three>Should be no red</option>
<option id=four>Should be no red</option>
</optgroup>
</select>
</body>
</html>

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<style>
optgroup {color: red}
option {color: red}
optgroup[disabled]:disabled {color: green}
optgroup[disabled]:disabled + optgroup:not([disabled]):not(:disabled) {color: blue}
optgroup[disabled]:disabled > option{color: green}
optgroup:not([disabled]):not(:disabled) > option {color: blue}
</style>
</head>
<body onload='document.getElementById("ogtwo").removeAttribute("disabled");
document.getElementById("ogone").setAttribute("disabled", "disabled");'>
<select size="7">
<optgroup id="ogone" label="opt group 1">
<option id="one">Should be no red</option>
<option id="two">Should be no red</option>
</optgroup>
<optgroup id="ogtwo" label="opt group 2" disabled="disabled">
<option id=three>Should be no red</option>
<option id=four>Should be no red</option>
</optgroup>
</select>
</body>
</html>

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<title>Reference for 315920-11 d, e</title>
<style> optgroup {color:green} </style>
</head>
<body>
<select size="2">
<optgroup id="ogone" label="There should be no red">
</optgroup>
<optgroup id="ogtwo" label="There should be no red">
</optgroup>
</select>
</body>
</html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<style>
optgroup {color: red}
optgroup[disabled]:disabled {color: red}
optgroup:not([disabled]):not(:disabled) + optgroup {color: green}
optgroup:not(:disabled) {color: green}
</style>
</head>
<body onload='document.getElementById("ogone").removeAttribute("disabled");'>
<select size="2">
<optgroup id="ogone" label="There should be no red" disabled="disabled">
</optgroup>
<optgroup id="ogtwo" label="There should be no red">
</optgroup>
</select>
</body>
</html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<style>
optgroup {color: red}
optgroup:disabled {color: green}
optgroup[disabled]:disabled + optgroup {color: green}
optgroup:not(:disabled) {color: red}
</style>
</head>
<body onload='document.getElementById("ogone").setAttribute("disabled", "disabled");'>
<select size="2">
<optgroup id="ogone" label="There should be no red">
</optgroup>
<optgroup id="ogtwo" label="There should be no red">
</optgroup>
</select>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<style>
option {color: red}
option:disabled {color: green}
option[disabled]:disabled + option {color: green}
option:not([disabled]):not(:disabled) + option {color: red}
</style>
</head>
<body onload='var elem = document.getElementById("one");
elem.setAttribute("disabled", "disabled");'>
<select size="2">
<option id="one">Should be no red</option>
<option id="two">Should be no red</option>
</select>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<style>
option {color: green}
option[selected] {color: red}
option:not([selected]):not(:default) + option {color: green}
</style>
</head>
<body onload='document.getElementById("one").removeAttribute("selected");'>
<select size="2">
<option id="one" selected="selected">Should be no red</option>
<option id="two">Should be no red</option>
</select>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<style>
option {color: red}
option:disabled {color: green}
option[disabled]:not(:disabled) + option {color: green}
option:not([disabled]):enabled + option {color: red}
</style>
</head>
<body onload='var elem = document.getElementById("one");
elem.setAttribute("disabled", "disabled");'>
<select size="2">
<option id="one">Should be no red</option>
<option id="two">Should be no red</option>
</select>
</body>
</html>

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<body>
<input type="button" id="one" disabled="true" style="color: green" value="Should be no red"/>
<input type="button" id="two" style="color: green" value="Should be no red"/>
</body>
</html>
</html>

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<title>Reference for 315920-11f</title>
<style>
option {color: green}
optgroup {color: green}
</style>
</head>
<body>
<select size="7">
<optgroup id="ogone" label="There should be no red" disabled="disabled">
<option id="one" style="color:blue" selected="selected">This should be blue</option>
<option id="two" style="color:blue">This should be blue</option>
</optgroup>
<optgroup id="ogtwo" label="There should be no red">
<option id="three">There should be no red</option>
<option id="four">There should be no red</option>
</optgroup>
</select>
</body>
</html>

View File

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<style>
option {color: green}
optgroup {color: red}
optgroup:disabled {color: green}
optgroup[disabled]:disabled + optgroup {color: green}
optgroup:not(:disabled) {color: red}
optgroup[disabled]:disabled > option:default {color:blue}
optgroup:disabled > option:default ~ option {color:blue}
</style>
</head>
<body onload='document.getElementById("ogone").setAttribute("disabled", "disabled");
document.getElementById("one").setAttribute("selected", "selected");'>
<select size="7">
<optgroup id="ogone" label="There should be no red">
<option id="one">This should be blue</option>
<option id="two">This should be blue</option>
</optgroup>
<optgroup id="ogtwo" label="There should be no red">
<option id="three">There should be no red</option>
<option id="four">There should be no red</option>
</optgroup>
</select>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<style>
input {color: red}
#two { color: green }
input[disabled]:disabled {color: green}
input:not([disabled]):not(:disabled) + #two:enabled {color: red}
</style>
</head>
<body onload='var elem = document.getElementById("one");
elem.setAttribute("disabled", "disabled");'>
<input type="button" id="one" value="Should be no red"/>
<input type="button" id="two" value="Should be no red"/>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<style>
input {color: red }
#two { color: green }
input[disabled]:disabled {color: green}
input:not([disabled]):not(:disabled) + #two:enabled {color: red}
</style>
</head>
<body onload='var elem = document.getElementById("one");
elem.setAttribute("disabled", "disabled");'>
<input type="submit" id="one" value="Should be no red"/>
<input type="submit" id="two" value="Should be no red"/>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<style>
input {color: red}
#two { color: green }
input[disabled]:not(:enabled) {color: green}
input:not([disabled]):enabled + #two:enabled {color: red}
</style>
</head>
<body onload='var elem = document.getElementById("one");
elem.setAttribute("disabled", "disabled");'>
<input type="button" id="one" value="Should be no red"/>
<input type="button" id="two" value="Should be no red"/>
</body>
</html>

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<style>
input {color: red }
#two { color: green }
input[disabled]:not(:enabled) {color: green}
input:not([disabled]):enabled + #two:enabled {color: red}
</style>
</head>
<body onload='var elem = document.getElementById("one");
elem.setAttribute("disabled", "disabled");'>
<input type="submit" id="one" value="Should be no red"/>
<input type="submit" id="two" value="Should be no red"/>
</body>
</html>

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<body>
<input type="button" id="one" disabled="true" style="color: red" value="Should be no red"/>
<input type="button" id="two" style="color: red" value="Should be no red"/>
</body>
</html>
</html>

View File

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<body>
<input type="submit" id="one" disabled="true" style="color: red" value="Should be no red"/>
<input type="submit" id="two" style="color: red" value="Should be no red"/>
</body>
</html>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<body>
<select size="4" id="selection">
<option id="zero"></option>
<option id="one" style="color: green">Should be no red</option>
<option id="two" style="color: green">Should be no red</option>
<option id="three" style="color: green">Should be no red</option>
</select>
</body>
</html>

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html>
<head>
<style>
option {color: red}
option[disabled] {color: green}
option:disabled ~ option:not([disabled]):not(:disabled) {color: green}
option:not(:disabled):not([disabled]) + option:enabled {color: red}
</style>
</head>
<body onload='var elem0 = document.createElement("option");
elem0.setAttribute("disabled", "disabled");
var elem1 = document.getElementById("selection");
elem1.insertBefore(elem0, elem1.firstChild);
document.getElementById("two").setAttribute("disabled","disabled");'>
<select size="4" id="selection">
<option id="one">Should be no red</option>
<option id="two">Should be no red</option>
<option id="three">Should be no red</option>
</select>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head/>
<body>
<select size="4" id="selection">
<option id="zero" style="color: green" selected="true">Should be no red</option>
<option id="two" style="color: green">Should be no red</option>
<option id="three" style="color: green">Should be no red</option>
</select>
</body>
</html>

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<style>
option {color: red}
option[selected] {color:green}
option[selected]:disabled ~ option:not([disabled]):not(:disabled) {color: red}
</style>
</head>
<body onload='var e1 = document.getElementById("one");
e1.parentNode.removeChild(e1);
document.getElementById("zero").setAttribute("selected", "true");'>
<select size="4" id="selection">
<option id="zero">Should be no red</option>
<option id="one" selected="true" disabled="disabled">Should be no red</option>
<option id="two">Should be no red</option>
<option id="three">Should be no red</option>
</select>
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<style>
option {color: green}
</style>
</head>
<body>
<select size="2">
<option id="one" selected="selected">Should be no red</option>
<option id="two">Should be no red</option>
</select>
</body>
</html>

View File

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<style>
option {color: red}
option[selected] {color: green}
option[selected]:default + option {color: green}
</style>
</head>
<body onload='var elem = document.getElementById("one");
elem.setAttribute("selected", "selected");'>
<select size="2">
<option id="one">Should be no red</option>
<option id="two">Should be no red</option>
</select>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<body>
<form>
<input type="radio" name="group1" id="one" value="1" checked="checked"/>
<label style="color: green" for="one">Should be no red</label><br>
<input type="radio" name="group1" id="two" value="2"/>
<label style="color: green" for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: red}
input:default + label {color: green}
input:not(:checked):not([checked]):not(:default) + label {color:green}
</style>
</head>
<body onload='document.getElementById("one").setAttribute("checked", "true");
document.getElementById("two").removeAttribute("checked");'>
<form>
<input type="radio" name="group1" id="one" value="1"/>
<label id="l1" for="one">Should be no red</label><br>
<input type="radio" name="group1" id="two" value="2" checked="true"/>
<label id="l2" for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: red}
input[checked]:default:checked ~ label {color: green}
</style>
</head>
<body onload='var e1 = document.getElementById("one");
e1.setAttribute("checked", "false");
document.getElementById("two").removeAttribute("checked");'>
<form>
<input type="radio" name="group1" id="one" value="1"/>
<label for="one">Should be no red</label><br>
<input type="radio" name="group1" id="two" value="2" checked/>
<label for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<style>
input ~ label {color: red}
input:not(:default):not(:checked):not([checked]) ~ label {color:red}
input[checked]:checked:default ~ label {color: green}
</style>
</head>
<body onload='document.getElementById("one").setAttribute("checked", "checked");'>
<form>
<input type="radio" name="group1" id="one" value="1"/>
<label for="one">Should be no red</label><br>
<input type="radio" name="group1" id="two" value="2"/>
<label for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<body>
<form>
<input type="radio" name="group1" id="one" value="1"/>
<label style="color: green" for="one">Should be no red</label><br>
<input type="radio" name="group1" id="two" value="2" checked="checked"/>
<label style="color: green" for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<style>
input ~ label {color: red}
input[checked]:default + label {color: green}
input:not(:default):not([checked]) + label {color:green}
</style>
</head>
<body onload='document.getElementById("two").setAttribute("checked", "true");'>
<form>
<input type="radio" name="group1" id="one" value="1"/>
<label for="one">Should be no red</label><br>
<input type="radio" name="group1" id="two" value="2"/>
<label for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: red}
input[checked]:checked:default + label {color: green}
input:not(:checked) + label {color: green}
</style>
</head>
<body onload='document.getElementById("two").setAttribute("checked", "true");'>
<form>
<input type="radio" name="group1" id="one" value="1"/>
<label for="one">Should be no red</label><br>
<input type="radio" name="group1" id="two" value="2"/>
<label for="two">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head/>
<body>
<form><input type="radio" name="group1" id="two" value="2" default="true" checked="true"/>
<label for="two" style="color: green">Should be no red</label><input type="radio" name="group1" id="one" value="1"/>
<label for="one" style="color: green">Should be no red</label>
</form>
</body>
</html>

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<style>
label {color: red}
input[checked]:checked:default ~ label {color: green}
input:not([checked]):not(:checked) + label {color: red}
</style>
</head>
<body onload='var form = document.getElementById("form");
var input2 = document.createElement("input");
input2.setAttribute("type", "radio");
input2.setAttribute("id", "two");
input2.setAttribute("checked", "true");
form.insertBefore(input2, form.firstChild);
var label2 = document.createElement("label");
label2.setAttribute("for", "two");
var text2 = document.createTextNode("Should be no red");
label2.appendChild(text2);
form.insertBefore(label2, document.getElementById("one"));'>
<form id="form">
<input type="radio" name="group1" id="one" value="1"/>
<label for="one">Should be no red</label>
</form>
</body>
</html>

View File

@ -142,6 +142,62 @@ fails-if(MOZ_WIDGET_TOOLKIT!="cocoa") HTTP == 289480.html#top 289480-ref.html #
!= 315620-1b.html 315620-1-ref.html
== 315620-2a.xhtml 315620-2-ref.xhtml
!= 315620-2b.xhtml 315620-2-ref.xhtml
== 315920-1a.html 315920-1-ref.html
== 315920-1b.html 315920-1-ref.html
!= 315920-1c.html 315920-1-ref.html
!= 315920-1d.html 315920-1-ref.html
== 315920-2a.html 315920-2-ref.html
== 315920-2b.html 315920-2-ref.html
== 315920-2c.html 315920-2-ref.html
== 315920-3a.html 315920-3-ref.html
== 315920-3b.html 315920-3-ref.html
== 315920-3c.html 315920-3-ref.html
== 315920-3d.html 315920-3-ref.html
!= 315920-3e.html 315920-3-ref.html
fails == 315920-4.html 315920-4-ref.html # bug 229915
fails == 315920-5.html 315920-5-ref.html # bug 229915
== 315920-6.html 315920-6-ref.html
== 315920-7a.html 315920-7-ref.html
== 315920-7b.html 315920-7-ref.html
== 315920-7c.html 315920-7-ref.html
== 315920-8a.html 315920-8-ref.html
== 315920-8b.html 315920-8-ref.html
== 315920-9.html 315920-9-ref.html
== 315920-10.html 315920-10-ref.html
== 315920-11.html 315920-11-ref.html
== 315920-12a.html 315920-12-ref.html
== 315920-12b.html 315920-12-ref.html
== 315920-12c.html 315920-12-ref.html
== 315920-13a.html 315920-13-ref.html
== 315920-13b.html 315920-13-ref.html
fails == 315920-14.html 315920-14-ref.html # bug 229915
== 315920-15.html 315920-15-ref.html
== 315920-16.html 315920-16-ref.html
== 315920-17.html 315920-17-ref.html
== 315920-18a.html 315920-18-ref.html
== 315920-18b.html 315920-18-ref.html
== 315920-18c.html 315920-18-ref.html
== 315920-18d.html 315920-18-ref.html
== 315920-18e.html 315920-18-ref.html
== 315920-18f.html 315920-18-ref.html
== 315920-18g.html 315920-18-ref.html
== 315920-18h.html 315920-18-ref.html
== 315920-18i.html 315920-18-ref.html
== 315920-19.html 315920-19-ref.html
== 315920-20.svg 315920-20-ref.svg
== 315920-21.svg 315920-21-ref.svg
== 315920-22.html 315920-22-ref.html
== 315920-23.html 315920-23-ref.html
== 315920-24.html 315920-24-ref.html
== 315920-25.html 315920-25-ref.html
== 315920-26.html 315920-26-ref.html
== 315920-27.html 315920-27-ref.html
== 315920-28a.html 315920-28-ref.html
== 315920-28b.html 315920-28-ref.html
== 315920-28c.html 315920-28-ref.html
== 315920-29a.html 315920-29-ref.html
== 315920-29b.html 315920-29-ref.html
== 315920-30.html 315920-30-ref.html
== 316057-1.html 316057-1-ref.html
!= 321402-1.html about:blank
!= 321402-2.html about:blank