Closed dbaron closed 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?
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".
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!
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.
I thought all things like properties in at-rules were called descriptors? E.g. the descriptors in @viewport, @counter-style and page.
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.