summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/HTML
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-05-30 12:36:53 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-30 12:39:53 +0200
commit4190fd219930a6c8b631c396ccafe5190f821414 (patch)
tree2cb430b87b468023a3c2601618187554f00797c9 /Userland/Libraries/LibWeb/HTML
parent8be98af77cae3191cf97a4686824c98d89f87ef7 (diff)
downloadserenity-4190fd219930a6c8b631c396ccafe5190f821414.zip
LibWeb: Rename Web::Frame to Web::BrowsingContext
Our "frame" concept very closely matches what the web specs call a "browsing context", so let's rename it to that. :^) The "main frame" becomes the "top-level browsing context", and "sub-frames" are now "nested browsing contexts".
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML')
-rw-r--r--Userland/Libraries/LibWeb/HTML/FrameHostElement.cpp18
-rw-r--r--Userland/Libraries/LibWeb/HTML/FrameHostElement.h8
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp6
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp2
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp2
6 files changed, 19 insertions, 19 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/FrameHostElement.cpp b/Userland/Libraries/LibWeb/HTML/FrameHostElement.cpp
index 30b338a8d3..66a4467205 100644
--- a/Userland/Libraries/LibWeb/HTML/FrameHostElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/FrameHostElement.cpp
@@ -8,7 +8,7 @@
#include <LibWeb/DOM/Event.h>
#include <LibWeb/HTML/FrameHostElement.h>
#include <LibWeb/Origin.h>
-#include <LibWeb/Page/Frame.h>
+#include <LibWeb/Page/BrowsingContext.h>
namespace Web::HTML {
@@ -26,18 +26,18 @@ void FrameHostElement::inserted()
HTMLElement::inserted();
if (!is_connected())
return;
- if (auto* frame = document().frame()) {
- m_content_frame = Frame::create_subframe(*this, frame->main_frame());
- m_content_frame->set_frame_nesting_levels(frame->frame_nesting_levels());
- m_content_frame->register_frame_nesting(document().url());
+ if (auto* frame = document().browsing_context()) {
+ m_nested_browsing_context = BrowsingContext::create_nested(*this, frame->top_level_browsing_context());
+ m_nested_browsing_context->set_frame_nesting_levels(frame->frame_nesting_levels());
+ m_nested_browsing_context->register_frame_nesting(document().url());
}
}
Origin FrameHostElement::content_origin() const
{
- if (!m_content_frame || !m_content_frame->document())
+ if (!m_nested_browsing_context || !m_nested_browsing_context->document())
return {};
- return m_content_frame->document()->origin();
+ return m_nested_browsing_context->document()->origin();
}
bool FrameHostElement::may_access_from_origin(const Origin& origin) const
@@ -47,10 +47,10 @@ bool FrameHostElement::may_access_from_origin(const Origin& origin) const
const DOM::Document* FrameHostElement::content_document() const
{
- return m_content_frame ? m_content_frame->document() : nullptr;
+ return m_nested_browsing_context ? m_nested_browsing_context->document() : nullptr;
}
-void FrameHostElement::content_frame_did_load(Badge<FrameLoader>)
+void FrameHostElement::nested_browsing_context_did_load(Badge<FrameLoader>)
{
dispatch_event(DOM::Event::create(EventNames::load));
}
diff --git a/Userland/Libraries/LibWeb/HTML/FrameHostElement.h b/Userland/Libraries/LibWeb/HTML/FrameHostElement.h
index 54891becd4..6bb7afaefe 100644
--- a/Userland/Libraries/LibWeb/HTML/FrameHostElement.h
+++ b/Userland/Libraries/LibWeb/HTML/FrameHostElement.h
@@ -15,20 +15,20 @@ public:
FrameHostElement(DOM::Document&, QualifiedName);
virtual ~FrameHostElement() override;
- Frame* content_frame() { return m_content_frame; }
- const Frame* content_frame() const { return m_content_frame; }
+ BrowsingContext* nested_browsing_context() { return m_nested_browsing_context; }
+ const BrowsingContext* nested_browsing_context() const { return m_nested_browsing_context; }
const DOM::Document* content_document() const;
Origin content_origin() const;
bool may_access_from_origin(const Origin&) const;
- void content_frame_did_load(Badge<FrameLoader>);
+ void nested_browsing_context_did_load(Badge<FrameLoader>);
virtual void inserted() override;
protected:
- RefPtr<Frame> m_content_frame;
+ RefPtr<BrowsingContext> m_nested_browsing_context;
};
}
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
index cfba5f8d4f..53c5c45137 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.cpp
@@ -10,7 +10,7 @@
#include <LibWeb/HTML/HTMLInputElement.h>
#include <LibWeb/HTML/SubmitEvent.h>
#include <LibWeb/InProcessWebView.h>
-#include <LibWeb/Page/Frame.h>
+#include <LibWeb/Page/BrowsingContext.h>
#include <LibWeb/URLEncoder.h>
namespace Web::HTML {
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp
index 736a446457..ba01d28f43 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp
@@ -8,7 +8,7 @@
#include <LibWeb/HTML/HTMLIFrameElement.h>
#include <LibWeb/Layout/FrameBox.h>
#include <LibWeb/Origin.h>
-#include <LibWeb/Page/Frame.h>
+#include <LibWeb/Page/BrowsingContext.h>
namespace Web::HTML {
@@ -43,7 +43,7 @@ void HTMLIFrameElement::inserted()
void HTMLIFrameElement::load_src(const String& value)
{
- if (!m_content_frame)
+ if (!m_nested_browsing_context)
return;
if (value.is_null())
@@ -60,7 +60,7 @@ void HTMLIFrameElement::load_src(const String& value)
}
dbgln("Loading iframe document from {}", value);
- m_content_frame->loader().load(url, FrameLoader::Type::IFrame);
+ m_nested_browsing_context->loader().load(url, FrameLoader::Type::IFrame);
}
}
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
index 27fcc3e7bd..480f90f3a0 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
@@ -17,7 +17,7 @@
#include <LibWeb/Layout/ButtonBox.h>
#include <LibWeb/Layout/CheckBox.h>
#include <LibWeb/Layout/RadioButton.h>
-#include <LibWeb/Page/Frame.h>
+#include <LibWeb/Page/BrowsingContext.h>
namespace Web::HTML {
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp
index c2efc192db..b87e715b27 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLTitleElement.cpp
@@ -23,7 +23,7 @@ void HTMLTitleElement::children_changed()
{
HTMLElement::children_changed();
if (auto* page = document().page()) {
- if (document().frame() == &page->main_frame())
+ if (document().browsing_context() == &page->top_level_browsing_context())
page->client().page_did_change_title(document().title());
}
}