1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 16:15:10 +00:00

LibWeb: Make DOM::Range more suitable for JS.

This commit is contained in:
asynts 2020-12-06 19:51:55 +01:00 committed by Andreas Kling
parent 4df0eeaa3d
commit 10f9c85090
11 changed files with 186 additions and 69 deletions

View file

@ -39,24 +39,6 @@ Position::~Position()
{
}
Range Range::normalized() const
{
if (!is_valid())
return {};
if (m_start.node() == m_end.node()) {
if (m_start.offset() <= m_end.offset())
return *this;
return { m_end, m_start };
}
if (m_start.node()->is_before(*m_end.node()))
return *this;
return { m_end, m_start };
}
const LogStream& operator<<(const LogStream& stream, const Position& position)
{
if (!position.node())