mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +00:00
LibWeb: Allow parsing of "file" prompt types in WebDriver
See: https://github.com/w3c/webdriver/commit/3055808 This isn't actually used outside of BiDi.
This commit is contained in:
parent
952ad4e68b
commit
004173f88b
Notes:
github-actions[bot]
2025-04-01 01:52:55 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/004173f88b5 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4162
2 changed files with 6 additions and 1 deletions
|
@ -20,7 +20,7 @@ static UserPromptHandler s_user_prompt_handler;
|
|||
static constexpr Array known_prompt_handlers { "dismiss"sv, "accept"sv, "dismiss and notify"sv, "accept and notify"sv, "ignore"sv };
|
||||
|
||||
// https://w3c.github.io/webdriver/#dfn-valid-prompt-types
|
||||
static constexpr Array valid_prompt_types { "alert"sv, "beforeUnload"sv, "confirm"sv, "default"sv, "prompt"sv };
|
||||
static constexpr Array valid_prompt_types { "alert"sv, "beforeUnload"sv, "confirm"sv, "default"sv, "file"sv, "prompt"sv };
|
||||
|
||||
static constexpr PromptHandler prompt_handler_from_string(StringView prompt_handler)
|
||||
{
|
||||
|
@ -44,6 +44,8 @@ static constexpr StringView prompt_type_to_string(PromptType prompt_type)
|
|||
return "confirm"sv;
|
||||
case PromptType::Default:
|
||||
return "default"sv;
|
||||
case PromptType::File:
|
||||
return "file"sv;
|
||||
case PromptType::Prompt:
|
||||
return "prompt"sv;
|
||||
case PromptType::FallbackDefault:
|
||||
|
@ -62,6 +64,8 @@ static constexpr PromptType prompt_type_from_string(StringView prompt_type)
|
|||
return PromptType::Confirm;
|
||||
if (prompt_type == "default"sv)
|
||||
return PromptType::Default;
|
||||
if (prompt_type == "file"sv)
|
||||
return PromptType::File;
|
||||
if (prompt_type == "prompt"sv)
|
||||
return PromptType::Prompt;
|
||||
if (prompt_type == "fallbackDefault"sv)
|
||||
|
|
|
@ -28,6 +28,7 @@ enum class PromptType {
|
|||
BeforeUnload,
|
||||
Confirm,
|
||||
Default,
|
||||
File,
|
||||
Prompt,
|
||||
FallbackDefault,
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue