mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16: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
|
@ -134,12 +134,16 @@ public:
|
|||
void did_request_color_picker(WeakPtr<HTML::HTMLInputElement> target, Color current_color);
|
||||
void color_picker_update(Optional<Color> picked_color, HTML::ColorPickerUpdateState state);
|
||||
|
||||
void did_request_file_picker(WeakPtr<HTML::HTMLInputElement> target, HTML::AllowMultipleFiles);
|
||||
void file_picker_closed(Span<HTML::SelectedFile> selected_files);
|
||||
|
||||
void did_request_select_dropdown(WeakPtr<HTML::HTMLSelectElement> target, Web::CSSPixelPoint content_position, Web::CSSPixels minimum_width, Vector<Web::HTML::SelectItem> items);
|
||||
void select_dropdown_closed(Optional<String> value);
|
||||
|
||||
enum class PendingNonBlockingDialog {
|
||||
None,
|
||||
ColorPicker,
|
||||
FilePicker,
|
||||
Select,
|
||||
};
|
||||
|
||||
|
@ -280,8 +284,8 @@ public:
|
|||
virtual void request_file(FileRequest) = 0;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/input.html#show-the-picker,-if-applicable
|
||||
virtual void page_did_request_file_picker(WeakPtr<DOM::EventTarget>, [[maybe_unused]] bool multiple) {};
|
||||
virtual void page_did_request_color_picker([[maybe_unused]] Color current_color) {};
|
||||
virtual void page_did_request_file_picker(Web::HTML::AllowMultipleFiles) {};
|
||||
virtual void page_did_request_select_dropdown([[maybe_unused]] Web::CSSPixelPoint content_position, [[maybe_unused]] Web::CSSPixels minimum_width, [[maybe_unused]] Vector<Web::HTML::SelectItem> items) {};
|
||||
|
||||
virtual void page_did_finish_text_test() {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue