mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Added time input sanitization:
- Implemented is_valid_time_string for DOMString. - Use is_valid_time_string for sanitize_value with time input. - Improved input type change test
This commit is contained in:
parent
ac6e04ebfb
commit
a999239f28
8 changed files with 228 additions and 157 deletions
|
@ -895,6 +895,13 @@ impl HTMLInputElement {
|
|||
textinput.set_content("#000000".into());
|
||||
}
|
||||
}
|
||||
atom!("time") => {
|
||||
let mut textinput = self.textinput.borrow_mut();
|
||||
|
||||
if ! textinput.single_line_content().is_valid_time_string() {
|
||||
*textinput.single_line_content_mut() = "".into();
|
||||
}
|
||||
}
|
||||
// TODO: Implement more value sanitization algorithms for different types of inputs
|
||||
_ => ()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue