diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp index 9123744716..05b43a1a6f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp @@ -61,11 +61,11 @@ void HTMLIFrameElement::inserted() // When an iframe element element is inserted into a document whose browsing context is non-null, the user agent must run these steps: if (in_a_document_tree() && document().browsing_context()) { // 1. Create a new child navigable for element. - MUST(create_new_child_navigable([this] { + MUST(create_new_child_navigable(JS::create_heap_function(realm().heap(), [this] { // 3. Process the iframe attributes for element, with initialInsertion set to true. process_the_iframe_attributes(true); set_content_navigable_initialized(); - })); + }))); // FIXME: 2. If element has a sandbox attribute, then parse the sandboxing directive given the attribute's value and element's iframe sandboxing flag set. } diff --git a/Userland/Libraries/LibWeb/HTML/NavigableContainer.cpp b/Userland/Libraries/LibWeb/HTML/NavigableContainer.cpp index a6cb701efa..efe4b3bcf9 100644 --- a/Userland/Libraries/LibWeb/HTML/NavigableContainer.cpp +++ b/Userland/Libraries/LibWeb/HTML/NavigableContainer.cpp @@ -59,7 +59,7 @@ JS::GCPtr NavigableContainer::navigable_container_with_conte } // https://html.spec.whatwg.org/multipage/document-sequences.html#create-a-new-child-navigable -WebIDL::ExceptionOr NavigableContainer::create_new_child_navigable(JS::SafeFunction afterSessionHistoryUpdate) +WebIDL::ExceptionOr NavigableContainer::create_new_child_navigable(JS::Handle> after_session_history_update) { // 1. Let parentNavigable be element's node navigable. auto parent_navigable = navigable(); @@ -110,7 +110,7 @@ WebIDL::ExceptionOr NavigableContainer::create_new_child_navigable(JS::Saf auto traversable = parent_navigable->traversable_navigable(); // 12. Append the following session history traversal steps to traversable: - traversable->append_session_history_traversal_steps([traversable, navigable, parent_navigable, history_entry, afterSessionHistoryUpdate = move(afterSessionHistoryUpdate)] { + traversable->append_session_history_traversal_steps([traversable, navigable, parent_navigable, history_entry, after_session_history_update = move(after_session_history_update)] { // 1. Let parentDocState be parentNavigable's active session history entry's document state. auto parent_doc_state = parent_navigable->active_session_history_entry()->document_state(); @@ -137,8 +137,8 @@ WebIDL::ExceptionOr NavigableContainer::create_new_child_navigable(JS::Saf // 7. Update for navigable creation/destruction given traversable traversable->update_for_navigable_creation_or_destruction(); - if (afterSessionHistoryUpdate) { - afterSessionHistoryUpdate(); + if (after_session_history_update) { + after_session_history_update->function()(); } }); diff --git a/Userland/Libraries/LibWeb/HTML/NavigableContainer.h b/Userland/Libraries/LibWeb/HTML/NavigableContainer.h index 0fa07ff385..e0cbbeb2b9 100644 --- a/Userland/Libraries/LibWeb/HTML/NavigableContainer.h +++ b/Userland/Libraries/LibWeb/HTML/NavigableContainer.h @@ -64,7 +64,7 @@ protected: // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#navigate-an-iframe-or-frame void navigate_an_iframe_or_frame(URL::URL url, ReferrerPolicy::ReferrerPolicy referrer_policy, Optional srcdoc_string = {}); - WebIDL::ExceptionOr create_new_child_navigable(JS::SafeFunction afterSessionHistoryUpdate = {}); + WebIDL::ExceptionOr create_new_child_navigable(JS::Handle> after_session_history_update = {}); // https://html.spec.whatwg.org/multipage/document-sequences.html#content-navigable JS::GCPtr m_content_navigable { nullptr };