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
Notes: sideshowbarker 2024-07-17 18:44:05 +09:00
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 {

View file

@ -60,10 +60,6 @@ public:
return m_value.get<double>();
}
bool operator==(MediaFeatureValue const& other) const { return equals(other); }
bool operator!=(MediaFeatureValue const& other) const { return !(*this == other); }
bool equals(MediaFeatureValue const& other) const;
private:
// TODO: Support <ratio> once we have that.
Variant<String, Length, double> m_value;