LibWeb: Support the 'x' resolution unit identifier

The 'x' unit is the same as 'dppx', but was previously not considered
when parsing resolutions.
This commit is contained in:
Glenn Skrzypczak 2024-10-12 23:30:40 +02:00 committed by Andrew Kaster
parent ef65694ac0
commit 7ed08a401f
Notes: github-actions[bot] 2024-10-13 04:24:01 +00:00

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2022-2023, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2024, Glenn Skrzypczak <glenn.skrzypczak@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -56,7 +57,7 @@ Optional<Resolution::Type> Resolution::unit_from_name(StringView name)
return Type::Dpi;
} else if (name.equals_ignoring_ascii_case("dpcm"sv)) {
return Type::Dpcm;
} else if (name.equals_ignoring_ascii_case("dppx"sv)) {
} else if (name.equals_ignoring_ascii_case("dppx"sv) || name.equals_ignoring_ascii_case("x"sv)) {
return Type::Dppx;
}
return {};