Skip to content

Commit d54753e

Browse files
AtkinsSJtcl3
authored andcommitted
LibWeb/HTML: Correct spec numbers in inner_navigate_event_firing_algo
I forgot to do this in 26b7946, oops!
1 parent 4374bf2 commit d54753e

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

Libraries/LibWeb/HTML/Navigation.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,17 +1015,17 @@ bool Navigation::inner_navigate_event_firing_algorithm(
10151015
// 18. Initialize event's sourceElement to sourceElement.
10161016
event_init.source_element = source_element;
10171017

1018-
// 18. Set event's abort controller to a new AbortController created in navigation's relevant realm.
1018+
// 19. Set event's abort controller to a new AbortController created in navigation's relevant realm.
10191019
// AD-HOC: Set on the NavigateEvent later after construction
10201020
auto abort_controller = MUST(DOM::AbortController::construct_impl(realm));
10211021

1022-
// 19. Initialize event's signal to event's abort controller's signal.
1022+
// 20. Initialize event's signal to event's abort controller's signal.
10231023
event_init.signal = abort_controller->signal();
10241024

1025-
// 20. Let currentURL be document's URL.
1025+
// 21. Let currentURL be document's URL.
10261026
auto current_url = document.url();
10271027

1028-
// 21. If all of the following are true:
1028+
// 22. If all of the following are true:
10291029
// - event's classic history API state is null;
10301030
// - destination's is same document is true;
10311031
// - destination's URL equals currentURL with exclude fragments set to true; and
@@ -1036,10 +1036,10 @@ bool Navigation::inner_navigate_event_firing_algorithm(
10361036
&& destination->raw_url().equals(current_url, URL::ExcludeFragment::Yes)
10371037
&& destination->raw_url().fragment() != current_url.fragment());
10381038

1039-
// 22. If userInvolvement is not "none", then initialize event's userInitiated to true. Otherwise, initialize it to false.
1039+
// 23. If userInvolvement is not "none", then initialize event's userInitiated to true. Otherwise, initialize it to false.
10401040
event_init.user_initiated = user_involvement != UserNavigationInvolvement::None;
10411041

1042-
// 23. If formDataEntryList is not null, then initialize event's formData to a new FormData created in navigation's relevant realm,
1042+
// 24. If formDataEntryList is not null, then initialize event's formData to a new FormData created in navigation's relevant realm,
10431043
// associated to formDataEntryList. Otherwise, initialize it to null.
10441044
if (form_data_entry_list.has_value()) {
10451045
event_init.form_data = MUST(XHR::FormData::construct_impl(realm, form_data_entry_list.release_value()));
@@ -1055,22 +1055,22 @@ bool Navigation::inner_navigate_event_firing_algorithm(
10551055
// we're doing a push or replace. We set it here because we create the event here
10561056
event->set_classic_history_api_state(move(classic_history_api_state));
10571057

1058-
// 24. Assert: navigation's ongoing navigate event is null.
1058+
// 25. Assert: navigation's ongoing navigate event is null.
10591059
VERIFY(m_ongoing_navigate_event == nullptr);
10601060

1061-
// 25. Set navigation's ongoing navigate event to event.
1061+
// 26. Set navigation's ongoing navigate event to event.
10621062
m_ongoing_navigate_event = event;
10631063

1064-
// 26. Set navigation's focus changed during ongoing navigation to false.
1064+
// 27. Set navigation's focus changed during ongoing navigation to false.
10651065
m_focus_changed_during_ongoing_navigation = false;
10661066

1067-
// 27. Set navigation's suppress normal scroll restoration during ongoing navigation to false.
1067+
// 28. Set navigation's suppress normal scroll restoration during ongoing navigation to false.
10681068
m_suppress_scroll_restoration_during_ongoing_navigation = false;
10691069

1070-
// 28. Let dispatchResult be the result of dispatching event at navigation.
1070+
// 29. Let dispatchResult be the result of dispatching event at navigation.
10711071
auto dispatch_result = dispatch_event(*event);
10721072

1073-
// 29. If dispatchResult is false:
1073+
// 30. If dispatchResult is false:
10741074
if (!dispatch_result) {
10751075
// 1. If navigationType is "traverse", then consume history-action user activation given navigation's relevant global object.
10761076
if (navigation_type == Bindings::NavigationType::Traverse)
@@ -1084,15 +1084,15 @@ bool Navigation::inner_navigate_event_firing_algorithm(
10841084
return false;
10851085
}
10861086

1087-
// 30. Let endResultIsSameDocument be true if event's interception state
1087+
// 31. Let endResultIsSameDocument be true if event's interception state
10881088
// is not "none" or event's destination's is same document is true.
10891089
bool const end_result_is_same_document = (event->interception_state() != NavigateEvent::InterceptionState::None) || event->destination()->same_document();
10901090

1091-
// 31. Prepare to run script given navigation's relevant settings object.
1091+
// 32. Prepare to run script given navigation's relevant settings object.
10921092
// NOTE: There's a massive spec note here
10931093
TemporaryExecutionContext execution_context { realm, TemporaryExecutionContext::CallbacksEnabled::Yes };
10941094

1095-
// 32. If event's interception state is not "none":
1095+
// 33. If event's interception state is not "none":
10961096
if (event->interception_state() != NavigateEvent::InterceptionState::None) {
10971097
// 1. Set event's interception state to "committed".
10981098
event->set_interception_state(NavigateEvent::InterceptionState::Committed);
@@ -1104,7 +1104,7 @@ bool Navigation::inner_navigate_event_firing_algorithm(
11041104
VERIFY(from_nhe != nullptr);
11051105

11061106
// 4. Set navigation's transition to a new NavigationTransition created in navigation's relevant realm,
1107-
// whose navigation type is navigationType, from entry is fromNHE, and whose finished promise is a new promise
1107+
// whose navigation type is navigationType, whose from entry is fromNHE, and whose finished promise is a new promise
11081108
// created in navigation's relevant realm.
11091109
m_transition = NavigationTransition::create(realm, navigation_type, *from_nhe, WebIDL::create_promise(realm));
11101110

@@ -1129,7 +1129,7 @@ bool Navigation::inner_navigate_event_firing_algorithm(
11291129
// Big spec note about reload here
11301130
}
11311131

1132-
// 33. If endResultIsSameDocument is true:
1132+
// 34. If endResultIsSameDocument is true:
11331133
if (end_result_is_same_document) {
11341134
// 1. Let promisesList be an empty list.
11351135
GC::RootVector<GC::Ref<WebIDL::Promise>> promises_list(realm.heap());
@@ -1238,16 +1238,16 @@ bool Navigation::inner_navigate_event_firing_algorithm(
12381238
});
12391239
}
12401240

1241-
// 34. Otherwise, if apiMethodTracker is non-null, then clean up apiMethodTracker.
1241+
// 35. Otherwise, if apiMethodTracker is non-null, then clean up apiMethodTracker.
12421242
else if (api_method_tracker != nullptr) {
12431243
clean_up(*api_method_tracker);
12441244
}
12451245

1246-
// 35. Clean up after running script given navigation's relevant settings object.
1246+
// 36. Clean up after running script given navigation's relevant settings object.
12471247
// Handled by TemporaryExecutionContext destructor from step 31
12481248

1249-
// 36. If event's interception state is "none", then return true.
1250-
// 37. Return false.
1249+
// 37. If event's interception state is "none", then return true.
1250+
// 38. Return false.
12511251
return event->interception_state() == NavigateEvent::InterceptionState::None;
12521252
}
12531253

0 commit comments

Comments
 (0)