mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
committed by
Andreas Kling
parent
950e819ee7
commit
93712b24bf
37
Libraries/LibWeb/CSS/PreferredContrast.cpp
Normal file
37
Libraries/LibWeb/CSS/PreferredContrast.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) 2024, the Ladybird developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/CSS/PreferredContrast.h>
|
||||
|
||||
namespace Web::CSS {
|
||||
|
||||
PreferredContrast preferred_contrast_from_string(StringView value)
|
||||
{
|
||||
if (value.equals_ignoring_ascii_case("less"sv))
|
||||
return PreferredContrast::Less;
|
||||
if (value.equals_ignoring_ascii_case("more"sv))
|
||||
return PreferredContrast::More;
|
||||
if (value.equals_ignoring_ascii_case("no-preference"sv))
|
||||
return PreferredContrast::NoPreference;
|
||||
return PreferredContrast::Auto;
|
||||
}
|
||||
|
||||
StringView preferred_contrast_to_string(PreferredContrast value)
|
||||
{
|
||||
switch (value) {
|
||||
case PreferredContrast::Auto:
|
||||
return "auto"sv;
|
||||
case PreferredContrast::Less:
|
||||
return "less"sv;
|
||||
case PreferredContrast::More:
|
||||
return "more"sv;
|
||||
case PreferredContrast::NoPreference:
|
||||
return "no-preference"sv;
|
||||
}
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user