1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

LibWeb: Use the cached white-space from LayoutStyle in text_for_style()

This commit is contained in:
Andreas Kling 2020-06-24 21:44:11 +02:00
parent 440b4ece22
commit 8960c6f8fe

View file

@ -59,7 +59,7 @@ const String& LayoutText::text_for_style(const StyleProperties& style) const
{
static String one_space = " ";
if (is_all_whitespace(node().data())) {
if (style.string_or_fallback(CSS::PropertyID::WhiteSpace, "normal") == "normal")
if (style.white_space().value_or(CSS::WhiteSpace::Normal) == CSS::WhiteSpace::Normal)
return one_space;
}
return node().data();