1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:27:35 +00:00

LibWeb+Ladybird+Userland: Port window.[alert,confirm,prompt] to String

LibGUI and WebDriver (read: JSON) API boundaries use DeprecatedString,
so that is as far as these changes can reach.

The one change which isn't just a DeprecatedString to String replacement
is handling the "null" prompt response. We previously checked for the
null DeprecatedString, whereas we now represent this as an empty
Optional<String>.
This commit is contained in:
Timothy Flynn 2023-03-13 17:30:51 -04:00 committed by Linus Groh
parent b4d3fea002
commit 97536e4684
18 changed files with 85 additions and 85 deletions

View file

@ -1640,7 +1640,7 @@ Messages::WebDriverClient::GetAlertTextResponse WebDriverConnection::get_alert_t
// 4. Return success with data message.
if (message.has_value())
return *message;
return message->to_deprecated_string();
return JsonValue {};
}
@ -1679,7 +1679,7 @@ Messages::WebDriverClient::SendAlertTextResponse WebDriverConnection::send_alert
}
// 6. Perform user agent dependent steps to set the value of current user prompts text field to text.
m_page_client.page_did_request_set_prompt_text(move(text));
m_page_client.page_did_request_set_prompt_text(TRY(String::from_deprecated_string(text)));
// 7. Return success with data null.
return JsonValue {};