blob: a6564f03de223f233e6e5681a121899d3e7f5e6c [file] [log] [blame]
<!DOCTYPE html>
<meta charset=utf-8>
<title>Selector: pseudo-classes (:default)</title>
<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id=link1>
<link rel=help href="https://html.spec.whatwg.org/multipage/#pseudo-classes" id=link2>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="utils.js"></script>
<div id="log"></div>
<form>
<button id=button1 type=button>button1</button>
<button id=button2 type=submit>button2</button>
</form>
<form>
<button id=button3 type=reset>button3</button>
<button id=button4>button4</button>
</form>
<button id=button5 type=submit>button5</button>
<form id=form1>
<input type=text id=input1>
</form>
<input type=text id=input2 form=form1>
<form>
<input type=submit id=input3>
<input type=submit id=input4>
</form>
<form>
<input type=image id=input5>
<input type=image id=input6>
</form>
<form>
<input type=submit id=input7>
</form>
<input type=checkbox id=checkbox1 checked>
<input type=checkbox id=checkbox2>
<input type=checkbox id=checkbox3 default>
<select id=select1>
<optgroup label="options" id=optgroup1>
<option value="option1" id=option1 selected>option1
<option value="option1" id=option1>option1
</select>
<dialog id="dialog">
<input type=submit id=input8>
</dialog>
<form>
<button id=button6 type='invalid'>button6</button>
<button id=button7>button7</button>
</form>
<form>
<button id=button8>button8</button>
<button id=button9>button9</button>
</form>
<script>
testSelector(":default", ["button2", "button4", "input3", "input5", "input7", "checkbox1", "option1", "button6", "button8"], "':default' matches <button>s that are their form's default button, <input>s of type submit/image that are their form's default button, checked <input>s and selected <option>s");
document.getElementById("button1").type = "submit"; // change the form's default button
testSelector(":default", ["button1", "button4", "input3", "input5", "input7", "checkbox1", "option1", "button6", "button8"], "':default' matches dynamically changed form's default buttons");
</script>