1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

LibWeb: Remove unused MediaFeatureValue::equals() and friends

At some point during development I moved the comparison logic outside of
MediaFeatureValue but didn't notice. Oops!
This commit is contained in:
Sam Atkins 2022-02-15 15:23:53 +00:00 committed by Andreas Kling
parent 61115dc638
commit 148efd7de7
2 changed files with 0 additions and 27 deletions

View file

@ -36,29 +36,6 @@ bool MediaFeatureValue::is_same_type(MediaFeatureValue const& other) const
[&](double) { return other.is_number(); });
}
bool MediaFeatureValue::equals(MediaFeatureValue const& other) const
{
if (!is_same_type(other))
return false;
if (is_ident() && other.is_ident())
return m_value.get<String>().equals_ignoring_case(other.m_value.get<String>());
if (is_length() && other.is_length()) {
// FIXME: Handle relative lengths. https://www.w3.org/TR/mediaqueries-4/#ref-for-relative-length
auto& my_length = m_value.get<Length>();
auto& other_length = other.m_value.get<Length>();
if (!my_length.is_absolute() || !other_length.is_absolute()) {
dbgln("TODO: Support relative lengths in media queries!");
return false;
}
return my_length.absolute_length_to_px() == other_length.absolute_length_to_px();
}
if (is_number() && other.is_number())
return m_value.get<double>() == other.m_value.get<double>();
VERIFY_NOT_REACHED();
}
String MediaFeature::to_string() const
{
auto comparison_string = [](Comparison comparison) -> StringView {