mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:07:36 +00:00
LibWeb: Convert a bunch of dbg() to dbgln()
This commit is contained in:
parent
4714b04d32
commit
0a3b834346
12 changed files with 31 additions and 38 deletions
|
@ -39,11 +39,11 @@ Position::~Position()
|
|||
{
|
||||
}
|
||||
|
||||
const LogStream& operator<<(const LogStream& stream, const Position& position)
|
||||
String Position::to_string() const
|
||||
{
|
||||
if (!position.node())
|
||||
return stream << "DOM::Position(nullptr, " << position.offset() << ")";
|
||||
return stream << "DOM::Position(" << position.node()->node_name() << "{" << position.node() << "}, " << position.offset() << ")";
|
||||
if (!node())
|
||||
return String::formatted("DOM::Position(nullptr, {})", offset());
|
||||
return String::formatted("DOM::Position({} ({})), {})", node()->node_name(), node(), offset());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -57,11 +57,22 @@ public:
|
|||
return !(*this == other);
|
||||
}
|
||||
|
||||
String to_string() const;
|
||||
|
||||
private:
|
||||
RefPtr<Node> m_node;
|
||||
unsigned m_offset { 0 };
|
||||
};
|
||||
|
||||
const LogStream& operator<<(const LogStream&, const Position&);
|
||||
}
|
||||
|
||||
namespace AK {
|
||||
template<>
|
||||
struct Formatter<Web::DOM::Position> : Formatter<StringView> {
|
||||
void format(FormatBuilder& builder, const Web::DOM::Position& value)
|
||||
{
|
||||
Formatter<StringView>::format(builder, value.to_string());
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue