From 41fe02e0123900af50c18269e6a6c2cb417de59c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 6 Feb 2022 14:41:29 +0100 Subject: LibWeb: Rename "frame" to "browsing_context" in various places We renamed the Frame class to BrowsingContext a while back, but forgot to update some variable names. --- Userland/Libraries/LibWeb/DOM/Window.cpp | 18 ++-- .../LibWeb/HTML/BrowsingContextContainer.cpp | 8 +- Userland/Libraries/LibWeb/Layout/ButtonBox.cpp | 6 +- .../Libraries/LibWeb/Page/EditEventHandler.cpp | 10 +- Userland/Libraries/LibWeb/Page/EditEventHandler.h | 6 +- Userland/Libraries/LibWeb/Page/EventHandler.cpp | 114 ++++++++++----------- Userland/Libraries/LibWeb/Page/EventHandler.h | 2 +- 7 files changed, 82 insertions(+), 82 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/Window.cpp b/Userland/Libraries/LibWeb/DOM/Window.cpp index 4275d13ea6..04cc04b80e 100644 --- a/Userland/Libraries/LibWeb/DOM/Window.cpp +++ b/Userland/Libraries/LibWeb/DOM/Window.cpp @@ -223,27 +223,27 @@ void Window::cancel_animation_frame(i32 id) void Window::did_set_location_href(Badge, AK::URL const& new_href) { - auto* frame = associated_document().browsing_context(); - if (!frame) + auto* browsing_context = associated_document().browsing_context(); + if (!browsing_context) return; - frame->loader().load(new_href, FrameLoader::Type::Navigation); + browsing_context->loader().load(new_href, FrameLoader::Type::Navigation); } void Window::did_call_location_reload(Badge) { - auto* frame = associated_document().browsing_context(); - if (!frame) + auto* browsing_context = associated_document().browsing_context(); + if (!browsing_context) return; - frame->loader().load(associated_document().url(), FrameLoader::Type::Reload); + browsing_context->loader().load(associated_document().url(), FrameLoader::Type::Reload); } void Window::did_call_location_replace(Badge, String url) { - auto* frame = associated_document().browsing_context(); - if (!frame) + auto* browsing_context = associated_document().browsing_context(); + if (!browsing_context) return; auto new_url = associated_document().parse_url(url); - frame->loader().load(move(new_url), FrameLoader::Type::Navigation); + browsing_context->loader().load(move(new_url), FrameLoader::Type::Navigation); } bool Window::dispatch_event(NonnullRefPtr event) diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp index ac89d3b789..c6f04e9291 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp @@ -27,10 +27,10 @@ void BrowsingContextContainer::inserted() HTMLElement::inserted(); if (!is_connected()) return; - if (auto* frame = document().browsing_context()) { - VERIFY(frame->page()); - m_nested_browsing_context = BrowsingContext::create_nested(*frame->page(), *this); - m_nested_browsing_context->set_frame_nesting_levels(frame->frame_nesting_levels()); + if (auto* browsing_context = document().browsing_context()) { + VERIFY(browsing_context->page()); + m_nested_browsing_context = BrowsingContext::create_nested(*browsing_context->page(), *this); + m_nested_browsing_context->set_frame_nesting_levels(browsing_context->frame_nesting_levels()); m_nested_browsing_context->register_frame_nesting(document().url()); } } diff --git a/Userland/Libraries/LibWeb/Layout/ButtonBox.cpp b/Userland/Libraries/LibWeb/Layout/ButtonBox.cpp index 12c71678af..150b4e7c53 100644 --- a/Userland/Libraries/LibWeb/Layout/ButtonBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/ButtonBox.cpp @@ -70,7 +70,7 @@ void ButtonBox::handle_mouseup(Badge, const Gfx::IntPoint& positio // NOTE: Handling the click may run arbitrary JS, which could disappear this node. NonnullRefPtr protected_this = *this; - NonnullRefPtr protected_frame = browsing_context(); + NonnullRefPtr protected_browsing_context = browsing_context(); bool is_inside_node_or_label = enclosing_int_rect(absolute_rect()).contains(position); if (!is_inside_node_or_label) @@ -82,7 +82,7 @@ void ButtonBox::handle_mouseup(Badge, const Gfx::IntPoint& positio m_being_pressed = false; m_tracking_mouse = false; - protected_frame->event_handler().set_mouse_event_tracking_layout_node(nullptr); + protected_browsing_context->event_handler().set_mouse_event_tracking_layout_node(nullptr); } void ButtonBox::handle_mousemove(Badge, const Gfx::IntPoint& position, unsigned, unsigned) @@ -111,7 +111,7 @@ void ButtonBox::handle_associated_label_mouseup(Badge