LadybirdBrowser / ladybird

Truly independent web browser
https://ladybird.org
BSD 2-Clause "Simplified" License
21.98k stars 973 forks source link

Test our SVG implementation with resvg-test-suite #2306

Open shlyakpavel opened 3 days ago

shlyakpavel commented 3 days ago

This seems like a great opportunity to benchmark our SVG implementation against resvg-test-suite.

It appears that the test suite doesn't include a built-in runner, so we’ll need to create a script to run our SVG renderer and compare the output against the reference PNGs ourselves.

shlyakpavel commented 23 hours ago

1680 tests done 1600 if them are not UB Final success rate for ladybird with all the tests: 27.5% This is not bad at all. We also have extraordinary low crash rate. Feel free to take data on github and analyze it yourself https://github.com/linebender/resvg-test-suite/pull/55 output-4

shlyakpavel commented 23 hours ago

In my opinion, top priority for fixing these tests are: 1) Gradients (not positioned correctly) 2) Font rendering 3) Asian characters (Japanese and Arabic) 4) Blur (I guess we don't support it at all) 5) Nested images (inline pngs jpegs etc) 6) Markers (I think we don't support these at all) Other issues were very rare to occur

gmta commented 13 hours ago

@shlyakpavel Do you have a simple reproduction case for one of the gradient mispositioning issues?

shlyakpavel commented 10 hours ago

@gmta MDN has https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Gradients#basic_example Safari:

image

Ladybird:

image
gmta commented 9 hours ago

This is how that page looks on my machine: image

Can you still reproduce it with the latest master? What platform are you running on?

gmta commented 9 hours ago

Ah, it does get mangled when you start to zoom in. I'm guessing this might be a difference in DPI

shlyakpavel commented 9 hours ago

@gmta I have a 13 inch MacBook Air (m1) running macOS 15.1

nico commented 8 hours ago

(Possibly a regression from moving to Skia; looks fine in Serenity's browser's mac port on retina.)

image

(This is the example in a standalone file; the full thing doesn't load in Serenity's browser apparently)

gmta commented 8 hours ago

@nico No, you probably didn't cherry pick everything yet :-) this is the result of one of my changes in the way we deal with gradient coordinate spaces. I've got a fix underway.