summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-09-22 17:48:04 +0200
committerAndreas Kling <kling@serenityos.org>2020-09-22 20:10:20 +0200
commit86a4eaca389f6ab4f0250c666833cddf34ddcafa (patch)
treee1854ec0e40b472dcd4be915bf5d5424fa201f14
parent69bbf0285bf6e5ce85956aed3d86075a9ddf65b9 (diff)
downloadserenity-86a4eaca389f6ab4f0250c666833cddf34ddcafa.zip
LibWeb: Rename HTMLIFrameElement::hosted_frame() => content_frame()
This matches the standard API names contentWindow and contentDocument.
-rw-r--r--Libraries/LibWeb/HTML/HTMLIFrameElement.cpp8
-rw-r--r--Libraries/LibWeb/HTML/HTMLIFrameElement.h6
-rw-r--r--Libraries/LibWeb/Layout/LayoutFrame.cpp10
-rw-r--r--Libraries/LibWeb/Page/EventHandler.cpp6
4 files changed, 15 insertions, 15 deletions
diff --git a/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp b/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp
index e0e1f743c4..25b79c3c2a 100644
--- a/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp
+++ b/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp
@@ -57,8 +57,8 @@ RefPtr<LayoutNode> HTMLIFrameElement::create_layout_node(const CSS::StylePropert
void HTMLIFrameElement::document_did_attach_to_frame(Frame& frame)
{
- ASSERT(!m_hosted_frame);
- m_hosted_frame = Frame::create_subframe(*this, frame.main_frame());
+ ASSERT(!m_content_frame);
+ m_content_frame = Frame::create_subframe(*this, frame.main_frame());
auto src = attribute(HTML::AttributeNames::src);
if (src.is_null())
return;
@@ -78,12 +78,12 @@ void HTMLIFrameElement::load_src(const String& value)
return;
}
- m_hosted_frame->loader().load(url, FrameLoader::Type::IFrame);
+ m_content_frame->loader().load(url, FrameLoader::Type::IFrame);
}
const DOM::Document* HTMLIFrameElement::content_document() const
{
- return m_hosted_frame ? m_hosted_frame->document() : nullptr;
+ return m_content_frame ? m_content_frame->document() : nullptr;
}
}
diff --git a/Libraries/LibWeb/HTML/HTMLIFrameElement.h b/Libraries/LibWeb/HTML/HTMLIFrameElement.h
index caf639ae63..ed377d2abf 100644
--- a/Libraries/LibWeb/HTML/HTMLIFrameElement.h
+++ b/Libraries/LibWeb/HTML/HTMLIFrameElement.h
@@ -39,8 +39,8 @@ public:
virtual RefPtr<LayoutNode> create_layout_node(const CSS::StyleProperties* parent_style) override;
- Frame* hosted_frame() { return m_hosted_frame; }
- const Frame* hosted_frame() const { return m_hosted_frame; }
+ Frame* content_frame() { return m_content_frame; }
+ const Frame* content_frame() const { return m_content_frame; }
const DOM::Document* content_document() const;
@@ -50,7 +50,7 @@ private:
void load_src(const String&);
- RefPtr<Frame> m_hosted_frame;
+ RefPtr<Frame> m_content_frame;
};
}
diff --git a/Libraries/LibWeb/Layout/LayoutFrame.cpp b/Libraries/LibWeb/Layout/LayoutFrame.cpp
index e7a999f368..7108065460 100644
--- a/Libraries/LibWeb/Layout/LayoutFrame.cpp
+++ b/Libraries/LibWeb/Layout/LayoutFrame.cpp
@@ -50,7 +50,7 @@ LayoutFrame::~LayoutFrame()
void LayoutFrame::layout(LayoutMode layout_mode)
{
- ASSERT(node().hosted_frame());
+ ASSERT(node().content_frame());
set_has_intrinsic_width(true);
set_has_intrinsic_height(true);
@@ -79,14 +79,14 @@ void LayoutFrame::paint(PaintContext& context, PaintPhase phase)
context.painter().add_clip_rect(enclosing_int_rect(absolute_rect()));
context.painter().translate(absolute_x(), absolute_y());
- context.set_viewport_rect({ {}, node().hosted_frame()->size() });
+ context.set_viewport_rect({ {}, node().content_frame()->size() });
const_cast<LayoutDocument*>(hosted_layout_tree)->paint_all_phases(context);
context.set_viewport_rect(old_viewport_rect);
context.painter().restore();
#ifdef DEBUG_HIGHLIGHT_FOCUSED_FRAME
- if (node().hosted_frame()->is_focused_frame()) {
+ if (node().content_frame()->is_focused_frame()) {
context.painter().draw_rect(absolute_rect().to<int>(), Color::Cyan);
}
#endif
@@ -97,8 +97,8 @@ void LayoutFrame::did_set_rect()
{
LayoutReplaced::did_set_rect();
- ASSERT(node().hosted_frame());
- node().hosted_frame()->set_size(size().to_type<int>());
+ ASSERT(node().content_frame());
+ node().content_frame()->set_size(size().to_type<int>());
}
}
diff --git a/Libraries/LibWeb/Page/EventHandler.cpp b/Libraries/LibWeb/Page/EventHandler.cpp
index 3307290e5b..cc54cda41f 100644
--- a/Libraries/LibWeb/Page/EventHandler.cpp
+++ b/Libraries/LibWeb/Page/EventHandler.cpp
@@ -97,7 +97,7 @@ bool EventHandler::handle_mouseup(const Gfx::IntPoint& position, unsigned button
if (result.layout_node && result.layout_node->node()) {
RefPtr<DOM::Node> node = result.layout_node->node();
if (is<HTML::HTMLIFrameElement>(*node)) {
- if (auto* subframe = downcast<HTML::HTMLIFrameElement>(*node).hosted_frame())
+ if (auto* subframe = downcast<HTML::HTMLIFrameElement>(*node).content_frame())
return subframe->event_handler().handle_mouseup(position.translated(compute_mouse_event_offset({}, *result.layout_node)), button, modifiers);
return false;
}
@@ -142,7 +142,7 @@ bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned butt
return false;
if (is<HTML::HTMLIFrameElement>(*node)) {
- if (auto* subframe = downcast<HTML::HTMLIFrameElement>(*node).hosted_frame())
+ if (auto* subframe = downcast<HTML::HTMLIFrameElement>(*node).content_frame())
return subframe->event_handler().handle_mousedown(position.translated(compute_mouse_event_offset({}, *result.layout_node)), button, modifiers);
return false;
}
@@ -226,7 +226,7 @@ bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned butt
RefPtr<DOM::Node> node = result.layout_node->node();
if (node && is<HTML::HTMLIFrameElement>(*node)) {
- if (auto* subframe = downcast<HTML::HTMLIFrameElement>(*node).hosted_frame())
+ if (auto* subframe = downcast<HTML::HTMLIFrameElement>(*node).content_frame())
return subframe->event_handler().handle_mousemove(position.translated(compute_mouse_event_offset({}, *result.layout_node)), buttons, modifiers);
return false;
}