LibWeb: VERIFY that nobody tries to hash a non-finite CSSPixels value

Non-finite CSSPixels quantities should never make their way into hash
tables. If this ever happens, let's catch it closer to the source
instead of letting things cascade into confusion.
This commit is contained in:
Andreas Kling 2023-05-06 15:46:11 +02:00
parent 7e4db556eb
commit 134717ec8f

View file

@ -127,6 +127,7 @@ template<>
struct Traits<Web::CSSPixels> : public GenericTraits<Web::CSSPixels> {
static unsigned hash(Web::CSSPixels const& key)
{
VERIFY(isfinite(key.value()));
return Traits<Web::CSSPixels::Type>::hash(key.value());
}