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
Notes: sideshowbarker 2024-07-19 05:24:18 +09:00

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();