mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Update web-platform-tests to revision 20fa4a3a71ab7a2f75b4febbe2e98aeeaf022c2b
This commit is contained in:
parent
3d4416e1b0
commit
df8998356b
110 changed files with 1562 additions and 7048 deletions
|
@ -40,7 +40,7 @@
|
|||
assert_true(c1_click_fired, "input event should fire after click event");
|
||||
assert_false(c1_change_fired, "input event should fire before change event");
|
||||
assert_true(e.bubbles, "event should bubble");
|
||||
assert_false(e.isTrusted, "click()-initiated event should be trusted");
|
||||
assert_false(e.isTrusted, "click()-initiated event should not be trusted");
|
||||
assert_false(e.cancelable, "event should not be cancelable");
|
||||
assert_true(checkbox1.checked, "checkbox is checked");
|
||||
assert_false(checkbox1.indeterminate, "checkbox is not indeterminate");
|
||||
|
@ -51,7 +51,7 @@
|
|||
assert_true(c1_click_fired, "change event should fire after click event");
|
||||
assert_true(c1_input_fired, "change event should fire after input event");
|
||||
assert_true(e.bubbles, "event should bubble")
|
||||
assert_false(e.isTrusted, "click()-initiated event should be trusted");
|
||||
assert_false(e.isTrusted, "click()-initiated event should not be trusted");
|
||||
assert_false(e.cancelable, "event should not be cancelable");
|
||||
assert_true(checkbox1.checked, "checkbox is checked");
|
||||
assert_false(checkbox1.indeterminate, "checkbox is not indeterminate");
|
||||
|
|
|
@ -34,10 +34,13 @@
|
|||
<input type=checkbox id=checkbox1 checked>
|
||||
<input type=checkbox id=checkbox2>
|
||||
<input type=checkbox id=checkbox3 default>
|
||||
<input type=radio name=radios id=radio1 checked>
|
||||
<input type=radio name=radios id=radio2>
|
||||
<input type=radio name=radios id=radio3 default>
|
||||
<select id=select1>
|
||||
<optgroup label="options" id=optgroup1>
|
||||
<option value="option1" id=option1 selected>option1
|
||||
<option value="option1" id=option1>option1
|
||||
<option value="option2" id=option2 selected>option2
|
||||
</select>
|
||||
<dialog id="dialog">
|
||||
<input type=submit id=input8>
|
||||
|
@ -53,9 +56,9 @@
|
|||
|
||||
|
||||
<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");
|
||||
testSelector(":default", ["button2", "button4", "input3", "input5", "input7", "checkbox1", "radio1", "option2", "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");
|
||||
testSelector(":default", ["button1", "button4", "input3", "input5", "input7", "checkbox1", "radio1", "option2", "button6", "button8"], "':default' matches dynamically changed form's default buttons");
|
||||
|
||||
</script>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<title>Selector: pseudo-classes (:in-range, :out-of-range)</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>
|
||||
<link rel="author" title="Denis Ah-Kang" href="mailto:denis@w3.org" id="link1">
|
||||
<link rel="author" title="Chris Rebert" href="http://chrisrebert.com" id="link2">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#selector-in-range" id="link3">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/#selector-out-of-range" id="link4">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="utils.js"></script>
|
||||
|
@ -11,17 +13,72 @@
|
|||
<input type=number value=0 min=0 max=10 id=number2 disabled>
|
||||
<input type=number value=0 min=1 max=10 id=number3>
|
||||
<input type=number value=11 min=0 max=10 id=number4>
|
||||
<input type=number value=0 min=0 max=10 id=number5 readonly>
|
||||
|
||||
<input type="date" min="2005-10-10" max="2020-10-10" value="2010-10-10" id="datein">
|
||||
<input type="date" min="2010-10-10" max="2020-10-10" value="2005-10-10" id="dateunder">
|
||||
<input type="date" min="2010-10-10" max="2020-10-10" value="2030-10-10" id="dateover">
|
||||
|
||||
<input type="time" min="01:00:00" max="05:00:00" value="02:00:00" id="timein">
|
||||
<input type="time" min="02:00:00" max="05:00:00" value="01:00:00" id="timeunder">
|
||||
<input type="time" min="02:00:00" max="05:00:00" value="07:00:00" id="timeover">
|
||||
|
||||
<input type="week" min="2016-W05" max="2016-W10" value="2016-W07" id="weekin">
|
||||
<input type="week" min="2016-W05" max="2016-W10" value="2016-W02" id="weekunder">
|
||||
<input type="week" min="2016-W05" max="2016-W10" value="2016-W26" id="weekover">
|
||||
|
||||
<input type="month" min="2000-04" max="2000-09" value="2000-06" id="monthin">
|
||||
<input type="month" min="2000-04" max="2000-09" value="2000-02" id="monthunder">
|
||||
<input type="month" min="2000-04" max="2000-09" value="2000-11" id="monthover">
|
||||
|
||||
<input type="datetime-local" min="2008-03-12T23:59:59" max="2015-02-13T23:59:59" value="2012-11-28T23:59:59" id="datetimelocalin">
|
||||
<input type="datetime-local" min="2008-03-12T23:59:59" max="2015-02-13T23:59:59" value="2008-03-01T23:59:59" id="datetimelocalunder">
|
||||
<input type="datetime-local" min="2008-03-12T23:59:59" max="2015-02-13T23:59:59" value="2016-01-01T23:59:59" id="datetimelocalover">
|
||||
|
||||
<!-- None of the following have range limitations since they have neither min nor max attributes -->
|
||||
<input type="number" value="0" id="numbernolimit">
|
||||
<input type="date" value="2010-10-10" id="datenolimit">
|
||||
<input type="time" value="02:00:00" id="timenolimit">
|
||||
<input type="week" value="2016-W07" id="weeknolimit">
|
||||
<input type="month" value="2000-06" id="monthnolimit">
|
||||
<input type="datetime-local" value="2012-11-28T23:59:59" id="datetimelocalnolimit">
|
||||
|
||||
<!-- range inputs have default minimum of 0 and default maximum of 100 -->
|
||||
<input type="range" value="50" id="range0">
|
||||
|
||||
<!-- range input's value gets immediately clamped to the nearest boundary point -->
|
||||
<input type="range" min="2" max="7" value="5" id="range1">
|
||||
<input type="range" min="2" max="7" value="1" id="range2">
|
||||
<input type="range" min="2" max="7" value="9" id="range3">
|
||||
|
||||
<!-- None of the following input types can have range limitations -->
|
||||
<input min="1" value="0" type="text">
|
||||
<input min="1" value="0" type="search">
|
||||
<input min="1" value="0" type="url">
|
||||
<input min="1" value="0" type="tel">
|
||||
<input min="1" value="0" type="email">
|
||||
<input min="1" value="0" type="password">
|
||||
<input min="1" value="#000000" type="color">
|
||||
<input min="1" value="0" type="checkbox">
|
||||
<input min="1" value="0" type="radio">
|
||||
<input min="1" value="0" type="file">
|
||||
<input min="1" value="0" type="submit">
|
||||
<input min="1" value="0" type="image">
|
||||
<!-- The following types are also barred from constraint validation -->
|
||||
<input min="1" value="0" type="hidden">
|
||||
<input min="1" value="0" type="button">
|
||||
<input min="1" value="0" type="reset">
|
||||
|
||||
<script>
|
||||
testSelector(":in-range", ["number1"], "':in-range' matches all elements that are candidates for constraint validation, have range limitations, and that are neither suffering from an underflow nor suffering from an overflow");
|
||||
testSelector(":in-range", ["number1", "datein", "timein", "weekin", "monthin", "datetimelocalin", "range0", "range1", "range2", "range3"], "':in-range' matches all elements that are candidates for constraint validation, have range limitations, and that are neither suffering from an underflow nor suffering from an overflow");
|
||||
|
||||
testSelector(":out-of-range", ["number3", "number4"], "':out-of-range' matches all elements that are candidates for constraint validation, have range limitations, and that are either suffering from an underflow or suffering from an overflow");
|
||||
testSelector(":out-of-range", ["number3", "number4", "dateunder", "dateover", "timeunder", "timeover", "weekunder", "weekover", "monthunder", "monthover", "datetimelocalunder", "datetimelocalover"], "':out-of-range' matches all elements that are candidates for constraint validation, have range limitations, and that are either suffering from an underflow or suffering from an overflow");
|
||||
|
||||
document.getElementById("number1").value = -10;
|
||||
testSelector(":in-range", [], "':in-range' update number1's value < min");
|
||||
testSelector(":out-of-range", ["number1", "number3", "number4"], "':out-of-range' update number1's value < min");
|
||||
testSelector(":in-range", ["datein", "timein", "weekin", "monthin", "datetimelocalin", "range0", "range1", "range2", "range3"], "':in-range' update number1's value < min");
|
||||
testSelector(":out-of-range", ["number1", "number3", "number4", "dateunder", "dateover", "timeunder", "timeover", "weekunder", "weekover", "monthunder", "monthover", "datetimelocalunder", "datetimelocalover"], "':out-of-range' update number1's value < min");
|
||||
|
||||
document.getElementById("number3").min = 0;
|
||||
testSelector(":in-range", ["number3"], "':in-range' update number3's min < value");
|
||||
testSelector(":out-of-range", ["number1", "number4"], "':out-of-range' update number3's min < value");
|
||||
testSelector(":in-range", ["number3", "datein", "timein", "weekin", "monthin", "datetimelocalin", "range0", "range1", "range2", "range3"], "':in-range' update number3's min < value");
|
||||
testSelector(":out-of-range", ["number1", "number4", "dateunder", "dateover", "timeunder", "timeover", "weekunder", "weekover", "monthunder", "monthover", "datetimelocalunder", "datetimelocalover"], "':out-of-range' update number3's min < value");
|
||||
</script>
|
||||
|
|
|
@ -7,6 +7,20 @@
|
|||
<script src="utils.js"></script>
|
||||
<div id="log"></div>
|
||||
|
||||
<div id=set0>
|
||||
<!-- The readonly attribute does not apply to the following input types -->
|
||||
<input id=checkbox1 type=checkbox>
|
||||
<input id=hidden1 type=hidden value=abc>
|
||||
<input id=range1 type=range>
|
||||
<input id=color1 type=color>
|
||||
<input id=radio1 type=radio>
|
||||
<input id=file1 type=file>
|
||||
<input id=submit1 type=submit>
|
||||
<input id=image1 type=image>
|
||||
<input id=button1 type=button value="Button">
|
||||
<input id=reset1 type=reset>
|
||||
</div>
|
||||
|
||||
<div id=set1>
|
||||
<input id=input1>
|
||||
<input id=input2 readonly>
|
||||
|
@ -31,6 +45,10 @@
|
|||
</div>
|
||||
|
||||
<script>
|
||||
testSelector("#set0 :read-write", [], "The :read-write pseudo-class must not match input elements to which the readonly attribute does not apply");
|
||||
|
||||
testSelector("#set0 :read-only", ["checkbox1", "hidden1", "range1", "color1", "radio1", "file1", "submit1", "image1", "button1", "reset1"], "The :read-only pseudo-class must match input elements to which the readonly attribute does not apply");
|
||||
|
||||
testSelector("#set1 :read-write", ["input1"], "The :read-write pseudo-class must match input elements to which the readonly attribute applies, and that are mutable");
|
||||
|
||||
testSelector("#set1 :read-only", ["input2"], "The :read-only pseudo-class must not match input elements to which the readonly attribute applies, and that are mutable");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue