mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:47:44 +00:00
LibWeb+LibWebView+WebContent: Add support for <input type="color">
This commit introduces 3 things: - Support for the color type in HTMLInputElement itself - A mechanism for handling non event loop blocking dialogs in Page - The associated plumbing up to ViewImplementation Frontends may add support for the color picker with the ViewImplementation.on_request_color_picker function
This commit is contained in:
parent
759ad905de
commit
2995a2e212
14 changed files with 110 additions and 4 deletions
|
@ -120,6 +120,14 @@ public:
|
|||
void dismiss_dialog();
|
||||
void accept_dialog();
|
||||
|
||||
void did_request_color_picker(WeakPtr<HTML::HTMLInputElement> target, Color current_color);
|
||||
void color_picker_closed(Optional<Color> picked_color);
|
||||
|
||||
enum class PendingNonBlockingDialog {
|
||||
None,
|
||||
ColorPicker,
|
||||
};
|
||||
|
||||
struct MediaContextMenu {
|
||||
AK::URL media_url;
|
||||
bool is_video { false };
|
||||
|
@ -168,6 +176,9 @@ private:
|
|||
Optional<bool> m_pending_confirm_response;
|
||||
Optional<Optional<String>> m_pending_prompt_response;
|
||||
|
||||
PendingNonBlockingDialog m_pending_non_blocking_dialog { PendingNonBlockingDialog::None };
|
||||
WeakPtr<HTML::HTMLInputElement> m_pending_non_blocking_dialog_target;
|
||||
|
||||
Optional<int> m_media_context_menu_element_id;
|
||||
|
||||
Optional<String> m_user_style_sheet_source;
|
||||
|
@ -241,6 +252,7 @@ public:
|
|||
|
||||
// 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_finish_text_test() {};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue