mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
LibWeb: Only preserve full whitspace for white-space: pre{,-wrap}
This commit is contained in:
parent
b322452ef4
commit
18f1f4e1a2
1 changed files with 6 additions and 1 deletions
|
@ -61,8 +61,13 @@ const String& TextNode::text_for_style(const CSS::StyleProperties& style) const
|
|||
{
|
||||
static String one_space = " ";
|
||||
if (is_all_whitespace(dom_node().data())) {
|
||||
if (style.white_space().value_or(CSS::WhiteSpace::Normal) == CSS::WhiteSpace::Normal)
|
||||
switch (style.white_space().value_or(CSS::WhiteSpace::Normal)) {
|
||||
case CSS::WhiteSpace::Pre:
|
||||
case CSS::WhiteSpace::PreWrap:
|
||||
break;
|
||||
default:
|
||||
return one_space;
|
||||
}
|
||||
}
|
||||
return dom_node().data();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue