1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 22:17:42 +00:00

LibWeb: Convert a bunch of dbg() to dbgln()

This commit is contained in:
Andreas Kling 2021-01-09 14:02:45 +01:00
parent 4714b04d32
commit 0a3b834346
12 changed files with 31 additions and 38 deletions

View file

@ -110,10 +110,8 @@ bool EventHandler::handle_mouseup(const Gfx::IntPoint& position, unsigned button
handled_event = true;
}
if (button == GUI::MouseButton::Left) {
dump_selection("MouseUp");
if (button == GUI::MouseButton::Left)
m_in_mouse_selection = false;
}
return handled_event;
}
@ -174,7 +172,7 @@ bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned butt
if (RefPtr<HTML::HTMLAnchorElement> link = node->enclosing_link_element()) {
auto href = link->href();
auto url = document->complete_url(href);
dbg() << "Web::EventHandler: Clicking on a link to " << url;
dbgln("Web::EventHandler: Clicking on a link to {}", url);
if (button == GUI::MouseButton::Left) {
auto href = link->href();
auto url = document->complete_url(href);
@ -205,7 +203,6 @@ bool EventHandler::handle_mousedown(const Gfx::IntPoint& position, unsigned butt
if (result.layout_node && result.layout_node->dom_node()) {
m_frame.set_cursor_position(DOM::Position(*node, result.index_in_node));
layout_root()->set_selection({ { result.layout_node, result.index_in_node }, {} });
dump_selection("MouseDown");
m_in_mouse_selection = true;
}
} else if (button == GUI::MouseButton::Right) {
@ -271,7 +268,6 @@ bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned butt
if (hit.layout_node && hit.layout_node->dom_node()) {
layout_root()->set_selection_end({ hit.layout_node, hit.index_in_node });
}
dump_selection("MouseMove");
if (auto* page = m_frame.page())
page->client().page_did_change_selection();
}
@ -301,15 +297,6 @@ bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned butt
return true;
}
void EventHandler::dump_selection([[maybe_unused]] const char* event_name) const
{
#ifdef SELECTION_DEBUG
dbg() << event_name << " selection start: "
<< layout_root()->selection().start().layout_node << ":" << layout_root()->selection().start().index_in_node << ", end: "
<< layout_root()->selection().end().layout_node << ":" << layout_root()->selection().end().index_in_node;
#endif
}
bool EventHandler::focus_next_element()
{
if (!m_frame.document())