1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 10:01:13 +09:00

LibWeb: Implement Window.prompt()

This commit is contained in:
Linus Groh 2021-02-20 12:05:18 +01:00 committed by Andreas Kling
parent f10967e364
commit 5e07c27e25
Notes: sideshowbarker 2024-07-18 22:07:15 +09:00
14 changed files with 74 additions and 2 deletions

View file

@ -28,6 +28,7 @@
#include "WebContentClient.h"
#include <AK/String.h>
#include <AK/URLParser.h>
#include <LibGUI/InputBox.h>
#include <LibGUI/MessageBox.h>
#include <LibGUI/Painter.h>
#include <LibGUI/ScrollBar.h>
@ -293,6 +294,14 @@ bool OutOfProcessWebView::notify_server_did_request_confirm(Badge<WebContentClie
return confirm_result == GUI::Dialog::ExecResult::ExecOK;
}
String OutOfProcessWebView::notify_server_did_request_prompt(Badge<WebContentClient>, const String& message, const String& default_)
{
String response { default_ };
if (GUI::InputBox::show(window(), response, message, "Prompt") == GUI::InputBox::ExecOK)
return response;
return {};
}
void OutOfProcessWebView::did_scroll()
{
client().post_message(Messages::WebContentServer::SetViewportRect(visible_content_rect()));