LeaVerou / css3test

How does your browser score for its CSS3 support?
http://css3test.com
MIT License
214 stars 83 forks source link

Avoid NaN score if values are tested again unsupported properties. #214

Closed pwombwell closed 2 years ago

pwombwell commented 2 years ago

The recently added Fragmentation Level 4 group causes Flow browser's overall score to display 'NaN'. This is because it tests values against a properties that are not supported, unlike every other group in the test suite.

Test.groups() loops through the list of properties, and as none are supported, removes them from the list. This means properties.length is zero. failed.length is also zero.

'success' now depends on a division by zero, which is NaN, which propagates up to the overall score at the top of the page.

Flow reports a correct %age for every other group, but because the overall score depends on NaN, it itself becomes NaN.

I can work around it by adding 'break-before' or 'break-after' to Flow, but with no supported values, but I think it's better to fix in css3test.

SebastianZ commented 2 years ago

I've merged your PR now and made the suggested change in https://github.com/LeaVerou/css3test/commit/b86646d1283f69c6a9a993a79771021dfc8ef6e2.

Thank you again for the patch!

Sebastian