mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:57:46 +00:00
LibWeb+LibWebView+WebContent: Implement more <input type=file> behavior
We had previous implemented some plumbing for file input elements in
commit 636602a54e
.
This implements the return path for chromes to inform WebContent of the
file(s) the user selected. This patch includes a dummy implementation
for headless-browser to enable testing.
This commit is contained in:
parent
435c2c24d1
commit
108521a566
23 changed files with 307 additions and 5 deletions
|
@ -28,6 +28,8 @@
|
|||
#include <LibWeb/DOM/Text.h>
|
||||
#include <LibWeb/Dump.h>
|
||||
#include <LibWeb/HTML/BrowsingContext.h>
|
||||
#include <LibWeb/HTML/HTMLInputElement.h>
|
||||
#include <LibWeb/HTML/SelectedFile.h>
|
||||
#include <LibWeb/HTML/Storage.h>
|
||||
#include <LibWeb/HTML/TraversableNavigable.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
|
@ -1317,6 +1319,18 @@ void ConnectionFromClient::color_picker_update(u64 page_id, Optional<Color> cons
|
|||
page.page().color_picker_update(picked_color, state);
|
||||
}
|
||||
|
||||
void ConnectionFromClient::file_picker_closed(u64 page_id, Vector<Web::HTML::SelectedFile> const& selected_files)
|
||||
{
|
||||
auto maybe_page = page(page_id);
|
||||
if (!maybe_page.has_value()) {
|
||||
dbgln("ConnectionFromClient::color_picker_update: No page with ID {}", page_id);
|
||||
return;
|
||||
}
|
||||
|
||||
auto& page = maybe_page.release_value();
|
||||
page.page().file_picker_closed(const_cast<Vector<Web::HTML::SelectedFile>&>(selected_files));
|
||||
}
|
||||
|
||||
void ConnectionFromClient::select_dropdown_closed(u64 page_id, Optional<String> const& value)
|
||||
{
|
||||
auto maybe_page = page(page_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue