Skip to content

Commit 11aef64

Browse files
authored
[css-font-loading] Add support for the new terminology and alias the old (#14197)
1 parent 553385d commit 11aef64

1 file changed

Lines changed: 25 additions & 21 deletions

File tree

css-font-loading-3/Overview.bs

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ The <code>FontFace</code> Interface</h2>
8585
dictionary FontFaceDescriptors {
8686
CSSOMString style = "normal";
8787
CSSOMString weight = "normal";
88-
CSSOMString stretch = "normal";
88+
CSSOMString width;
89+
CSSOMString stretch = "normal"; // alias for width, sets the same attribute
8990
CSSOMString unicodeRange = "U+0-10FFFF";
9091
CSSOMString featureSettings = "normal";
9192
CSSOMString variationSettings = "normal";
@@ -99,25 +100,26 @@ The <code>FontFace</code> Interface</h2>
99100

100101
[Exposed=(Window,Worker)]
101102
interface FontFace {
102-
constructor(CSSOMString family, (CSSOMString or BufferSource) source,
103-
optional FontFaceDescriptors descriptors = {});
104-
attribute CSSOMString family;
105-
attribute CSSOMString style;
106-
attribute CSSOMString weight;
107-
attribute CSSOMString stretch;
108-
attribute CSSOMString unicodeRange;
109-
attribute CSSOMString featureSettings;
110-
attribute CSSOMString variationSettings;
111-
attribute CSSOMString display;
112-
attribute CSSOMString ascentOverride;
113-
attribute CSSOMString descentOverride;
114-
attribute CSSOMString lineGapOverride;
115-
116-
readonly attribute FontFaceLoadStatus status;
117-
118-
Promise<FontFace> load();
119-
readonly attribute Promise<FontFace> loaded;
120-
};
103+
[Throws]
104+
constructor(CSSOMString family,
105+
(CSSOMString or BufferSource) source,
106+
optional FontFaceDescriptors descriptors = {});
107+
108+
[SetterThrows] attribute CSSOMString family;
109+
[SetterThrows] attribute CSSOMString style;
110+
[SetterThrows] attribute CSSOMString weight;
111+
[SetterThrows, BindingAlias="stretch"] attribute CSSOMString width;
112+
[SetterThrows] attribute CSSOMString unicodeRange;
113+
[SetterThrows] attribute CSSOMString variant;
114+
[SetterThrows] attribute CSSOMString featureSettings;
115+
[SetterThrows, Pref="layout.css.font-variations.enabled"] attribute CSSOMString variationSettings;
116+
[SetterThrows] attribute CSSOMString display;
117+
[SetterThrows] attribute CSSOMString ascentOverride;
118+
[SetterThrows] attribute CSSOMString descentOverride;
119+
[SetterThrows] attribute CSSOMString lineGapOverride;
120+
[SetterThrows] attribute CSSOMString sizeAdjust;
121+
122+
readonly attribute FontFaceLoadStatus status;
121123
</xmp>
122124

123125
<wpt>
@@ -134,6 +136,7 @@ The <code>FontFace</code> Interface</h2>
134136
: <dfn>family</dfn>
135137
: <dfn>style</dfn>
136138
: <dfn>weight</dfn>
139+
: <dfn>width</dfn>
137140
: <dfn>stretch</dfn>
138141
: <dfn>unicodeRange</dfn>
139142
::
@@ -154,6 +157,7 @@ The <code>FontFace</code> Interface</h2>
154157
throw a {{SyntaxError}};
155158
otherwise, set the attribute to the serialization of the parsed value.
156159

160+
Note that ''stretch'' is a legacy name alias of ''width'' and therefore they set the same attribute.
157161
: <dfn>featureSettings</dfn>
158162
: <dfn>variationSettings</dfn>
159163
: <dfn>display</dfn>
@@ -416,7 +420,7 @@ Interaction with CSS’s ''@font-face'' Rule</h3>
416420
This {{FontFace}} object is <dfn>CSS-connected</dfn>.
417421

418422
The {{FontFace}} object corresponding to a ''@font-face'' rule
419-
has its {{FontFace/family}}, {{FontFace/style}}, {{FontFace/weight}}, {{FontFace/stretch}}, {{FontFace/unicodeRange}}, {{FontFace/variant}}, and {{FontFace/featureSettings}} attributes
423+
has its {{FontFace/family}}, {{FontFace/style}}, {{FontFace/weight}}, {{FontFace/width}}, {{FontFace/unicodeRange}}, {{FontFace/variant}}, and {{FontFace/featureSettings}} attributes
420424
set to the same value as the corresponding descriptors in the ''@font-face'' rule.
421425
There is a two-way connection between the two:
422426
any change made to a ''@font-face'' descriptor is immediately reflected in the corresponding {{FontFace}} attribute,

0 commit comments

Comments
 (0)