Skip to content

Commit ae8d854

Browse files
committed
fix: match the spec so that feature-* in tech() becomes plural
Spec changed in: w3c/csswg-drafts#7663 (comment) Chrome CL: https://chromium-review.googlesource.com/c/chromium/src/+/3856267
1 parent ca503cf commit ae8d854

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9452,8 +9452,8 @@ mod tests {
94529452
"@font-face{src:url(test.ttc)format(\"collection\"),url(test.ttf)format(\"truetype\")}",
94539453
);
94549454
minify_test(
9455-
"@font-face {src: url(\"test.otf\") format(opentype) tech(feature-aat);}",
9456-
"@font-face{src:url(test.otf)format(\"opentype\")tech(feature-aat)}",
9455+
"@font-face {src: url(\"test.otf\") format(opentype) tech(features-aat);}",
9456+
"@font-face{src:url(test.otf)format(\"opentype\")tech(features-aat)}",
94579457
);
94589458
minify_test(
94599459
"@font-face {src: url(\"test.woff\") format(woff) tech(color-colrv1);}",
@@ -9469,12 +9469,12 @@ mod tests {
94699469
);
94709470
// multiple tech
94719471
minify_test(
9472-
"@font-face {src: url(\"test.woff\") format(woff) tech(feature-opentype, color-sbix);}",
9473-
"@font-face{src:url(test.woff)format(\"woff\")tech(feature-opentype,color-sbix)}",
9472+
"@font-face {src: url(\"test.woff\") format(woff) tech(features-opentype, color-sbix);}",
9473+
"@font-face{src:url(test.woff)format(\"woff\")tech(features-opentype,color-sbix)}",
94749474
);
94759475
minify_test(
9476-
"@font-face {src: url(\"test.woff\") format(woff) tech(incremental, color-svg, feature-graphite, feature-aat);}",
9477-
"@font-face{src:url(test.woff)format(\"woff\")tech(incremental,color-svg,feature-graphite,feature-aat)}",
9476+
"@font-face {src: url(\"test.woff\") format(woff) tech(incremental, color-svg, features-graphite, features-aat);}",
9477+
"@font-face{src:url(test.woff)format(\"woff\")tech(incremental,color-svg,features-graphite,features-aat)}",
94789478
);
94799479
// format() function must precede tech() if both are present
94809480
minify_test(
@@ -9496,15 +9496,15 @@ mod tests {
94969496
// TODO(CGQAQ): make this test pass when we have strict mode
94979497
// ref: https://github.com/web-platform-tests/wpt/blob/9f8a6ccc41aa725e8f51f4f096f686313bb88d8d/css/css-fonts/parsing/font-face-src-tech.html#L45
94989498
// error_test(
9499-
// "@font-face {src: url(\"foo.ttf\") tech(feature-opentype) format(opentype);}",
9499+
// "@font-face {src: url(\"foo.ttf\") tech(features-opentype) format(opentype);}",
95009500
// ParserError::AtRuleBodyInvalid,
95019501
// );
95029502
// error_test(
95039503
// "@font-face {src: url(\"foo.ttf\") tech();}",
95049504
// ParserError::AtRuleBodyInvalid,
95059505
// );
95069506
// error_test(
9507-
// "@font-face {src: url(\"foo.ttf\") tech(\"feature-opentype\");}",
9507+
// "@font-face {src: url(\"foo.ttf\") tech(\"features-opentype\");}",
95089508
// ParserError::AtRuleBodyInvalid,
95099509
// );
95109510
// error_test(

src/rules/font_face.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,18 +233,18 @@ enum_property! {
233233
/// [src](https://drafts.csswg.org/css-fonts/#src-desc)
234234
/// property of an `@font-face` rule.
235235
pub enum FontTechnology {
236-
/// A font feature tech descriptor in the `tech()`function of the
237-
/// [src](https://drafts.csswg.org/css-fonts/#font-feature-tech-values)
236+
/// A font features tech descriptor in the `tech()`function of the
237+
/// [src](https://drafts.csswg.org/css-fonts/#font-features-tech-values)
238238
/// property of an `@font-face` rule.
239239
/// Supports OpenType Features.
240240
/// https://docs.microsoft.com/en-us/typography/opentype/spec/featurelist
241-
"feature-opentype": FeatureOpentype,
241+
"features-opentype": FeaturesOpentype,
242242
/// Supports Apple Advanced Typography Font Features.
243243
/// https://developer.apple.com/fonts/TrueType-Reference-Manual/RM09/AppendixF.html
244-
"feature-aat": FeatureAat,
244+
"features-aat": FeaturesAat,
245245
/// Supports Graphite Table Format.
246246
/// https://scripts.sil.org/cms/scripts/render_download.php?site_id=nrsi&format=file&media_id=GraphiteBinaryFormat_3_0&filename=GraphiteBinaryFormat_3_0.pdf
247-
"feature-graphite": FeatureGraphite,
247+
"features-graphite": FeaturesGraphite,
248248

249249
/// A color font tech descriptor in the `tech()`function of the
250250
/// [src](https://drafts.csswg.org/css-fonts/#src-desc)

0 commit comments

Comments
 (0)