Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should CSS 2 be part of this test suite? #208

Closed
PolariTOON opened this issue Dec 21, 2020 · 18 comments · Fixed by #222
Closed

Should CSS 2 be part of this test suite? #208

PolariTOON opened this issue Dec 21, 2020 · 18 comments · Fixed by #222
Labels

Comments

@PolariTOON
Copy link
Collaborator

The CSS Snapshot states that CSS 3 is defined by a core part, CSS 2, extended by several modules.
These modules define new properties, selectors etc. or replace some existing terms in CSS 2.

However several definitions that were already in CSS 2 are untested in this test suite.

This includes:

  • features that are currently only defined in CSS 2, such as the visibility and z-index properties
  • features that are redefined in modules that are "not ready for implementation", such as border-collapse, border-spacing, caption-side, empty-cells, table-layout properties of CSS Table Module Level 3
  • features that are now deprecated, such asclip in CSS Masking Module Level 1
  • several selectors (+, >, * etc.)
  • several properties whose syntax was not extended such as border, margin, padding and font longhands
  • a lot of values or units (for width, float, position properties etc.)

Sometimes, the tests do exist, but are just put in other modules (for example, the direction property).

Basically, adding / moving tests would make this "syntactic" test suite more exhaustive and would show more clearly what's actually new in modules, especially the first levels.
However, i guess a lot of these features, if not all of them, are supported by every major browser for a long time now, and adding tests would increase score of all the browsers. But it's hard to say if there are discrepancies without... testing.

It is worth it? I can try to prepare a PR if it's a goal of this project.

@SebastianZ
Copy link
Collaborator

I was also already thinking about adding all the CSS 2 stuff a while back. And generally, I agree with it, especially in regard of completeness.

A few notes:

  • Features only defined in CSS 2 should definitely be tested. (Note that some properties there are still not implemented in all browsers. This applies to all the audio-related properties like speak or azimuth, for example.)
  • Deprecated features should not be tested if the specification doesn't explicitly note that user agents are required to implement them.
  • We should refer to the CSS 2.2 TR because 2.1 is actually outdated. (We may change the URL back to https://www.w3.org/TR/CSS2/ once 2.2 is reachable there/has REC status.

Sebastian

@LeaVerou
Copy link
Owner

I'm not sure.

My take:

  • We definitely don't want to test features that are currently deprecated. A browser increasing their score on the testsuite should be a positive thing.
  • Most things are widely implemented, so it would just add noise, without showing us anything useful. It would just bump every browser's score, essentially depreciating it.
  • And for the things that are not yet implemented, if they're not implemented after 20 years, they likely never will be implemented, so there's no point nudging browsers to implement them by reducing their score.

Fwiw, despite the name of the testsuite, if e.g. a level 4 module deprecates a level 3 feature, I believe we've tended to remove that feature.

Note that this is just my take, not a veto. If there is consensus to include these things, I will concede. :)

@Zefling
Copy link
Collaborator

Zefling commented Dec 23, 2020

I think it would be nice to be the most exhaustive. Also for those who add testing. We need to remember all that is in the CSS 2 and not added it, so we can not refer to the test.js.

As for what is obsolete, I do not have too much opinion. The browser often continues to keep the compatibility with aliases.

What I see, the test base evolves, obsolete modules are often removed.
For me, it's more a state of what exists and what is currently supported.

@LeaVerou
Copy link
Owner

I think we should ask ourselves what does being exhaustive get us? Who or what does it serve to see that all browsers support e.g. color: black or font-size: 12px?
Currently, browsers increasing their score on css3test has been a motivator to implement new things. This does not serve that purpose at all.
Developers also use the testsuite to compare what a given browser supports and what it doesn't. Adding things that every browser has supported for 20 years doesn't serve that purpose either.
So why do it? Theoretical purity and completeness are generally poor reasons to do things, if they are the only ones.

@SebastianZ
Copy link
Collaborator

* We definitely don't want to test features that are currently deprecated. A browser increasing their score on the testsuite should be a positive thing.

As I said, when browsers are still required to implement it, I tend to say that it should get tested. Though that's probably another thing where we shouldn't let it count towards the overall percentage.

* Most things are widely implemented, so it would just add noise, without showing us anything useful. It would just bump every browser's score, essentially depreciating it.

That's the point that let me hasitate to suggest it myself, though I can still see the point for having an exhaustive test suite.

* And for the things that are not yet implemented, if they're not implemented after 20 years, they likely never will be implemented, so there's no point nudging browsers to implement them by reducing their score.

In most cases that's true though I've also already seen a few things get implemented in browsers even after 20 years. And some things of CSS 2 like speak are implemented in some browers but not in others, so it still has some value.

Sebastian

@LeaVerou
Copy link
Owner

In most cases that's true though I've also already seen a few things get implemented in browsers even after 20 years. And some things of CSS 2 like speak are implemented in some browers but not in others, so it still has some value.

Then we can just add those things. We don't need to add the entirety of CSS 2 to test these things.

@davesnx
Copy link

davesnx commented May 14, 2021

Hey @LeaVerou, a little off-topic from css3test site. I'm interested in having CSS 2 tests the same way there's the CSS 3 file. Is there any way where I can look for those and create a css2 site, for example?

