mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
implement range input sanitization
This commit is contained in:
parent
525758ea5e
commit
b29230bd76
6 changed files with 75 additions and 19 deletions
|
@ -550473,7 +550473,7 @@
|
|||
"testharness"
|
||||
],
|
||||
"html/semantics/forms/the-input-element/range.html": [
|
||||
"dd51c517a149c51e939a30dcad5e93f196e35cff",
|
||||
"e992526fb5f117456a870e52c84eab5a7f4b14ab",
|
||||
"testharness"
|
||||
],
|
||||
"html/semantics/forms/the-input-element/required_attribute.html": [
|
||||
|
|
|
@ -9,6 +9,6 @@
|
|||
[range input value equals 100]
|
||||
expected: FAIL
|
||||
|
||||
[range input value equals 2]
|
||||
[range input value set to an integer]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -21,9 +21,6 @@
|
|||
[default value when both min and max attributes are given, while min > max]
|
||||
expected: FAIL
|
||||
|
||||
[The default step scale factor is 1, unless min attribute has non-integer value]
|
||||
expected: FAIL
|
||||
|
||||
[Step scale factor behavior when min attribute has integer value but max attribute is non-integer ]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -34,6 +34,9 @@
|
|||
<input type="range" id="stepdown_beyond_min" min=3 max=11 value=6 step=3 />
|
||||
<input type="range" id="illegal_min_and_max" min="ab" max="f" />
|
||||
<input type="range" id="illegal_value_and_step" min=0 max=5 value="ppp" step="xyz" />
|
||||
<input type="range" id="should_skip_whitespace" value=" 123"/>
|
||||
<input type="range" id="exponent_value1" value=""/>
|
||||
<input type="range" id="exponent_value2" value=""/>
|
||||
</div>
|
||||
|
||||
<div id="log">
|
||||
|
@ -280,6 +283,35 @@
|
|||
}
|
||||
);
|
||||
|
||||
test(
|
||||
function() {
|
||||
var e = document.getElementById('should_skip_whitespace');
|
||||
assert_equals(e.value, "123")
|
||||
}, "Skip ASCII whitespace within input", {
|
||||
"help" : "https://html.spec.whatwg.org/multipage/#best-representation-of-the-number-as-a-floating-point-number"
|
||||
}
|
||||
);
|
||||
|
||||
test(
|
||||
function() {
|
||||
var e = document.getElementById('exponent_value1');
|
||||
e.value = 1e2;
|
||||
assert_equals(e.value, "100")
|
||||
}, "Multiply value by ten raised to the exponentth power with `e`", {
|
||||
"help" : "https://html.spec.whatwg.org/multipage/#best-representation-of-the-number-as-a-floating-point-number"
|
||||
}
|
||||
);
|
||||
|
||||
test(
|
||||
function() {
|
||||
var e = document.getElementById('exponent_value2');
|
||||
e.value = 1E2;
|
||||
assert_equals(e.value, "100")
|
||||
}, "Multiply value by ten raised to the exponentth power with `E`", {
|
||||
"help" : "https://html.spec.whatwg.org/multipage/#best-representation-of-the-number-as-a-floating-point-number"
|
||||
}
|
||||
);
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue