mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09:08 +00:00
LibWeb: Check if navigationParams is NullWithError
When we check whether navigationParams is null, we should check if it is `NullWithError`, since `NullWithError` is equivalent to `Empty`, but is used for error messages.
This commit is contained in:
parent
1f9295ca2e
commit
219cb04865
Notes:
github-actions[bot]
2024-10-23 17:24:22 +00:00
Author: https://github.com/dlarocque 🔰
Commit: 219cb04865
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1933
Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 4 additions and 4 deletions
|
@ -1071,7 +1071,7 @@ WebIDL::ExceptionOr<void> Navigable::populate_session_history_entry_document(
|
||||||
|
|
||||||
// 2. Assert: if navigationParams is non-null, then navigationParams's response is non-null.
|
// 2. Assert: if navigationParams is non-null, then navigationParams's response is non-null.
|
||||||
// NavigationParams' response field is NonnullGCPtr
|
// NavigationParams' response field is NonnullGCPtr
|
||||||
if (!navigation_params.has<Empty>())
|
if (!navigation_params.has<Empty>() && !navigation_params.has<NullWithError>())
|
||||||
VERIFY(navigation_params.has<JS::NonnullGCPtr<NavigationParams>>());
|
VERIFY(navigation_params.has<JS::NonnullGCPtr<NavigationParams>>());
|
||||||
|
|
||||||
// 3. Let currentBrowsingContext be navigable's active browsing context.
|
// 3. Let currentBrowsingContext be navigable's active browsing context.
|
||||||
|
@ -1081,7 +1081,7 @@ WebIDL::ExceptionOr<void> Navigable::populate_session_history_entry_document(
|
||||||
auto document_resource = entry->document_state()->resource();
|
auto document_resource = entry->document_state()->resource();
|
||||||
|
|
||||||
// 5. If navigationParams is null, then:
|
// 5. If navigationParams is null, then:
|
||||||
if (navigation_params.has<Empty>()) {
|
if (navigation_params.has<Empty>() || navigation_params.has<NullWithError>()) {
|
||||||
// 1. If documentResource is a string, then set navigationParams to the result
|
// 1. If documentResource is a string, then set navigationParams to the result
|
||||||
// of creating navigation params from a srcdoc resource given entry, navigable,
|
// of creating navigation params from a srcdoc resource given entry, navigable,
|
||||||
// targetSnapshotParams, navigationId, and navTimingType.
|
// targetSnapshotParams, navigationId, and navTimingType.
|
||||||
|
@ -1170,7 +1170,7 @@ WebIDL::ExceptionOr<void> Navigable::populate_session_history_entry_document(
|
||||||
saveExtraDocumentState = false;
|
saveExtraDocumentState = false;
|
||||||
|
|
||||||
// 4. If navigationParams is not null, then:
|
// 4. If navigationParams is not null, then:
|
||||||
if (navigation_params.has<Empty>()) {
|
if (!navigation_params.has<Empty>() && !navigation_params.has<NullWithError>()) {
|
||||||
// FIXME: 1. Run the environment discarding steps for navigationParams's reserved environment.
|
// FIXME: 1. Run the environment discarding steps for navigationParams's reserved environment.
|
||||||
// FIXME: 2. Invoke WebDriver BiDi navigation failed with currentBrowsingContext and a new WebDriver BiDi navigation status whose id is navigationId, status is "canceled", and url is navigationParams's response's URL.
|
// FIXME: 2. Invoke WebDriver BiDi navigation failed with currentBrowsingContext and a new WebDriver BiDi navigation status whose id is navigationId, status is "canceled", and url is navigationParams's response's URL.
|
||||||
}
|
}
|
||||||
|
@ -1202,7 +1202,7 @@ WebIDL::ExceptionOr<void> Navigable::populate_session_history_entry_document(
|
||||||
|
|
||||||
// 3. If entry's document state's request referrer is "client", and navigationParams is a navigation params (i.e., neither null nor a non-fetch scheme navigation params), then:
|
// 3. If entry's document state's request referrer is "client", and navigationParams is a navigation params (i.e., neither null nor a non-fetch scheme navigation params), then:
|
||||||
if (entry->document_state()->request_referrer() == Fetch::Infrastructure::Request::Referrer::Client
|
if (entry->document_state()->request_referrer() == Fetch::Infrastructure::Request::Referrer::Client
|
||||||
&& (!navigation_params.has<Empty>() && Fetch::Infrastructure::is_fetch_scheme(entry->url().scheme()))) {
|
&& (!navigation_params.has<Empty>() && !navigation_params.has<NullWithError>() && Fetch::Infrastructure::is_fetch_scheme(entry->url().scheme()))) {
|
||||||
// FIXME: 1. Assert: navigationParams's request is not null.
|
// FIXME: 1. Assert: navigationParams's request is not null.
|
||||||
// FIXME: 2. Set entry's document state's request referrer to navigationParams's request's referrer.
|
// FIXME: 2. Set entry's document state's request referrer to navigationParams's request's referrer.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue