Remove catch-all case for input sanitization

Replaced catch-all with explicit case for inputs that do not have
a value sanitization algorithm. This should prevent us from
forgetting to implement a sanitization for an input, since they
must all be accounted for in the match expression.
This commit is contained in:
glowe 2019-11-30 21:53:53 -05:00
parent f65cb94b9e
commit 23359c5868

View file

@ -1213,7 +1213,16 @@ impl HTMLInputElement {
value.push_str(sanitized.as_str());
}
},
_ => (),
// The following inputs don't have a value sanitization algorithm.
// See https://html.spec.whatwg.org/multipage/#value-sanitization-algorithm
InputType::Button |
InputType::Checkbox |
InputType::File |
InputType::Hidden |
InputType::Image |
InputType::Radio |
InputType::Reset |
InputType::Submit => (),
}
}