LibWeb: Improve relList feature detection support

`DOMTokenList.supports()` is now correct for all possible `rel`
attribute values for `link`, `a`, `area` and `form` elements.
This commit is contained in:
Tim Ledbetter 2024-12-06 08:57:33 +00:00 committed by Tim Ledbetter
commit d946d94e2d
Notes: github-actions[bot] 2024-12-06 18:10:45 +00:00
4 changed files with 121 additions and 9 deletions

View file

@ -62,3 +62,22 @@ private:
};
}
struct SupportedTokenKey {
FlyString element_name;
FlyString attribute_name;
constexpr bool operator==(SupportedTokenKey const& other) const = default;
};
namespace AK {
template<>
struct Traits<SupportedTokenKey> : public DefaultTraits<SupportedTokenKey> {
static unsigned hash(SupportedTokenKey const& key)
{
return pair_int_hash(key.element_name.hash(), key.attribute_name.hash());
}
};
}