mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
AK+Everywhere: Make Variant::visit() respect the Variant's constness
...and fix all the instances of visit() taking non-const arguments.
This commit is contained in:
committed by
Ali Mohammad Pur
parent
d55c130df5
commit
9de33629da
@@ -23,16 +23,16 @@ NonnullRefPtr<MediaQuery> MediaQuery::create_not_all()
|
||||
String MediaFeatureValue::to_string() const
|
||||
{
|
||||
return m_value.visit(
|
||||
[](String& ident) { return serialize_an_identifier(ident); },
|
||||
[](Length& length) { return length.to_string(); },
|
||||
[](String const& ident) { return serialize_an_identifier(ident); },
|
||||
[](Length const& length) { return length.to_string(); },
|
||||
[](double number) { return String::number(number); });
|
||||
}
|
||||
|
||||
bool MediaFeatureValue::is_same_type(MediaFeatureValue const& other) const
|
||||
{
|
||||
return m_value.visit(
|
||||
[&](String&) { return other.is_ident(); },
|
||||
[&](Length&) { return other.is_length(); },
|
||||
[&](String const&) { return other.is_ident(); },
|
||||
[&](Length const&) { return other.is_length(); },
|
||||
[&](double) { return other.is_number(); });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user