Thanks and sorry if this isn't aligned with the issue I didn't want to open a new issue for this :(

@LeaVerou
Copy link
Owner

We don't generally add tests for CSS 2 as it's pretty well supported, but feel free to fork it!

@davesnx
Copy link

davesnx commented May 16, 2021

Hey @LeaVerou, sure. I wanted to know if the format is something that exists in any other place. I was looking at https://github.com/mdn/data/tree/master/css but seems not exactly the same.

I believe CSS 2 is as big if not bigger than CSS 3, just wanted to avoid creating those manually or making a script for it.

@LeaVerou
Copy link
Owner

Not sure what you mean by "if the format is something that exists in any other place"?
CSS 2 is definitely not as big or bigger than CSS 3, quite the contrary. CSS 3 is dozens of specs, CSS 2 still fit in a single spec.

@davesnx
Copy link

davesnx commented May 16, 2021

I mean if there was a place with the content of tests.js that I could use to create a CSS 2 tests suite.

@SebastianZ
Copy link
Collaborator

I think, when we have the filter option added in #212, we can also add everything related to CSS 2 and put it behind a filter. To avoid the noise mentioned by @LeaVerou, the default filter could then exclude all widely supported (CSS 2) features.

Sebastian

@LeaVerou
Copy link
Owner

LeaVerou commented Jan 8, 2022

Seems like a lot of work for little benefit 🤷🏽‍♀️
As we say in the CSS WG, we don't add things for completeness, but only there are enough use cases that need them.
Are there any actual use cases for having these CSS 2 features? Why are they needed? What's interesting about adding dozens of tests that every modern browser passes?

@SebastianZ
Copy link
Collaborator

As we say in the CSS WG, we don't add things for completeness, but only there are enough use cases that need them.

We are talking about tests, not specifications. And for the web platform tests the CSS WG is also striving for completeness, right?

Anyway, I'll try to summarize what was mentioned so far:

  • Completeness
  • Correct info about overall support
  • Correct placement of tests (some tests that should be for CSS 2 are tested for newer specs)
  • Easier for test authors when features get extended

Maybe @davesnx can add his use case for having the data.

Sebastian

@LeaVerou
Copy link
Owner

LeaVerou commented Jan 9, 2022

And for the web platform tests the CSS WG is also striving for completeness, right?

css3test is not WPT, they have very distinct purposes. WPT needs to be extensive yes, but WPT also tests full conformance, so even CSS 2 features could be failing in some ways. css3test only tests recognition, and its aim is to give developers a quick view of which modern features a browser supports at a glance. Adding a bunch of tests that every browser passes and has done so for over a decade just adds noise and does not help anyone achieve anything. It's the same reason we avoid adding tests that no browser passes (yet).

Correct info about overall support

Define "correct". Should html5test.com also test <p> and <a> to show "correct info about overall support"?

Correct placement of tests (some tests that should be for CSS 2 are tested for newer specs)

Some examples would be useful.

Easier for test authors when features get extended

Could you elaborate?

@SebastianZ
Copy link
Collaborator

@LeaVerou

Correct info about overall support

Define "correct". Should html5test.com also test <p> and <a> to show "correct info about overall support"?

It should at least include all elements that are not supported by all browsers, but yes, for completeness, also those that have thorough support, at least optionally.

Correct placement of tests (some tests that should be for CSS 2 are tested for newer specs)

Some examples would be useful.

All of Color Level 3, several cursor values, background-position, counter-increment, and more.

Easier for test authors when features get extended

Could you elaborate?

See #208 (comment).

Note that this is just my take, not a veto. If there is consensus to include these things, I will concede. :)

From what I read above, all three recent contributors agree to add it. And I almost have a patch ready for review. So when's the point you'll concede? 😉

Note that I tend to agree with you that CSS 2 should not be included in the score by default but at least be available via a filter to show really everything.
I think with that everyone should be happy.

Sebastian

@LeaVerou
Copy link
Owner

Correct placement of tests (some tests that should be for CSS 2 are tested for newer specs)

Some examples would be useful.

All of Color Level 3, several cursor values, background-position, counter-increment, and more.

Why should Color L3 be under CSS2?!
Not sure we should be testing these cursor, background-position, counter-increment values, for the same reason I don't think we should have CSS2 tests. So my vote would be to delete these tests, not to add more like them.

See #208 (comment).

Note that this is just my take, not a veto. If there is consensus to include these things, I will concede. :)

From what I read above, all three recent contributors agree to add it. And I almost have a patch ready for review. So when's the point you'll concede? 😉

No concession is needed, if you want to add these tests, I’m not going to stop you! 😊
I don't think these tests do much harm (except a slight perf hit), I just think it’s a colossal waste of time to add them.
But it's your time, so I don't get a say with how you spend it. 😶

@SebastianZ SebastianZ mentioned this issue Jan 10, 2022
@SebastianZ
Copy link
Collaborator

Correct placement of tests (some tests that should be for CSS 2 are tested for newer specs)

Some examples would be useful.

All of Color Level 3, several cursor values, background-position, counter-increment, and more.

Why should Color L3 be under CSS2?!

My fault. Just some of the values are already defined in CSS 2.

From what I read above, all three recent contributors agree to add it. And I almost have a patch ready for review. So when's the point you'll concede? 😉

No concession is needed, if you want to add these tests, I’m not going to stop you! 😊 I don't think these tests do much harm (except a slight perf hit), I just think it’s a colossal waste of time to add them. But it's your time, so I don't get a say with how you spend it. 😶

Ok, time is wasted, patch is ready. 😉

Sebastian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants