mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibWeb+LibWebView+WebContent: Return a named enum from UI event handlers
UI event handlers currently return a boolean where false means the event was cancelled by a script on the page, or otherwise dropped. It has been a point of confusion for some time now, as it's not particularly clear what should be returned in some special cases, or how the UI process should handle the response. This adds an enumeration with a few states that indicate exactly how the WebContent process handled the event. This should remove all ambiguity, and let us properly handle these states going forward. There should be no behavior change with this patch. It's meant to only introduce the enum, not change any of our decisions based on the result.
This commit is contained in:
parent
a64d182583
commit
541968b30d
Notes:
github-actions[bot]
2024-09-12 21:39:29 +00:00
Author: https://github.com/trflynn89
Commit: 541968b30d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1383
Reviewed-by: https://github.com/awesomekling ✅
15 changed files with 200 additions and 161 deletions
|
@ -22,6 +22,7 @@
|
|||
#include <LibWeb/HTML/ColorPickerUpdateState.h>
|
||||
#include <LibWeb/HTML/FileFilter.h>
|
||||
#include <LibWeb/HTML/SelectItem.h>
|
||||
#include <LibWeb/Page/EventResult.h>
|
||||
#include <LibWeb/Page/InputEvent.h>
|
||||
#include <LibWebView/Forward.h>
|
||||
#include <LibWebView/WebContentClient.h>
|
||||
|
@ -61,7 +62,7 @@ public:
|
|||
float device_pixel_ratio() const { return m_device_pixel_ratio; }
|
||||
|
||||
void enqueue_input_event(Web::InputEvent);
|
||||
void did_finish_handling_input_event(Badge<WebContentClient>, bool event_was_accepted);
|
||||
void did_finish_handling_input_event(Badge<WebContentClient>, Web::EventResult event_result);
|
||||
|
||||
void set_preferred_color_scheme(Web::CSS::PreferredColorScheme);
|
||||
void set_preferred_contrast(Web::CSS::PreferredContrast);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue