web-platform-tests / wpt

Test suites for Web platform specs — including WHATWG, W3C, and others
https://web-platform-tests.org/
Other
4.97k stars 3.09k forks source link

Requiring cairo for 2dcontext tests is annoying #19780

Open grorg opened 5 years ago

grorg commented 5 years ago

The tool that generates the 2dcontext tests requires a python API for cairo, which of course requires the cairo library to be available. This is quite annoying (and I couldn't find good instructions on how to install the library, and even when I did I struggled to get the python virtual environment to load the library).

It seems it is mostly used to generate reference images. Why don't we use the 2d context API itself for this, via some kind of webdriver script?

foolip commented 4 years ago

In https://github.com/web-platform-tests/wpt/issues/23292 I ran into a failure related to cairo on macOS, so I agree this is annoying :)

@grorg did you get it to work at all?

foolip commented 4 years ago

Also see https://github.com/web-platform-tests/wpt/issues/22979 about reorganizing the tests, maybe there will be appetite for more changes there if there's a concrete suggestion.

mysteryDate commented 4 years ago

Yeah, Cairo is used to generate reference images. Using the 2d context itself would be a bit funny, because then we'd just be comparing the result to itself. What we do in chromium often is have a "reference page" that generates the same image in a different way to test the behaviour.

https://github.com/web-platform-tests/wpt/blob/master/html/canvas/tools/tests2d.yaml#L1710

I guess we could do the above with css? Other than linear gradients and solid rectangles, I can't see anywhere else that cairo is used.