LeaVerou / css3test

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

Test unicode-range as a descriptor, not a property. #131

Closed dbaron closed 8 years ago

dbaron commented 8 years ago

This implements support for testing whether a value of an @font-face descriptor is supported. I've added the code to do this in supports.js, although it's not clear to me whether I should be adding it there, or whether you'd rather leave supports.js untouched and add this code outside of it.

The test for testing descriptors works somewhat differently from other properties because there isn't any better object model support that's interoperable. I've tested locally in Firefox and Chrome that supported descriptors pass and unsupported descriptors fail.

I didn't add support for prefixing in the tests of descriptor support. It didn't seem necessary for the unicode-range test, it's extra work, and I tend to think it's also harmful to promote prefixed support.

This flips the unicode-range tests from red to green on both Firefox and Chrome. I haven't tested elsewhere.

LeaVerou commented 8 years ago

Hey, thanks so much! Long overdue. Is @font-face the right way to test this though? In the future we might have descriptors for other @rules, e.g. the upcoming @color-profile that @svgeesus is currently speccing. Perhaps it could get an @rule argument, like values get a property argument?

dbaron commented 8 years ago

Does @color-profile also use the term descriptor, and also use a syntax that consists of descriptors inside of "@color-profile { ... }" with no additional syntax? If so, then that makes sense; this just seemed simple given that so far @font-face is the only thing that uses the term "descriptor".

LeaVerou commented 8 years ago

Well, let’s cross that bridge when we get to it. We can always refactor then and add at-rule arguments, whereas showing proper support for unicode-range is a current problem. Merged, thanks again!

svgeesus commented 8 years ago

I did plan to use the term descriptor in @color-profile, yes, for consistency. For example a src descriptor like @font-face has, and a name descriptor which is likethe font-family one. And probably a rendering-intent descriptor as well. Is there a reason to introduce new terminology? Descriptors seem like a good fit here.

dstorey commented 8 years ago

I thought all things like properties in at-rules were called descriptors? E.g. the descriptors in @viewport, @counter-style and page.