1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 05:27:14 +09:00

LibWeb/HTML: Compare paragraph align="" values insensitively

This is the one place we weren't comparing align keywords insensitively.
This commit is contained in:
Sam Atkins 2025-06-04 14:35:34 +01:00
parent 6f4df83917
commit 5b42f8d707
Notes: github-actions[bot] 2025-06-05 11:11:15 +00:00

View file

@ -41,13 +41,13 @@ void HTMLParagraphElement::apply_presentational_hints(GC::Ref<CSS::CascadedPrope
HTMLElement::apply_presentational_hints(cascaded_properties); HTMLElement::apply_presentational_hints(cascaded_properties);
for_each_attribute([&](auto& name, auto& value) { for_each_attribute([&](auto& name, auto& value) {
if (name == HTML::AttributeNames::align) { if (name == HTML::AttributeNames::align) {
if (value == "left"sv) if (value.equals_ignoring_ascii_case("left"sv))
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Left)); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Left));
else if (value == "right"sv) else if (value.equals_ignoring_ascii_case("right"sv))
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Right)); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Right));
else if (value == "center"sv) else if (value.equals_ignoring_ascii_case("center"sv))
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Center)); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Center));
else if (value == "justify"sv) else if (value.equals_ignoring_ascii_case("justify"sv))
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Justify)); cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Justify));
} }
}); });