mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Omit nonzero fill rule when serializing polygon()
Gains us ~160 WPT passes
This commit is contained in:
committed by
Tim Ledbetter
parent
8a8383d59d
commit
72a00a17cc
Notes:
github-actions[bot]
2026-01-06 10:50:56 +00:00
Author: https://github.com/Calme1709 Commit: https://github.com/LadybirdBrowser/ladybird/commit/72a00a17cc2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7340 Reviewed-by: https://github.com/tcl3 ✅
@@ -199,18 +199,22 @@ String Polygon::to_string(SerializationMode mode) const
|
||||
{
|
||||
StringBuilder builder;
|
||||
builder.append("polygon("sv);
|
||||
bool first = true;
|
||||
switch (fill_rule) {
|
||||
case Gfx::WindingRule::Nonzero:
|
||||
builder.append("nonzero"sv);
|
||||
break;
|
||||
case Gfx::WindingRule::EvenOdd:
|
||||
first = false;
|
||||
builder.append("evenodd"sv);
|
||||
}
|
||||
for (auto const& point : points) {
|
||||
builder.appendff(", {} {}", point.x->to_string(mode), point.y->to_string(mode));
|
||||
if (!first)
|
||||
builder.append(", "sv);
|
||||
first = false;
|
||||
builder.appendff("{} {}", point.x->to_string(mode), point.y->to_string(mode));
|
||||
}
|
||||
builder.append(')');
|
||||
return MUST(builder.to_string());
|
||||
return builder.to_string_without_validation();
|
||||
}
|
||||
|
||||
Gfx::Path Path::to_path(CSSPixelRect, Layout::Node const&) const
|
||||
|
||||
Reference in New Issue
Block a user