mirror of
https://github.com/servo/servo.git
synced 2025-07-19 13:23:46 +01:00
Webdriver: Allow error when selecting file at ElementSendKeys (#38158)
Based on [spec](https://w3c.github.io/webdriver/#element-send-keys), > 5. Verify that each file given by the user exists. If any do not, return [error](https://w3c.github.io/webdriver/#dfn-error) with [error code](https://w3c.github.io/webdriver/#dfn-error-code) [invalid argument](https://w3c.github.io/webdriver/#dfn-invalid-argument). --------- Signed-off-by: PotatoCP <Kenzie.Raditya.Tirtarahardja@huawei.com>
This commit is contained in:
parent
a91625a332
commit
39144bb013
3 changed files with 29 additions and 25 deletions
|
@ -1114,11 +1114,12 @@ pub(crate) fn handle_will_send_keys(
|
|||
}
|
||||
|
||||
// Step 8.5
|
||||
// TODO: Should return invalid argument error if file doesn't exist
|
||||
|
||||
// InvalidArgument Error is returned if the files are not valid.
|
||||
// Step 8.6 - 8.7
|
||||
// Input and change event already fired in `htmlinputelement.rs`.
|
||||
file_input.SelectFiles(files, can_gc);
|
||||
if file_input.select_files(Some(files), can_gc).is_err() {
|
||||
return Err(ErrorStatus::InvalidArgument);
|
||||
}
|
||||
|
||||
// Step 8.8
|
||||
return Ok(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue