mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:07:45 +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:
parent
61115dc638
commit
148efd7de7
2 changed files with 0 additions and 27 deletions
|
@ -36,29 +36,6 @@ bool MediaFeatureValue::is_same_type(MediaFeatureValue const& other) const
|
||||||
[&](double) { return other.is_number(); });
|
[&](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
|
String MediaFeature::to_string() const
|
||||||
{
|
{
|
||||||
auto comparison_string = [](Comparison comparison) -> StringView {
|
auto comparison_string = [](Comparison comparison) -> StringView {
|
||||||
|
|
|
@ -60,10 +60,6 @@ public:
|
||||||
return m_value.get<double>();
|
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:
|
private:
|
||||||
// TODO: Support <ratio> once we have that.
|
// TODO: Support <ratio> once we have that.
|
||||||
Variant<String, Length, double> m_value;
|
Variant<String, Length, double> m_value;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue