Truly independent web browser
LibWeb+LibWebView+WebContent: Run afterDocumentPopulated in UI
Shannon Booth000281e8a465
diff --git a/Libraries/LibWeb/HTML/ApplyHistoryStep.h b/Libraries/LibWeb/HTML/ApplyHistoryStep.hindex 7688d232f10..424ef75e55e 100644--- a/Libraries/LibWeb/HTML/ApplyHistoryStep.h+++ b/Libraries/LibWeb/HTML/ApplyHistoryStep.h@@ -17,7 +17,7 @@ namespace Web::HTML {using OnApplyHistoryStepComplete = GC::Function<void(HistoryStepResult)>;-using OnChangingNavigableHistoryStepJobComplete = GC::Function<void(ChangingNavigableHistoryStepJobDisposition, bool update_only, Optional<CrossProcessId> target_document_id)>;+using OnChangingNavigableHistoryStepJobComplete = GC::Function<void(ChangingNavigableHistoryStepJobDisposition, bool update_only)>;using OnChangingNavigableContinuationApplied = GC::Function<void(Optional<HostedNavigableState> activated_navigable_state, Optional<SessionHistoryEntryPersistedState> previous_entry_persisted_state)>;diff --git a/Libraries/LibWeb/HTML/HistoryExecutor.cpp b/Libraries/LibWeb/HTML/HistoryExecutor.cppindex 6e234f7bd11..3313730aaf7 100644--- a/Libraries/LibWeb/HTML/HistoryExecutor.cpp+++ b/Libraries/LibWeb/HTML/HistoryExecutor.cpp@@ -39,7 +39,6 @@ struct ChangingNavigableContinuationState : public GC::Cell {GC::Ptr<DOM::Document> pending_document;GC::Ptr<PopulateSessionHistoryEntryDocumentOutput> population_output;GC::Ptr<DOM::Document> target_document;- Optional<URL::Origin> old_origin;UserNavigationInvolvement user_involvement { UserNavigationInvolvement::None };virtual void visit_edges(Cell::Visitor& visitor) override@@ -288,10 +287,7 @@ void HistoryExecutor::enqueue_changing_navigable_continuation(CrossProcessId opeif (auto* operation = find_history_operation(operation_id))operation->changing_navigable_jobs.get(continuation->navigable->id())->continuation = continuation;- // NB: The UI process applies the continuation as step 14.10 or step 14.11 of apply the history step says, given- // its update-only and targetEntry's document.- auto target_document_id = continuation->target_document ? continuation->target_document->id() : Optional<CrossProcessId> {};- on_complete->function()(ChangingNavigableHistoryStepJobDisposition::Ready, continuation->update_only, target_document_id);+ on_complete->function()(ChangingNavigableHistoryStepJobDisposition::Ready, continuation->update_only);}void HistoryExecutor::run_ui_changing_navigable_history_job(CrossProcessId operation_id, CrossProcessId navigable_id, SessionHistoryEntryDescriptor target_entry_descriptor, UserNavigationInvolvement user_involvement, Optional<Bindings::NavigationType> navigation_type, Optional<Utf16String> finalized_navigation_id, bool ongoing_navigation_is_traversal, bool needs_population, GC::Ref<OnChangingNavigableHistoryStepJobComplete> on_complete, Optional<HistoryNavigationPopulation> population)@@ -311,7 +307,7 @@ void HistoryExecutor::run_ui_changing_navigable_history_job(CrossProcessId opera// leaves no active window to queue the task on.auto navigable = local_navigable_with_id(navigable_id);if (!navigable || navigable->has_been_destroyed() || !navigable->active_window()) {- on_complete->function()(ChangingNavigableHistoryStepJobDisposition::Skipped, false, {});+ on_complete->function()(ChangingNavigableHistoryStepJobDisposition::Skipped, false);return;}@@ -446,9 +442,8 @@ void HistoryExecutor::run_ui_changing_navigable_history_job(CrossProcessId operanavigation->fire_a_traverse_navigate_event(*target_entry, user_involvement);}- auto after_document_populated = GC::create_function(heap(), [this, operation_id, old_origin, changing_navigable_continuation, on_complete](GC::Ptr<PopulateSessionHistoryEntryDocumentOutput> output) mutable {+ auto after_document_populated = GC::create_function(heap(), [this, operation_id, changing_navigable_continuation, on_complete](GC::Ptr<PopulateSessionHistoryEntryDocumentOutput> output) mutable {changing_navigable_continuation->population_output = output;- changing_navigable_continuation->old_origin = old_origin;// NB: Population that produces no document leaves targetEntry's document as it was.if (output && output->document)@@ -458,13 +453,7 @@ void HistoryExecutor::run_ui_changing_navigable_history_job(CrossProcessId operaif (!changing_navigable_continuation->target_document)changing_navigable_continuation->update_only = true;- // 2. If targetEntry's document's origin is not oldOrigin, then set targetEntry's classic history API state to StructuredSerializeForStorage(null).- // 3. If all of the following are true:- // - navigable's parent is null;- // - targetEntry's document's browsing context is not an auxiliary browsing context whose opener browsing context is non-null; and- // - targetEntry's document's origin is not oldOrigin,- // then set targetEntry's document state's navigable target name to the empty string.- // NOTE: Steps 2-3 are deferred to after_potential_unload to avoid exposing mutations during unload.+ // NB: The UI process runs steps 2 and 3.// 4. Enqueue changingNavigableContinuation on changingNavigableContinuations.enqueue_changing_navigable_continuation(operation_id, *changing_navigable_continuation, on_complete);@@ -568,7 +557,7 @@ void HistoryExecutor::clear_ui_changing_navigable_ongoing_traversal(CrossProcess// Steps 14.4 to 14.9 and step 14.12 of apply the history step, for the changing navigable continuation the UI process// dequeued.-Optional<HistoryExecutor::DequeuedChangingNavigableContinuation> HistoryExecutor::dequeue_ui_changing_navigable_continuation(CrossProcessId operation_id, CrossProcessId navigable_id, SessionHistoryEntryIdentity target_entry_identity, HistoryObjectLengthAndIndex history_object_length_and_index, Vector<SessionHistoryEntryDescriptor> entry_descriptors_for_navigation_api, GC::Ref<OnChangingNavigableContinuationApplied> on_complete)+Optional<HistoryExecutor::DequeuedChangingNavigableContinuation> HistoryExecutor::dequeue_ui_changing_navigable_continuation(CrossProcessId operation_id, CrossProcessId navigable_id, SessionHistoryEntryIdentity target_entry_identity, HistoryObjectLengthAndIndex history_object_length_and_index, Vector<SessionHistoryEntryDescriptor> entry_descriptors_for_navigation_api, bool clear_classic_history_api_state, bool clear_navigable_target_name, GC::Ref<OnChangingNavigableContinuationApplied> on_complete){auto* operation = find_history_operation(operation_id);VERIFY(operation);@@ -609,11 +598,10 @@ Optional<HistoryExecutor::DequeuedChangingNavigableContinuation> HistoryExecutor}auto population_output = continuation->population_output;- auto old_origin = continuation->old_origin;// 12. In both cases, let afterPotentialUnloads be the following steps:bool const update_only = continuation->update_only;- auto after_potential_unload = GC::create_function(heap(), [this, navigable, update_only, target_entry, continuation, population_output, old_origin, displayed_document = GC::Ref { *displayed_document }, script_history_length, script_history_index, entries_for_navigation_api = move(entries_for_navigation_api), navigation_type = continuation->navigation_type, on_complete] {+ auto after_potential_unload = GC::create_function(heap(), [this, navigable, update_only, target_entry, continuation, population_output, clear_classic_history_api_state, clear_navigable_target_name, displayed_document = GC::Ref { *displayed_document }, script_history_length, script_history_index, entries_for_navigation_api = move(entries_for_navigation_api), navigation_type = continuation->navigation_type, on_complete] {// AD-HOC: A provisional navigable stands in for a navigable another process hosts, which is destroyed as soon// as its container is removed, e.g. while displayedDocument unloads. The provisional navigable is only// discarded once that navigable's subtree has unloaded, and has no container to take over until then.@@ -629,31 +617,15 @@ Optional<HistoryExecutor::DequeuedChangingNavigableContinuation> HistoryExecutorreturn;}+ // AD-HOC: What populating targetEntry's document changed in it, and steps 2 and 3 of afterDocumentPopulated, which+ // the UI process ran, are applied after potential unloads: For a reload, targetEntry is displayedDocument's+ // entry. See https://github.com/whatwg/html/issues/9869.if (population_output)population_output->apply_to(*target_entry);-- // Post-population adjustments — only run when a fresh document was produced- // (not for 204/205 no-document outcomes where targetEntry's document is null).- bool has_fresh_document = continuation->pending_document || (population_output && population_output->document);- if (has_fresh_document) {- auto target_document = continuation->target_document;- // 2. If targetEntry's document's origin is not oldOrigin, then set targetEntry's classic history API state to StructuredSerializeForStorage(null).- if (target_document->origin() != old_origin) {- auto& vm = navigable->vm();- target_entry->set_classic_history_api_state(MUST(structured_serialize_for_storage(vm, JS::js_null())));- }-- // 3. If all of the following are true:- // - navigable's parent is null;- // - targetEntry's document's browsing context is not an auxiliary browsing context whose opener browsing context is non-null; and- // - targetEntry's document's origin is not oldOrigin,- // then set targetEntry's document state's navigable target name to the empty string.- if (navigable->parent() == nullptr- && !(target_document->browsing_context()->is_auxiliary() && target_document->browsing_context()->opener_browsing_context_window_proxy())- && target_entry->document_state()->origin() != old_origin) {- target_entry->document_state()->set_navigable_target_name(Utf16String {});- }- }+ if (clear_classic_history_api_state)+ target_entry->set_classic_history_api_state(MUST(structured_serialize_for_storage(navigable->vm(), JS::js_null())));+ if (clear_navigable_target_name)+ target_entry->document_state()->set_navigable_target_name(Utf16String {});// 1. Let previousEntry be navigable's active session history entry.auto previous_entry = navigable->active_session_history_entry();@@ -718,9 +690,9 @@ Optional<HistoryExecutor::DequeuedChangingNavigableContinuation> HistoryExecutor}// 10. If changingNavigableContinuation's update-only is true, or targetEntry's document is displayedDocument:-void HistoryExecutor::apply_ui_changing_navigable_continuation(CrossProcessId operation_id, CrossProcessId navigable_id, SessionHistoryEntryIdentity target_entry_identity, HistoryObjectLengthAndIndex history_object_length_and_index, Vector<SessionHistoryEntryDescriptor> entries_for_navigation_api, GC::Ref<OnChangingNavigableContinuationApplied> on_complete)+void HistoryExecutor::apply_ui_changing_navigable_continuation(CrossProcessId operation_id, CrossProcessId navigable_id, SessionHistoryEntryIdentity target_entry_identity, HistoryObjectLengthAndIndex history_object_length_and_index, Vector<SessionHistoryEntryDescriptor> entries_for_navigation_api, bool clear_classic_history_api_state, bool clear_navigable_target_name, GC::Ref<OnChangingNavigableContinuationApplied> on_complete){- auto dequeued = dequeue_ui_changing_navigable_continuation(operation_id, navigable_id, target_entry_identity, history_object_length_and_index, move(entries_for_navigation_api), on_complete);+ auto dequeued = dequeue_ui_changing_navigable_continuation(operation_id, navigable_id, target_entry_identity, history_object_length_and_index, move(entries_for_navigation_api), clear_classic_history_api_state, clear_navigable_target_name, on_complete);if (!dequeued.has_value()) {on_complete->function()({}, {});return;@@ -740,9 +712,9 @@ void HistoryExecutor::apply_ui_changing_navigable_continuation(CrossProcessId op// 2. Deactivate displayedDocument, given userInvolvement, targetEntry, navigationType, and afterPotentialUnloads.// NB: The UI process has unloaded every descendant subtree of displayedDocument. This is the task that unload a document// and its descendants queues last, for displayedDocument.-void HistoryExecutor::unload_displayed_document_and_apply_ui_changing_navigable_continuation(CrossProcessId operation_id, CrossProcessId navigable_id, SessionHistoryEntryIdentity target_entry_identity, HistoryObjectLengthAndIndex history_object_length_and_index, Vector<SessionHistoryEntryDescriptor> entries_for_navigation_api, GC::Ref<OnChangingNavigableContinuationApplied> on_complete)+void HistoryExecutor::unload_displayed_document_and_apply_ui_changing_navigable_continuation(CrossProcessId operation_id, CrossProcessId navigable_id, SessionHistoryEntryIdentity target_entry_identity, HistoryObjectLengthAndIndex history_object_length_and_index, Vector<SessionHistoryEntryDescriptor> entries_for_navigation_api, bool clear_classic_history_api_state, bool clear_navigable_target_name, GC::Ref<OnChangingNavigableContinuationApplied> on_complete){- auto dequeued = dequeue_ui_changing_navigable_continuation(operation_id, navigable_id, target_entry_identity, history_object_length_and_index, move(entries_for_navigation_api), on_complete);+ auto dequeued = dequeue_ui_changing_navigable_continuation(operation_id, navigable_id, target_entry_identity, history_object_length_and_index, move(entries_for_navigation_api), clear_classic_history_api_state, clear_navigable_target_name, on_complete);if (!dequeued.has_value()) {on_complete->function()({}, {});return;diff --git a/Libraries/LibWeb/HTML/HistoryExecutor.h b/Libraries/LibWeb/HTML/HistoryExecutor.hindex 0d3a0a2b0fa..a095b46b8c8 100644--- a/Libraries/LibWeb/HTML/HistoryExecutor.h+++ b/Libraries/LibWeb/HTML/HistoryExecutor.h@@ -70,8 +70,8 @@ public:void run_ui_changing_navigable_history_job(CrossProcessId operation_id, CrossProcessId navigable_id, SessionHistoryEntryDescriptor target_entry_descriptor, UserNavigationInvolvement, Optional<Bindings::NavigationType>, Optional<Utf16String> finalized_navigation_id, bool ongoing_navigation_is_traversal, bool needs_population, GC::Ref<OnChangingNavigableHistoryStepJobComplete>, Optional<HistoryNavigationPopulation> = {});bool create_ui_history_navigation_params(CrossProcessId operation_id, NavigationPopulationRequest, bool allow_POST);bool resume_history_navigation_population(CrossProcessId operation_id, HistoryNavigationPopulation&&);- void apply_ui_changing_navigable_continuation(CrossProcessId operation_id, CrossProcessId navigable_id, SessionHistoryEntryIdentity target_entry_identity, HistoryObjectLengthAndIndex, Vector<SessionHistoryEntryDescriptor> entries_for_navigation_api, GC::Ref<OnChangingNavigableContinuationApplied>);- void unload_displayed_document_and_apply_ui_changing_navigable_continuation(CrossProcessId operation_id, CrossProcessId navigable_id, SessionHistoryEntryIdentity target_entry_identity, HistoryObjectLengthAndIndex, Vector<SessionHistoryEntryDescriptor> entries_for_navigation_api, GC::Ref<OnChangingNavigableContinuationApplied>);+ void apply_ui_changing_navigable_continuation(CrossProcessId operation_id, CrossProcessId navigable_id, SessionHistoryEntryIdentity target_entry_identity, HistoryObjectLengthAndIndex, Vector<SessionHistoryEntryDescriptor> entries_for_navigation_api, bool clear_classic_history_api_state, bool clear_navigable_target_name, GC::Ref<OnChangingNavigableContinuationApplied>);+ void unload_displayed_document_and_apply_ui_changing_navigable_continuation(CrossProcessId operation_id, CrossProcessId navigable_id, SessionHistoryEntryIdentity target_entry_identity, HistoryObjectLengthAndIndex, Vector<SessionHistoryEntryDescriptor> entries_for_navigation_api, bool clear_classic_history_api_state, bool clear_navigable_target_name, GC::Ref<OnChangingNavigableContinuationApplied>);void clear_ui_changing_navigable_ongoing_traversal(CrossProcessId operation_id, CrossProcessId navigable_id);private:@@ -86,7 +86,7 @@ private:GC::Ref<ChangingNavigableContinuationState> continuation;GC::Ref<GC::Function<void()>> after_potential_unloads;};- Optional<DequeuedChangingNavigableContinuation> dequeue_ui_changing_navigable_continuation(CrossProcessId operation_id, CrossProcessId navigable_id, SessionHistoryEntryIdentity target_entry_identity, HistoryObjectLengthAndIndex, Vector<SessionHistoryEntryDescriptor> entries_for_navigation_api, GC::Ref<OnChangingNavigableContinuationApplied>);+ Optional<DequeuedChangingNavigableContinuation> dequeue_ui_changing_navigable_continuation(CrossProcessId operation_id, CrossProcessId navigable_id, SessionHistoryEntryIdentity target_entry_identity, HistoryObjectLengthAndIndex, Vector<SessionHistoryEntryDescriptor> entries_for_navigation_api, bool clear_classic_history_api_state, bool clear_navigable_target_name, GC::Ref<OnChangingNavigableContinuationApplied>);void enqueue_changing_navigable_continuation(CrossProcessId operation_id, GC::Ref<ChangingNavigableContinuationState>, GC::Ref<OnChangingNavigableHistoryStepJobComplete>);diff --git a/Libraries/LibWebView/ApplyHistoryStep.h b/Libraries/LibWebView/ApplyHistoryStep.hindex c1dd49956ed..0ff6129ef38 100644--- a/Libraries/LibWebView/ApplyHistoryStep.h+++ b/Libraries/LibWebView/ApplyHistoryStep.h@@ -73,11 +73,13 @@ struct WEBVIEW_API ChangingNavigable {Optional<Continuation> continuation;// https://html.spec.whatwg.org/multipage/browsing-the-web.html#changing-navigable-continuation-state- // NB: Its target entry and navigable are the record's. The process running the job reports the rest.+ // NB: Its target entry and navigable are the record's. The process running the job reports update-only.RefPtr<CanonicalDocument> displayed_document;bool update_only { false };- // targetEntry's document, as the job left it.- Optional<Web::HTML::CrossProcessId> target_document_id;++ // Steps 2 and 3 of afterDocumentPopulated, which the continuation applies after potential unloads.+ bool clears_classic_history_api_state { false };+ bool clears_navigable_target_name { false };// targetEntry's document, as the job's process has it.RefPtr<CanonicalDocument> target_document(WebContentPage const& job_page) const;diff --git a/Libraries/LibWebView/CanonicalNavigable.cpp b/Libraries/LibWebView/CanonicalNavigable.cppindex fd14a333542..6c5db27d8fa 100644--- a/Libraries/LibWebView/CanonicalNavigable.cpp+++ b/Libraries/LibWebView/CanonicalNavigable.cpp@@ -1451,6 +1451,32 @@ bool CanonicalNavigable::active_document_is(CanonicalSessionHistoryEntry const&return m_active_session_history_entry && entry.document_state->document == &active_document();}+// https://html.spec.whatwg.org/multipage/browsing-the-web.html#create-navigation-params-by-fetching+// NB: The fields of entry that populating its document changed, as the UI process's population request has them. A new+// document state replaces entry's, which then holds the document populated for the one it replaces.+void CanonicalNavigable::apply_populated_history_entry(CanonicalSessionHistoryEntry& entry, Web::HTML::PendingSessionHistoryEntryDescriptor const& populated_entry)+{+ entry.url = populated_entry.url;+ entry.directive_state_value = populated_entry.directive_state_value;+ entry.classic_history_api_state = populated_entry.classic_history_api_state;+ if (populated_entry.document_state.id == entry.document_state->id) {+ entry.document_state->resource = populated_entry.document_state.resource;+ return;+ }++ // NB: Fetching replaces entry's document state with a new one, which has no nested histories.+ auto document_state_descriptor = populated_entry.document_state;+ document_state_descriptor.nested_histories.clear();+ auto document_state = CanonicalDocumentState::create_from_descriptor(document_state_descriptor);+ // NB: For a reload, entry is the active entry, so the new document state holds the active document until the one+ // populated for it is activated.+ document_state->document = exchange(entry.document_state->document, nullptr);+ document_state->populated_document = exchange(entry.document_state->populated_document, {});+ if (m_document_state_populated_by_history_job == entry.document_state)+ m_document_state_populated_by_history_job = document_state;+ entry.document_state = move(document_state);+}+void CanonicalNavigable::did_commit_navigation(CanonicalSessionHistoryEntry& entry, Web::HTML::HostedNavigableState hosted_state, u64 operation_sequence_number, Optional<Utf16String const&> navigation_id, RefPtr<WebContentPage> host){// A navigation admitted after the operation, such as one admitted during a same-document traversal, is newer than it.diff --git a/Libraries/LibWebView/CanonicalNavigable.h b/Libraries/LibWebView/CanonicalNavigable.hindex a55ebe883b0..305fb911977 100644--- a/Libraries/LibWebView/CanonicalNavigable.h+++ b/Libraries/LibWebView/CanonicalNavigable.h@@ -227,6 +227,7 @@ public:// A history operation activated the entry. It commits the navigation it names, or with none named, the ongoing// navigation admitted before the operation's sequence number.+ void apply_populated_history_entry(CanonicalSessionHistoryEntry&, Web::HTML::PendingSessionHistoryEntryDescriptor const&);void did_commit_navigation(CanonicalSessionHistoryEntry&, Web::HTML::HostedNavigableState, u64 operation_sequence_number, Optional<Utf16String const&> navigation_id, RefPtr<WebContentPage> host);// https://html.spec.whatwg.org/multipage/browsing-the-web.html#ongoing-navigationdiff --git a/Libraries/LibWebView/CanonicalSessionHistoryEntry.cpp b/Libraries/LibWebView/CanonicalSessionHistoryEntry.cppindex 8d10c9673d5..6e4fe636cd3 100644--- a/Libraries/LibWebView/CanonicalSessionHistoryEntry.cpp+++ b/Libraries/LibWebView/CanonicalSessionHistoryEntry.cpp@@ -109,6 +109,12 @@ static NonnullRefPtr<CanonicalDocumentState> document_state_from_descriptor(Web:return document_state;}+NonnullRefPtr<CanonicalDocumentState> CanonicalDocumentState::create_from_descriptor(Web::HTML::SessionHistoryDocumentStateDescriptor const& descriptor)+{+ CanonicalSessionHistoryEntry::DocumentStates document_states;+ return document_state_from_descriptor(descriptor, document_states, CanonicalSessionHistoryEntry::UpdateDocumentState::Yes);+}+static void set_entry_fields_from_descriptor(CanonicalSessionHistoryEntry& entry, Web::HTML::SessionHistoryEntryDescriptor const& descriptor){entry.step = descriptor.step;diff --git a/Libraries/LibWebView/CanonicalSessionHistoryEntry.h b/Libraries/LibWebView/CanonicalSessionHistoryEntry.hindex c4bbda48966..066a48b0b12 100644--- a/Libraries/LibWebView/CanonicalSessionHistoryEntry.h+++ b/Libraries/LibWebView/CanonicalSessionHistoryEntry.h@@ -42,6 +42,7 @@ class WEBVIEW_API CanonicalDocumentState final : public RefCounted<CanonicalDocupublic:static NonnullRefPtr<CanonicalDocumentState> create(Web::HTML::CrossProcessId);static NonnullRefPtr<CanonicalDocumentState> create(Web::HTML::CrossProcessId, NonnullRefPtr<CanonicalDocument>);+ static NonnullRefPtr<CanonicalDocumentState> create_from_descriptor(Web::HTML::SessionHistoryDocumentStateDescriptor const&);~CanonicalDocumentState();diff --git a/Libraries/LibWebView/CanonicalTraversable.cpp b/Libraries/LibWebView/CanonicalTraversable.cppindex e1e239f0f23..28b5ffb7ea5 100644--- a/Libraries/LibWebView/CanonicalTraversable.cpp+++ b/Libraries/LibWebView/CanonicalTraversable.cpp@@ -1548,7 +1548,7 @@ void CanonicalTraversable::apply_changing_navigable_history_step_continuation(ApVERIFY(changing_navigable.continuation.has_value());// 10. If changingNavigableContinuation's update-only is true, or targetEntry's document is displayedDocument:- if (changing_navigable.update_only || changing_navigable.target_document_id == changing_navigable.displayed_document->id()) {+ if (changing_navigable.update_only || changing_navigable.target_document(*changing_job_endpoint(changing_navigable)) == changing_navigable.displayed_document) {// 1. Set navigable's ongoing navigation to null.// NB: The canonical traversal claim is released when the continuation is applied. The queued task mirrors// the null transition into the process-local projection.@@ -1581,7 +1581,9 @@ void CanonicalTraversable::send_changing_navigable_continuation_task(HistoryOperoperation.operation_id, changing_navigable.id, changing_navigable.target_entry->identity(),continuation.history_object_length_and_index.script_history_length,continuation.history_object_length_and_index.script_history_index,- move(continuation.entries_for_navigation_api));+ move(continuation.entries_for_navigation_api),+ changing_navigable.clears_classic_history_api_state,+ changing_navigable.clears_navigable_target_name);}// https://html.spec.whatwg.org/multipage/document-lifecycle.html#unload-a-document-and-its-descendants@@ -1614,7 +1616,9 @@ void CanonicalTraversable::send_displayed_document_unload_task(HistoryOperation&operation.operation_id, changing_navigable.id, changing_navigable.target_entry->identity(),continuation.history_object_length_and_index.script_history_length,continuation.history_object_length_and_index.script_history_index,- move(continuation.entries_for_navigation_api));+ move(continuation.entries_for_navigation_api),+ changing_navigable.clears_classic_history_api_state,+ changing_navigable.clears_navigable_target_name);}// https://html.spec.whatwg.org/multipage/browsing-the-web.html#deactivate-a-document-for-a-cross-document-navigation@@ -1661,11 +1665,21 @@ void CanonicalTraversable::deactivate_a_document_for_cross_document_navigation(H// The process running a changing navigable's job activated targetEntry's document and applied the continuation's// remaining steps.-void CanonicalTraversable::did_activate_history_entry(HistoryOperation& operation, ChangingNavigable& changing_navigable, NonnullRefPtr<WebContentPage> source_page, Web::HTML::HostedNavigableState activated_navigable_state)+void CanonicalTraversable::did_activate_history_entry(HistoryOperation& operation, ChangingNavigable& changing_navigable, NonnullRefPtr<WebContentPage> source_page, Web::HTML::HostedNavigableState activated_navigable_state, Optional<Web::HTML::PendingSessionHistoryEntryDescriptor> populated_history_entry){auto& navigable = changing_navigable.navigable();auto& target_entry = *changing_navigable.target_entry;+ // AD-HOC: For a reload, targetEntry is the active entry, which navigable's active document and its URL are derived+ // from. So what populating targetEntry's document changed in it, and steps 2 and 3 of afterDocumentPopulated,+ // are applied once the document is activated. See https://github.com/whatwg/html/issues/9869.+ if (populated_history_entry.has_value())+ navigable.apply_populated_history_entry(target_entry, *populated_history_entry);+ if (changing_navigable.clears_classic_history_api_state)+ target_entry.classic_history_api_state = Web::HTML::storage_serialization_record_for_null();+ if (changing_navigable.clears_navigable_target_name)+ target_entry.document_state->navigable_target_name = {};+Optional<Utf16String const&> navigation_id;if (auto navigation = finalized_navigation(operation))navigation_id = navigation->navigation_id;@@ -1831,7 +1845,7 @@ bool CanonicalTraversable::is_handing_navigable_to_another_page(CanonicalNavigab&& changing_navigable->continuation.has_value()// NB: Step 14.11 of apply the history step applies the continuation, which deactivates displayedDocument.&& !changing_navigable->update_only- && changing_navigable->target_document_id != changing_navigable->displayed_document->id()+ && changing_navigable->target_document(*changing_job_endpoint(*changing_navigable)) != changing_navigable->displayed_document&& changing_job_endpoint(*changing_navigable) != navigable.active_document().host()) {return true;}@@ -2867,7 +2881,42 @@ void CanonicalTraversable::did_receive_beforeunload_check_result(WebContentPage&dispatch_next_beforeunload_group(check_id);}-void CanonicalTraversable::did_receive_changing_navigable_history_job_ready(WebContentPage& source_page, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition disposition, bool update_only, Optional<Web::HTML::CrossProcessId> target_document_id)+// https://html.spec.whatwg.org/multipage/browsing-the-web.html#apply-the-history-step+// 12.8. In both cases, let afterDocumentPopulated be the following steps:+// NB: The process running the job reports whether changingNavigableContinuation is update-only: Step 4 of the job made+// it so, or populating targetEntry's document created none.+void CanonicalTraversable::run_after_document_populated(ChangingNavigable& changing_navigable, bool update_only)+{+ // 1. If targetEntry's document is null, then set changingNavigableContinuation's update-only to true.+ changing_navigable.update_only = update_only;+ if (update_only || !changing_navigable.populated_document)+ return;++ auto const& target_document = *changing_navigable.populated_document;+ auto const& old_origin = changing_navigable.target_entry->document_state->origin;++ // 2. If targetEntry's document's origin is not same origin with oldOrigin, then set targetEntry's classic history+ // API state to StructuredSerializeForStorage(null).+ if (target_document.origin() != old_origin)+ changing_navigable.clears_classic_history_api_state = true;++ // 3. If all of the following are true:+ // - navigable's parent is null;+ // - targetEntry's document's browsing context is not an auxiliary browsing context whose opener browsing+ // context is non-null; and+ // - targetEntry's document's origin is not same origin with oldOrigin,+ // then set targetEntry's document state's navigable target name to the empty string.+ if (!changing_navigable.navigable().parent()+ && !(target_document.browsing_context().is_auxiliary() && target_document.browsing_context().opener_browsing_context())+ && target_document.origin() != old_origin) {+ changing_navigable.clears_navigable_target_name = true;+ }++ // 4. Enqueue changingNavigableContinuation on changingNavigableContinuations.+ // NB: The caller enqueues it.+}++void CanonicalTraversable::did_receive_changing_navigable_history_job_ready(WebContentPage& source_page, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition disposition, bool update_only){if (!source_page.take_owed_reply({ OwedReply::Kind::ChangingJob, operation_id, navigable_id }))return;@@ -2876,10 +2925,8 @@ void CanonicalTraversable::did_receive_changing_navigable_history_job_ready(WebCif (!changing_navigable)return;- if (disposition == Web::HTML::ChangingNavigableHistoryStepJobDisposition::Ready) {- changing_navigable->update_only = update_only;- changing_navigable->target_document_id = target_document_id;- }+ if (disposition == Web::HTML::ChangingNavigableHistoryStepJobDisposition::Ready)+ run_after_document_populated(*changing_navigable, update_only);operation->algorithm->changing_navigable_job_completed(*changing_navigable, disposition);}@@ -2891,10 +2938,13 @@ void CanonicalTraversable::did_receive_changing_navigable_continuation_applied(Wif (auto* changing_navigable = operation ? operation->pending_changing_job(navigable_id) : nullptr) {auto& navigable = changing_navigable->navigable();auto document = move(changing_navigable->populated_document);+ Optional<Web::HTML::PendingSessionHistoryEntryDescriptor> populated_history_entry;+ if (auto population_loader = changing_navigable->population_loader())+ populated_history_entry = population_loader->request().history_entry;// The job ends first, so that activating its document does not end it as one for the document it replaces.operation->algorithm->end_changing_navigable_job(*changing_navigable);if (activated_navigable_state.has_value())- did_activate_history_entry(*operation, *changing_navigable, source_page, activated_navigable_state.release_value());+ did_activate_history_entry(*operation, *changing_navigable, source_page, activated_navigable_state.release_value(), move(populated_history_entry));else if (document)navigable.abandon_populated_document(changing_navigable->target_entry->document_state, *document);if (previous_entry_persisted_state.has_value())diff --git a/Libraries/LibWebView/CanonicalTraversable.h b/Libraries/LibWebView/CanonicalTraversable.hindex 78c13715980..0993eab3475 100644--- a/Libraries/LibWebView/CanonicalTraversable.h+++ b/Libraries/LibWebView/CanonicalTraversable.h@@ -87,7 +87,7 @@ public:// https://html.spec.whatwg.org/multipage/browsing-the-web.html#checking-if-unloading-is-canceledOptional<Web::HTML::CrossProcessId> check_if_unloading_is_canceled(Vector<Web::HTML::CrossProcessId> navigables_that_need_before_unload, RefPtr<CanonicalSessionHistoryEntry> target_entry, Optional<Web::HTML::UserNavigationInvolvement> user_involvement_for_navigate_event, RefPtr<WebContentPage> skipped_endpoint, Web::HTML::UnloadPromptShown, Function<void(Web::HTML::CheckIfUnloadingIsCanceledResult, Web::HTML::UnloadPromptShown)> on_complete);bool is_handing_navigable_to_another_page(CanonicalNavigable const&) const;- void did_receive_changing_navigable_history_job_ready(WebContentPage& source_page, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition, bool update_only, Optional<Web::HTML::CrossProcessId> target_document_id);+ void did_receive_changing_navigable_history_job_ready(WebContentPage& source_page, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition, bool update_only);void did_receive_changing_navigable_history_job_reached_population(WebContentPage& source_page, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::NavigationSourceSnapshot active_document_source_snapshot_params);void did_finish_history_navigation_params_creation(WebContentPage& source_page, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::NavigationPopulationResult);void did_receive_descendant_unload_task_complete(WebContentPage& source_page, Web::HTML::CrossProcessId unload_id, Web::HTML::CrossProcessId navigable_id);@@ -210,7 +210,8 @@ private:void send_changing_navigable_continuation_task(HistoryOperation&, ChangingNavigable&);void send_displayed_document_unload_task(HistoryOperation&, ChangingNavigable&);void deactivate_a_document_for_cross_document_navigation(HistoryOperation&, ChangingNavigable&);- void did_activate_history_entry(HistoryOperation&, ChangingNavigable&, NonnullRefPtr<WebContentPage> source_page, Web::HTML::HostedNavigableState activated_navigable_state);+ void run_after_document_populated(ChangingNavigable&, bool update_only);+ void did_activate_history_entry(HistoryOperation&, ChangingNavigable&, NonnullRefPtr<WebContentPage> source_page, Web::HTML::HostedNavigableState activated_navigable_state, Optional<Web::HTML::PendingSessionHistoryEntryDescriptor> populated_history_entry);void unload_a_document_and_its_descendants(CanonicalNavigable&, RefPtr<WebContentPage> continuing_endpoint, Web::HTML::ChildNavigableDestruction, Function<void()> queue_document_unload_task);void unload_the_documents_of_child_navigables(CanonicalNavigable const&, Function<void()> after_child_navigable_unloads);void run_document_unload_task(RefPtr<WebContentPage>, Web::HTML::CrossProcessId navigable_id, Web::HTML::ChildNavigableDestruction, Web::HTML::StopHostingAfterUnload, Function<void()> after_unload);diff --git a/Libraries/LibWebView/WebContentPage.cpp b/Libraries/LibWebView/WebContentPage.cppindex 0b05d9fc084..cde1ab2695a 100644--- a/Libraries/LibWebView/WebContentPage.cpp+++ b/Libraries/LibWebView/WebContentPage.cpp@@ -2198,9 +2198,9 @@ void WebContentPage::changing_navigable_history_job_reached_population(Web::HTMLtraversable().did_receive_changing_navigable_history_job_reached_population(*this, operation_id, navigable_id, move(active_document_source_snapshot_params));}-void WebContentPage::changing_navigable_history_job_ready(Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition disposition, bool update_only, Optional<Web::HTML::CrossProcessId> target_document_id)+void WebContentPage::changing_navigable_history_job_ready(Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition disposition, bool update_only){- traversable().did_receive_changing_navigable_history_job_ready(*this, operation_id, navigable_id, disposition, update_only, target_document_id);+ traversable().did_receive_changing_navigable_history_job_ready(*this, operation_id, navigable_id, disposition, update_only);}void WebContentPage::descendant_unload_task_complete(Web::HTML::CrossProcessId unload_id, Web::HTML::CrossProcessId navigable_id)diff --git a/Libraries/LibWebView/WebContentPage.h b/Libraries/LibWebView/WebContentPage.hindex fa4658d612e..859be6dfa1e 100644--- a/Libraries/LibWebView/WebContentPage.h+++ b/Libraries/LibWebView/WebContentPage.h@@ -310,7 +310,7 @@ private:virtual void revoke_history_operation(Web::HTML::CrossProcessId operation_id) override;virtual void beforeunload_check_result(Web::HTML::CrossProcessId operation_id, Web::HTML::CheckIfUnloadingIsCanceledResult result, Web::HTML::UnloadPromptShown unload_prompt_shown) override;virtual void changing_navigable_history_job_reached_population(Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::NavigationSourceSnapshot active_document_source_snapshot_params) override;- virtual void changing_navigable_history_job_ready(Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition disposition, bool update_only, Optional<Web::HTML::CrossProcessId> target_document_id) override;+ virtual void changing_navigable_history_job_ready(Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition disposition, bool update_only) override;virtual void descendant_unload_task_complete(Web::HTML::CrossProcessId unload_id, Web::HTML::CrossProcessId navigable_id) override;virtual void request_navigable_document_abort(Web::HTML::CrossProcessId navigable_id) override;virtual void request_navigable_document_unfullscreen(Web::HTML::CrossProcessId navigable_id) override;diff --git a/Services/WebContent/ConnectionFromClient.cpp b/Services/WebContent/ConnectionFromClient.cppindex fd30f2a37e9..c6975e56218 100644--- a/Services/WebContent/ConnectionFromClient.cpp+++ b/Services/WebContent/ConnectionFromClient.cpp@@ -643,7 +643,7 @@ void ConnectionFromClient::continue_history_navigation_population(Web::PageId paauto page = this->page(page_id);auto navigable_id = population.request.navigable_id;if (!page.has_value()) {- async_changing_navigable_history_job_ready(page_id, operation_id, navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition::Skipped, false, {});+ async_changing_navigable_history_job_ready(page_id, operation_id, navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition::Skipped, false);return;}auto& history_executor = page->page().history_executor();@@ -651,8 +651,8 @@ void ConnectionFromClient::continue_history_navigation_population(Web::PageId pareturn;auto user_involvement = population.request.user_involvement;history_executor.run_ui_changing_navigable_history_job(operation_id, navigable_id, move(target_entry), user_involvement, navigation_type, {}, ongoing_navigation_is_traversal, false,- GC::create_function(Web::HTML::main_thread_event_loop().heap(), [this, page_id, operation_id, navigable_id](Web::HTML::ChangingNavigableHistoryStepJobDisposition disposition, bool update_only, Optional<Web::HTML::CrossProcessId> target_document_id) {- async_changing_navigable_history_job_ready(page_id, operation_id, navigable_id, disposition, update_only, target_document_id);+ GC::create_function(Web::HTML::main_thread_event_loop().heap(), [this, page_id, operation_id, navigable_id](Web::HTML::ChangingNavigableHistoryStepJobDisposition disposition, bool update_only) {+ async_changing_navigable_history_job_ready(page_id, operation_id, navigable_id, disposition, update_only);}),move(population));}@@ -661,12 +661,12 @@ void ConnectionFromClient::run_changing_navigable_history_job(Web::PageId page_i{auto page = this->page(page_id);if (!page.has_value()) {- async_changing_navigable_history_job_ready(page_id, operation_id, navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition::Skipped, false, {});+ async_changing_navigable_history_job_ready(page_id, operation_id, navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition::Skipped, false);return;}- page->page().history_executor().run_ui_changing_navigable_history_job(operation_id, navigable_id, move(target_entry), user_involvement, navigation_type, move(finalized_navigation_id), ongoing_navigation_is_traversal, needs_population, GC::create_function(Web::HTML::main_thread_event_loop().heap(), [this, page_id, operation_id, navigable_id](Web::HTML::ChangingNavigableHistoryStepJobDisposition disposition, bool update_only, Optional<Web::HTML::CrossProcessId> target_document_id) {- async_changing_navigable_history_job_ready(page_id, operation_id, navigable_id, disposition, update_only, target_document_id);+ page->page().history_executor().run_ui_changing_navigable_history_job(operation_id, navigable_id, move(target_entry), user_involvement, navigation_type, move(finalized_navigation_id), ongoing_navigation_is_traversal, needs_population, GC::create_function(Web::HTML::main_thread_event_loop().heap(), [this, page_id, operation_id, navigable_id](Web::HTML::ChangingNavigableHistoryStepJobDisposition disposition, bool update_only) {+ async_changing_navigable_history_job_ready(page_id, operation_id, navigable_id, disposition, update_only);}));}@@ -675,7 +675,7 @@ void ConnectionFromClient::create_history_navigation_params(Web::PageId page_id,auto navigable_id = request.navigable_id;if (auto page = this->page(page_id); page.has_value() && page->page().history_executor().create_ui_history_navigation_params(operation_id, move(request), allow_POST))return;- async_changing_navigable_history_job_ready(page_id, operation_id, navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition::Skipped, false, {});+ async_changing_navigable_history_job_ready(page_id, operation_id, navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition::Skipped, false);}void ConnectionFromClient::clear_ongoing_history_traversal(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id)@@ -684,7 +684,7 @@ void ConnectionFromClient::clear_ongoing_history_traversal(Web::PageId page_id,page->page().history_executor().clear_ui_changing_navigable_ongoing_traversal(operation_id, navigable_id);}-void ConnectionFromClient::apply_changing_navigable_continuation(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::SessionHistoryEntryIdentity target_entry, u64 script_history_length, u64 script_history_index, Vector<Web::HTML::SessionHistoryEntryDescriptor> entries_for_navigation_api)+void ConnectionFromClient::apply_changing_navigable_continuation(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::SessionHistoryEntryIdentity target_entry, u64 script_history_length, u64 script_history_index, Vector<Web::HTML::SessionHistoryEntryDescriptor> entries_for_navigation_api, bool clear_classic_history_api_state, bool clear_navigable_target_name){auto page = this->page(page_id);if (!page.has_value()) {@@ -692,12 +692,12 @@ void ConnectionFromClient::apply_changing_navigable_continuation(Web::PageId pagreturn;}- page->page().history_executor().apply_ui_changing_navigable_continuation(operation_id, navigable_id, target_entry, { script_history_length, script_history_index }, move(entries_for_navigation_api), GC::create_function(Web::HTML::main_thread_event_loop().heap(), [this, page_id, operation_id, navigable_id](Optional<Web::HTML::HostedNavigableState> activated_navigable_state, Optional<Web::HTML::SessionHistoryEntryPersistedState> previous_entry_persisted_state) {+ page->page().history_executor().apply_ui_changing_navigable_continuation(operation_id, navigable_id, target_entry, { script_history_length, script_history_index }, move(entries_for_navigation_api), clear_classic_history_api_state, clear_navigable_target_name, GC::create_function(Web::HTML::main_thread_event_loop().heap(), [this, page_id, operation_id, navigable_id](Optional<Web::HTML::HostedNavigableState> activated_navigable_state, Optional<Web::HTML::SessionHistoryEntryPersistedState> previous_entry_persisted_state) {async_changing_navigable_continuation_applied(page_id, operation_id, navigable_id, move(activated_navigable_state), move(previous_entry_persisted_state));}));}-void ConnectionFromClient::unload_displayed_document_and_apply_changing_navigable_continuation(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::SessionHistoryEntryIdentity target_entry, u64 script_history_length, u64 script_history_index, Vector<Web::HTML::SessionHistoryEntryDescriptor> entries_for_navigation_api)+void ConnectionFromClient::unload_displayed_document_and_apply_changing_navigable_continuation(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::SessionHistoryEntryIdentity target_entry, u64 script_history_length, u64 script_history_index, Vector<Web::HTML::SessionHistoryEntryDescriptor> entries_for_navigation_api, bool clear_classic_history_api_state, bool clear_navigable_target_name){auto page = this->page(page_id);if (!page.has_value()) {@@ -705,7 +705,7 @@ void ConnectionFromClient::unload_displayed_document_and_apply_changing_navigablreturn;}- page->page().history_executor().unload_displayed_document_and_apply_ui_changing_navigable_continuation(operation_id, navigable_id, target_entry, { script_history_length, script_history_index }, move(entries_for_navigation_api), GC::create_function(Web::HTML::main_thread_event_loop().heap(), [this, page_id, operation_id, navigable_id](Optional<Web::HTML::HostedNavigableState> activated_navigable_state, Optional<Web::HTML::SessionHistoryEntryPersistedState> previous_entry_persisted_state) {+ page->page().history_executor().unload_displayed_document_and_apply_ui_changing_navigable_continuation(operation_id, navigable_id, target_entry, { script_history_length, script_history_index }, move(entries_for_navigation_api), clear_classic_history_api_state, clear_navigable_target_name, GC::create_function(Web::HTML::main_thread_event_loop().heap(), [this, page_id, operation_id, navigable_id](Optional<Web::HTML::HostedNavigableState> activated_navigable_state, Optional<Web::HTML::SessionHistoryEntryPersistedState> previous_entry_persisted_state) {async_changing_navigable_continuation_applied(page_id, operation_id, navigable_id, move(activated_navigable_state), move(previous_entry_persisted_state));}));}diff --git a/Services/WebContent/ConnectionFromClient.h b/Services/WebContent/ConnectionFromClient.hindex 5df6c498f76..78283f056af 100644--- a/Services/WebContent/ConnectionFromClient.h+++ b/Services/WebContent/ConnectionFromClient.h@@ -148,8 +148,8 @@ private:virtual void run_changing_navigable_history_job(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::SessionHistoryEntryDescriptor target_entry, Web::HTML::UserNavigationInvolvement user_involvement, Optional<Web::Bindings::NavigationType> navigation_type, Optional<Utf16String> finalized_navigation_id, bool ongoing_navigation_is_traversal, bool needs_population) override;virtual void create_history_navigation_params(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::NavigationPopulationRequest request, bool allow_POST) override;virtual void clear_ongoing_history_traversal(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id) override;- virtual void apply_changing_navigable_continuation(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::SessionHistoryEntryIdentity target_entry, u64 script_history_length, u64 script_history_index, Vector<Web::HTML::SessionHistoryEntryDescriptor> entries_for_navigation_api) override;- virtual void unload_displayed_document_and_apply_changing_navigable_continuation(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::SessionHistoryEntryIdentity target_entry, u64 script_history_length, u64 script_history_index, Vector<Web::HTML::SessionHistoryEntryDescriptor> entries_for_navigation_api) override;+ virtual void apply_changing_navigable_continuation(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::SessionHistoryEntryIdentity target_entry, u64 script_history_length, u64 script_history_index, Vector<Web::HTML::SessionHistoryEntryDescriptor> entries_for_navigation_api, bool clear_classic_history_api_state, bool clear_navigable_target_name) override;+ virtual void unload_displayed_document_and_apply_changing_navigable_continuation(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::SessionHistoryEntryIdentity target_entry, u64 script_history_length, u64 script_history_index, Vector<Web::HTML::SessionHistoryEntryDescriptor> entries_for_navigation_api, bool clear_classic_history_api_state, bool clear_navigable_target_name) override;virtual void run_descendant_unload_task(Web::PageId page_id, Web::HTML::CrossProcessId unload_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::ChildNavigableDestruction, Web::HTML::StopHostingAfterUnload) override;virtual void continue_child_navigable_destruction(Web::PageId page_id, Web::HTML::CrossProcessId navigable_id) override;virtual void abort_navigable_document(Web::PageId page_id, Web::HTML::CrossProcessId navigable_id) override;diff --git a/Services/WebContent/WebContentClient.ipc b/Services/WebContent/WebContentClient.ipcindex eb1826952a1..5c629faa330 100644--- a/Services/WebContent/WebContentClient.ipc+++ b/Services/WebContent/WebContentClient.ipc@@ -280,7 +280,7 @@ endpoint WebContentClient routed by Web::PageId page_idrevoke_history_operation(Web::PageId page_id, Web::HTML::CrossProcessId operation_id) =|beforeunload_check_result(Web::PageId page_id, Web::HTML::CrossProcessId check_id, Web::HTML::CheckIfUnloadingIsCanceledResult result, Web::HTML::UnloadPromptShown unload_prompt_shown) =|changing_navigable_history_job_reached_population(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::NavigationSourceSnapshot active_document_source_snapshot_params) =|- changing_navigable_history_job_ready(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition disposition, bool update_only, Optional<Web::HTML::CrossProcessId> target_document_id) =|+ changing_navigable_history_job_ready(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::ChangingNavigableHistoryStepJobDisposition disposition, bool update_only) =|descendant_unload_task_complete(Web::PageId page_id, Web::HTML::CrossProcessId unload_id, Web::HTML::CrossProcessId navigable_id) =|request_child_navigable_unload(Web::PageId page_id, Web::HTML::CrossProcessId navigable_id) =|request_unload_check(Web::PageId page_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::CrossProcessId check_id) =|diff --git a/Services/WebContent/WebContentServer.ipc b/Services/WebContent/WebContentServer.ipcindex a9f43f71dde..2f6f93fff12 100644--- a/Services/WebContent/WebContentServer.ipc+++ b/Services/WebContent/WebContentServer.ipc@@ -129,8 +129,8 @@ endpoint WebContentServer routed by Web::PageId page_idrun_changing_navigable_history_job(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::SessionHistoryEntryDescriptor target_entry, Web::HTML::UserNavigationInvolvement user_involvement, Optional<Web::Bindings::NavigationType> navigation_type, Optional<Utf16String> finalized_navigation_id, bool ongoing_navigation_is_traversal, bool needs_population) =|create_history_navigation_params(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::NavigationPopulationRequest request, bool allow_POST) =|clear_ongoing_history_traversal(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id) =|- apply_changing_navigable_continuation(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::SessionHistoryEntryIdentity target_entry, u64 script_history_length, u64 script_history_index, Vector<Web::HTML::SessionHistoryEntryDescriptor> entries_for_navigation_api) =|- unload_displayed_document_and_apply_changing_navigable_continuation(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::SessionHistoryEntryIdentity target_entry, u64 script_history_length, u64 script_history_index, Vector<Web::HTML::SessionHistoryEntryDescriptor> entries_for_navigation_api) =|+ apply_changing_navigable_continuation(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::SessionHistoryEntryIdentity target_entry, u64 script_history_length, u64 script_history_index, Vector<Web::HTML::SessionHistoryEntryDescriptor> entries_for_navigation_api, bool clear_classic_history_api_state, bool clear_navigable_target_name) =|+ unload_displayed_document_and_apply_changing_navigable_continuation(Web::PageId page_id, Web::HTML::CrossProcessId operation_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::SessionHistoryEntryIdentity target_entry, u64 script_history_length, u64 script_history_index, Vector<Web::HTML::SessionHistoryEntryDescriptor> entries_for_navigation_api, bool clear_classic_history_api_state, bool clear_navigable_target_name) =|run_descendant_unload_task(Web::PageId page_id, Web::HTML::CrossProcessId unload_id, Web::HTML::CrossProcessId navigable_id, Web::HTML::ChildNavigableDestruction child_navigable_destruction, Web::HTML::StopHostingAfterUnload stop_hosting_after_unload) =|continue_child_navigable_destruction(Web::PageId page_id, Web::HTML::CrossProcessId navigable_id) =|abort_navigable_document(Web::PageId page_id, Web::HTML::CrossProcessId navigable_id) =|