Skip to content

Commit b5c4bcd

Browse files
fix: FontFace and FontFaceDescriptors type (#1423)
Co-authored-by: saschanaz <[email protected]>
1 parent 2d3a963 commit b5c4bcd

File tree

7 files changed

+55
-13
lines changed

7 files changed

+55
-13
lines changed

baselines/dom.generated.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,11 @@ interface FocusOptions {
487487
}
488488

489489
interface FontFaceDescriptors {
490-
display?: string;
490+
ascentOverride?: string;
491+
descentOverride?: string;
492+
display?: FontDisplay;
491493
featureSettings?: string;
494+
lineGapOverride?: string;
492495
stretch?: string;
493496
style?: string;
494497
unicodeRange?: string;
@@ -5479,7 +5482,7 @@ declare var FocusEvent: {
54795482
interface FontFace {
54805483
ascentOverride: string;
54815484
descentOverride: string;
5482-
display: string;
5485+
display: FontDisplay;
54835486
family: string;
54845487
featureSettings: string;
54855488
lineGapOverride: string;
@@ -18371,6 +18374,7 @@ type EndOfStreamError = "decode" | "network";
1837118374
type EndingType = "native" | "transparent";
1837218375
type FileSystemHandleKind = "directory" | "file";
1837318376
type FillMode = "auto" | "backwards" | "both" | "forwards" | "none";
18377+
type FontDisplay = "auto" | "block" | "fallback" | "optional" | "swap";
1837418378
type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded";
1837518379
type FontFaceSetLoadStatus = "loaded" | "loading";
1837618380
type FullscreenNavigationUI = "auto" | "hide" | "show";

baselines/serviceworker.generated.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,11 @@ interface FileSystemRemoveOptions {
203203
}
204204

205205
interface FontFaceDescriptors {
206-
display?: string;
206+
ascentOverride?: string;
207+
descentOverride?: string;
208+
display?: FontDisplay;
207209
featureSettings?: string;
210+
lineGapOverride?: string;
208211
stretch?: string;
209212
style?: string;
210213
unicodeRange?: string;
@@ -1683,7 +1686,7 @@ declare var FileSystemHandle: {
16831686
interface FontFace {
16841687
ascentOverride: string;
16851688
descentOverride: string;
1686-
display: string;
1689+
display: FontDisplay;
16871690
family: string;
16881691
featureSettings: string;
16891692
lineGapOverride: string;
@@ -5820,6 +5823,7 @@ type ColorSpaceConversion = "default" | "none";
58205823
type DocumentVisibilityState = "hidden" | "visible";
58215824
type EndingType = "native" | "transparent";
58225825
type FileSystemHandleKind = "directory" | "file";
5826+
type FontDisplay = "auto" | "block" | "fallback" | "optional" | "swap";
58235827
type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded";
58245828
type FontFaceSetLoadStatus = "loaded" | "loading";
58255829
type FrameType = "auxiliary" | "nested" | "none" | "top-level";

baselines/sharedworker.generated.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,11 @@ interface FileSystemRemoveOptions {
178178
}
179179

180180
interface FontFaceDescriptors {
181-
display?: string;
181+
ascentOverride?: string;
182+
descentOverride?: string;
183+
display?: FontDisplay;
182184
featureSettings?: string;
185+
lineGapOverride?: string;
183186
stretch?: string;
184187
style?: string;
185188
unicodeRange?: string;
@@ -1602,7 +1605,7 @@ declare var FileSystemHandle: {
16021605
interface FontFace {
16031606
ascentOverride: string;
16041607
descentOverride: string;
1605-
display: string;
1608+
display: FontDisplay;
16061609
family: string;
16071610
featureSettings: string;
16081611
lineGapOverride: string;
@@ -5829,6 +5832,7 @@ type ColorGamut = "p3" | "rec2020" | "srgb";
58295832
type ColorSpaceConversion = "default" | "none";
58305833
type EndingType = "native" | "transparent";
58315834
type FileSystemHandleKind = "directory" | "file";
5835+
type FontDisplay = "auto" | "block" | "fallback" | "optional" | "swap";
58325836
type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded";
58335837
type FontFaceSetLoadStatus = "loaded" | "loading";
58345838
type GlobalCompositeOperation = "color" | "color-burn" | "color-dodge" | "copy" | "darken" | "destination-atop" | "destination-in" | "destination-out" | "destination-over" | "difference" | "exclusion" | "hard-light" | "hue" | "lighten" | "lighter" | "luminosity" | "multiply" | "overlay" | "saturation" | "screen" | "soft-light" | "source-atop" | "source-in" | "source-out" | "source-over" | "xor";

baselines/webworker.generated.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,11 @@ interface FileSystemRemoveOptions {
207207
}
208208

209209
interface FontFaceDescriptors {
210-
display?: string;
210+
ascentOverride?: string;
211+
descentOverride?: string;
212+
display?: FontDisplay;
211213
featureSettings?: string;
214+
lineGapOverride?: string;
212215
stretch?: string;
213216
style?: string;
214217
unicodeRange?: string;
@@ -1778,7 +1781,7 @@ declare var FileSystemSyncAccessHandle: {
17781781
interface FontFace {
17791782
ascentOverride: string;
17801783
descentOverride: string;
1781-
display: string;
1784+
display: FontDisplay;
17821785
family: string;
17831786
featureSettings: string;
17841787
lineGapOverride: string;
@@ -6144,6 +6147,7 @@ type ColorSpaceConversion = "default" | "none";
61446147
type DocumentVisibilityState = "hidden" | "visible";
61456148
type EndingType = "native" | "transparent";
61466149
type FileSystemHandleKind = "directory" | "file";
6150+
type FontDisplay = "auto" | "block" | "fallback" | "optional" | "swap";
61476151
type FontFaceLoadStatus = "error" | "loaded" | "loading" | "unloaded";
61486152
type FontFaceSetLoadStatus = "loaded" | "loading";
61496153
type FrameType = "auxiliary" | "nested" | "none" | "top-level";

inputfiles/addedTypes.jsonc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,17 @@
282282
"afterend"
283283
]
284284
},
285+
"FontDisplay": {
286+
"name": "FontDisplay",
287+
// https://w3c.github.io/csswg-drafts/css-fonts-4/#font-display-desc
288+
"value": [
289+
"auto",
290+
"block",
291+
"swap",
292+
"fallback",
293+
"optional"
294+
]
295+
},
285296
"ClientType": {
286297
"name": "ClientTypes"
287298
},

inputfiles/overridingTypes.jsonc

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,15 @@
12471247
}
12481248
]
12491249
},
1250+
"FontFace": {
1251+
"properties": {
1252+
"property": {
1253+
"display": {
1254+
"type": "FontDisplay"
1255+
}
1256+
}
1257+
}
1258+
},
12501259
"HTMLFrameSetElement": {
12511260
"element": [
12521261
{
@@ -3009,7 +3018,16 @@
30093018
}
30103019
},
30113020
"dictionaries": {
3012-
"dictionary": {
3021+
"dictionary": {
3022+
"FontFaceDescriptors": {
3023+
"members": {
3024+
"member": {
3025+
"display":{
3026+
"type": "FontDisplay"
3027+
}
3028+
}
3029+
}
3030+
},
30133031
// https://github.com/microsoft/TypeScript/issues/46036
30143032
"CryptoKeyPair": {
30153033
"members": {

inputfiles/removedTypes.jsonc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,7 @@
250250
"FontFaceDescriptors": {
251251
"members": {
252252
"member": {
253-
"ascentOverride": null,
254-
"descentOverride": null,
255-
"lineGapOverride": null,
256-
"variationSettings": null
253+
"variationSettings": null // Gecko-only as of 2022-10
257254
}
258255
}
259256
},

0 commit comments

Comments
 (0)