LibWeb: Only clear command states and values if range actually changed

This commit is contained in:
Jelle Raaijmakers 2025-01-24 10:44:21 +01:00 committed by Andreas Kling
commit 486bce8dad
Notes: github-actions[bot] 2025-01-24 22:54:50 +00:00
2 changed files with 14 additions and 2 deletions

View file

@ -1,6 +1,7 @@
/*
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -41,6 +42,14 @@ public:
return start_container() == end_container() && start_offset() == end_offset();
}
bool operator==(AbstractRange const& other) const
{
return start_container() == other.start_container()
&& start_offset() == other.start_offset()
&& end_container() == other.end_container()
&& end_offset() == other.end_offset();
}
protected:
AbstractRange(GC::Ref<Node> start_container, WebIDL::UnsignedLong start_offset, GC::Ref<Node> end_container, WebIDL::UnsignedLong end_offset);