mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 15:19:42 +00:00
LibWeb: Make CSS display
serialization match other engines
The spec just says to follow "most backwards-compatible, then shortest" when serializing these (and it does so in a very hand-wavy fashion). By omitting some keywords when they are implied, we end up matching other engines and pass a bunch of WPT tests.
This commit is contained in:
parent
70695e4fce
commit
ce23efc5f6
Notes:
github-actions[bot]
2024-11-15 13:47:01 +00:00
Author: https://github.com/awesomekling
Commit: ce23efc5f6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2356
3 changed files with 60 additions and 57 deletions
|
@ -42,11 +42,16 @@ String Display::to_string() const
|
|||
if (*this == Display::from_short(Display::Short::InlineTable))
|
||||
return "inline-table"_string;
|
||||
|
||||
builder.append(CSS::to_string(m_value.outside_inside.outside));
|
||||
builder.append(' ');
|
||||
builder.append(CSS::to_string(m_value.outside_inside.inside));
|
||||
if (m_value.outside_inside.list_item == ListItem::Yes)
|
||||
builder.append(" list-item"sv);
|
||||
{
|
||||
Vector<StringView, 3> parts;
|
||||
if (!(m_value.outside_inside.outside == DisplayOutside::Block && m_value.outside_inside.inside == DisplayInside::FlowRoot))
|
||||
parts.append(CSS::to_string(m_value.outside_inside.outside));
|
||||
if (m_value.outside_inside.inside != DisplayInside::Flow)
|
||||
parts.append(CSS::to_string(m_value.outside_inside.inside));
|
||||
if (m_value.outside_inside.list_item == ListItem::Yes)
|
||||
parts.append("list-item"sv);
|
||||
builder.join(' ', parts);
|
||||
}
|
||||
break;
|
||||
case Type::Internal:
|
||||
builder.append(CSS::to_string(m_value.internal));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue