1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:58:12 +00:00

LibWeb: Update HTMLIFrameElement to use navigables

This commit is contained in:
Aliaksandr Kalenik 2023-04-13 18:50:09 +03:00 committed by Andreas Kling
parent 623d1a78da
commit 912cf89727
3 changed files with 99 additions and 131 deletions

View file

@ -7,6 +7,7 @@
#pragma once
#include <LibWeb/HTML/HTMLElement.h>
#include <LibWeb/HTML/Navigable.h>
namespace Web::HTML {
@ -23,8 +24,18 @@ public:
JS::GCPtr<Navigable> content_navigable() { return m_content_navigable; }
JS::GCPtr<Navigable const> content_navigable() const { return m_content_navigable.ptr(); }
BrowsingContext* nested_browsing_context() { return m_nested_browsing_context; }
BrowsingContext const* nested_browsing_context() const { return m_nested_browsing_context; }
BrowsingContext* nested_browsing_context()
{
if (m_content_navigable)
return m_content_navigable->active_browsing_context();
return nullptr;
}
BrowsingContext const* nested_browsing_context() const
{
if (m_content_navigable)
return m_content_navigable->active_browsing_context();
return nullptr;
}
const DOM::Document* content_document() const;
DOM::Document const* content_document_without_origin_check() const;
@ -41,17 +52,13 @@ protected:
virtual void visit_edges(Cell::Visitor&) override;
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#shared-attribute-processing-steps-for-iframe-and-frame-elements
void shared_attribute_processing_steps_for_iframe_and_frame(bool initial_insertion);
Optional<AK::URL> shared_attribute_processing_steps_for_iframe_and_frame(bool initial_insertion);
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#navigate-an-iframe-or-frame
void navigate_an_iframe_or_frame(JS::NonnullGCPtr<Fetch::Infrastructure::Request>);
void create_new_nested_browsing_context();
void navigate_an_iframe_or_frame(AK::URL url, ReferrerPolicy::ReferrerPolicy referrer_policy, Optional<String> srcdoc_string = {});
WebIDL::ExceptionOr<void> create_new_child_navigable();
JS::GCPtr<BrowsingContext> m_nested_browsing_context;
// https://html.spec.whatwg.org/multipage/document-sequences.html#content-navigable
JS::GCPtr<Navigable> m_content_navigable { nullptr };