Skip to content

Commit 91c33eb

Browse files
committed
Limit the length of names
Shorten two CSS function features, the longest of which was 56 characters long. The remaining names that list function names consists of 3 functions or less. The longest remaining name is 43 characters long: ARIA attribute reflection (initial support)
1 parent eb84289 commit 91c33eb

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

feature-group-definitions/exp-functions.dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Generated from: exp-functions.yml
22
# Do not edit this file by hand. Edit the source file instead!
33

4-
name: pow(), sqrt(), hypot(), log(), and exp()
4+
name: Exponential functions
55
description: The `pow()`, `sqrt()`, `hypot()`, `log()`, and `exp()` CSS functions compute various exponential functions.
66
spec: https://drafts.csswg.org/css-values-4/#exponent-funcs
77
status:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
name: pow(), sqrt(), hypot(), log(), and exp()
1+
name: Exponential functions
22
description: The `pow()`, `sqrt()`, `hypot()`, `log()`, and `exp()` CSS functions compute various exponential functions.
33
spec: https://drafts.csswg.org/css-values-4/#exponent-funcs

feature-group-definitions/trig-functions.dist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Generated from: trig-functions.yml
22
# Do not edit this file by hand. Edit the source file instead!
33

4-
name: sin(), cos(), tan(), asin(), acos(), atan(), and atan2()
4+
name: Trigonometric functions
55
description: The `sin()`, `cos()`, `tan()`, `asin()`, `acos()`, `atan()`, and `atan2()` CSS functions compute various trigonometric functions.
66
spec: https://drafts.csswg.org/css-values-4/#trig-funcs
77
status:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
name: sin(), cos(), tan(), asin(), acos(), atan(), and atan2()
1+
name: Trigonometric functions
22
description: The `sin()`, `cos()`, `tan()`, `asin()`, `acos()`, `atan()`, and `atan2()` CSS functions compute various trigonometric functions.
33
spec: https://drafts.csswg.org/css-values-4/#trig-funcs

index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import { Temporal } from '@js-temporal/polyfill';
88

99
import { BASELINE_LOW_TO_HIGH_DURATION } from 'compute-baseline';
1010

11+
// The longest name allowed, to allow for compact display.
12+
const nameMaxLength = 50;
13+
1114
// The longest description allowed, to avoid them growing into documentation.
1215
const descriptionMaxLength = 300;
1316

@@ -106,9 +109,12 @@ for (const [key, data] of yamlEntries('feature-group-definitions')) {
106109
throw new Error(`description is missing from ${key}.yml`);
107110
}
108111

109-
// Ensure description is not too long.
112+
// Ensure name and description are not too long.
113+
if (data.name?.length > nameMaxLength) {
114+
throw new Error(`name in ${key}.yml is too long, ${data.name.length} characters. The maximum allowed length is ${nameMaxLength}.`);
115+
}
110116
if (data.description?.length > descriptionMaxLength) {
111-
throw new Error(`description in ${key}.yml is too long, ${data.description.length} characters. The maximum allowed length is ${descriptionMaxLength}.`)
117+
throw new Error(`description in ${key}.yml is too long, ${data.description.length} characters. The maximum allowed length is ${descriptionMaxLength}.`);
112118
}
113119

114120
// Ensure that only known group and snapshot identifiers are used.

0 commit comments

Comments
 (0)