Kozea / WeasyPrint

The awesome document factory
https://weasyprint.org
BSD 3-Clause "New" or "Revised" License
7.23k stars 686 forks source link

test_borders_table_collapse and assert_different_renderings seem flaky #2305

Open benoitkugler opened 1 day ago

benoitkugler commented 1 day ago

Hi,

I think there is currently two issues regarding test_borders_table_collapse :

  1. Under collapsed borders, the groove and outset styles render the same (as well as the inset/ridge pair), so that the test should not ask for different renderings
  2. I think Weasyprint actually properly follows the spec, but that assert_different_renderings seems broken : at tests/draw/init.py line 85, the pixels comparison pixels_1 == pixels_2 seems to always be False, since the variables are compared by reference, not by actual pixel content. A simple fix should be to change the comparison to list(pixels_1) == list(pixels_2)

From what I understand, no change is required to the library, only to the tests.

liZe commented 1 day ago

Hi,

Thanks for the report, I don’t know how you caught this! Interested in providing a pull request?

benoitkugler commented 6 hours ago

I'm writing a port of WeasyPrint for the Go programming language. Thanks by the way for your work, it has been very interesting to dig into the depths of HTML rendering ! I've discovered the issue because the Go version of the test was failing, yet with a seemimgly correct rendering.

I can send a PR, not sure when however