From 86a4eaca389f6ab4f0250c666833cddf34ddcafa Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 22 Sep 2020 17:48:04 +0200 Subject: LibWeb: Rename HTMLIFrameElement::hosted_frame() => content_frame() This matches the standard API names contentWindow and contentDocument. --- Libraries/LibWeb/HTML/HTMLIFrameElement.cpp | 8 ++++---- Libraries/LibWeb/HTML/HTMLIFrameElement.h | 6 +++--- Libraries/LibWeb/Layout/LayoutFrame.cpp | 10 +++++----- Libraries/LibWeb/Page/EventHandler.cpp | 6 +++--- 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 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 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 m_hosted_frame; + RefPtr 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(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(), 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()); + ASSERT(node().content_frame()); + node().content_frame()->set_size(size().to_type()); } } 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 node = result.layout_node->node(); if (is(*node)) { - if (auto* subframe = downcast(*node).hosted_frame()) + if (auto* subframe = downcast(*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(*node)) { - if (auto* subframe = downcast(*node).hosted_frame()) + if (auto* subframe = downcast(*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 node = result.layout_node->node(); if (node && is(*node)) { - if (auto* subframe = downcast(*node).hosted_frame()) + if (auto* subframe = downcast(*node).content_frame()) return subframe->event_handler().handle_mousemove(position.translated(compute_mouse_event_offset({}, *result.layout_node)), buttons, modifiers); return false; } -- cgit v1.2.3