LeaVerou / css3test

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

Test values for different properties #184

Closed SebastianZ closed 1 year ago

SebastianZ commented 5 years ago

Currently, the properties to test specific values for are defined for all values of a module. This doesn't allow to test values that apply to other properties. That's the reason why transform needs to be listed as property to allow testing the value rotate(calc(15deg + 30deg)) in Values and Units Level 3.

There are two ways to fix that:

  1. Move all property definitions into the values. This means duplicating the properties for each value.
  2. Keep the general property definitions but allow individual values to overwrite them.

Personally, I prefer the first option. It means to duplicate the properties but it keeps the test logic and the structure of the tests simple.

Sebastian

LeaVerou commented 1 year ago

I strongly prefer the second option, it's in line with "simple things should be easy, complex things should be possible". The test logic can never be 100% encapsulated anyway, there is always context and a philosophical purity benefit should always have less priority than an actual, tangible one anyway.

SebastianZ commented 1 year ago

"simple things should be easy, complex things should be possible"

This is actually an argument option 1, as it simplifies the code logic. You only have to look at one place instead of two and properties doesn't have to be excluded when looping over the tests. So I am not convinced by that. Though I don't have such a strong opinion on that either, so I changed the code to option 2 now.

Sebastian