Skip to content

Commit

Permalink
Remove catch-all case for input sanitization
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
glowe committed Dec 1, 2019
1 parent f65cb94 commit 23359c5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion components/script/dom/htmlinputelement.rs
Expand Up @@ -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 => (),
}
}

Expand Down

0 comments on commit 23359c5

Please sign in to comment.