mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibWeb: Add NullOrError
to NavigationParamsVariant
To check whether a NavigationParams is null, we have to check whether it's `Empty` or `NullWithError`. Instead, we can merge both of these possible variants into an optional error. If `NullOrError` has no value it's null, otherwise it contains an error message.
This commit is contained in:
parent
5deb2b4cad
commit
e43e4d3a93
Notes:
github-actions[bot]
2024-11-27 21:16:35 +00:00
Author: https://github.com/dlarocque
Commit: e43e4d3a93
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2330
Reviewed-by: https://github.com/ADKaster ✅
3 changed files with 14 additions and 14 deletions
|
@ -644,7 +644,7 @@ TraversableNavigable::HistoryStepResult TraversableNavigable::apply_the_history_
|
|||
// targetSnapshotParams, with allowPOST set to allowPOST and completionSteps set to queue a global task on the navigation and traversal task source given
|
||||
// navigable's active window to run afterDocumentPopulated.
|
||||
Platform::EventLoopPlugin::the().deferred_invoke(GC::create_function(this->heap(), [populated_target_entry, potentially_target_specific_source_snapshot_params, target_snapshot_params, this, allow_POST, navigable, after_document_populated = GC::create_function(this->heap(), move(after_document_populated))] {
|
||||
navigable->populate_session_history_entry_document(populated_target_entry, *potentially_target_specific_source_snapshot_params, target_snapshot_params, {}, Empty {}, CSPNavigationType::Other, allow_POST, GC::create_function(this->heap(), [this, after_document_populated, populated_target_entry]() mutable {
|
||||
navigable->populate_session_history_entry_document(populated_target_entry, *potentially_target_specific_source_snapshot_params, target_snapshot_params, {}, Navigable::NullOrError {}, CSPNavigationType::Other, allow_POST, GC::create_function(this->heap(), [this, after_document_populated, populated_target_entry]() mutable {
|
||||
VERIFY(active_window());
|
||||
queue_global_task(Task::Source::NavigationAndTraversal, *active_window(), GC::create_function(this->heap(), [after_document_populated, populated_target_entry]() mutable {
|
||||
after_document_populated->function()(true, populated_target_entry);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue