Skip to content

Commit 20ce0ef

Browse files
committed
[css-fonts-4] Move interface to Fonts 4, per w3c#1713
1 parent 8cf6afa commit 20ce0ef

2 files changed

Lines changed: 73 additions & 64 deletions

File tree

css-fonts-3/Fonts.src.html

Lines changed: 14 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -4396,67 +4396,6 @@ <h3 id="om-fontface">The <code>CSSFontFaceRule</code> interface</h3>
43964396
readonly attribute CSSStyleDeclaration style;
43974397
}</pre>
43984398

4399-
<h3 id="om-fontfeaturevalues">The <code>CSSFontFeatureValuesRule</code> interface</h3>
4400-
4401-
<p>The <code>CSSRule</code> interface is extended as follows:</p>
4402-
4403-
<pre class='idl'>partial interface CSSRule {
4404-
const unsigned short FONT_FEATURE_VALUES_RULE = 14;
4405-
}</pre>
4406-
4407-
<p>The <dfn>CSSFontFeatureValuesRule</dfn> interface represents a <code>@font-feature-values</code> rule.</p>
4408-
4409-
<pre class='idl'>interface CSSFontFeatureValuesRule : CSSRule {
4410-
attribute CSSOMString fontFamily;
4411-
readonly attribute CSSFontFeatureValuesMap annotation;
4412-
readonly attribute CSSFontFeatureValuesMap ornaments;
4413-
readonly attribute CSSFontFeatureValuesMap stylistic;
4414-
readonly attribute CSSFontFeatureValuesMap swash;
4415-
readonly attribute CSSFontFeatureValuesMap characterVariant;
4416-
readonly attribute CSSFontFeatureValuesMap styleset;
4417-
}
4418-
4419-
[MapClass(CSSOMString, sequence&lt;unsigned long&gt;)]
4420-
interface CSSFontFeatureValuesMap {
4421-
void set(CSSOMString featureValueName,
4422-
(unsigned long or sequence&lt;unsigned long&gt;) values);
4423-
}</pre>
4424-
4425-
<dl class='idl-attributes'>
4426-
<dt><var>fontFamily</var> of type <code>CSSOMString</code>
4427-
<dd>The list of one or more font families for which a given set of feature values is defined.</dd>
4428-
<dt>value maps of type <code>CSSFontFeatureValuesMap</code>, readonly
4429-
<dd>Maps of feature values associated with feature value names for a given 'font-variant-alternates' value type</dd>
4430-
</dl>
4431-
4432-
<p>Each value map attribute of <code>CSSFontFeatureValuesRule</code> reflects the values
4433-
defined via a corresponding <i title="feature_value_block">feature value block</i>.
4434-
Thus, the <var title="annotation attribute">annotation</var> attribute
4435-
contains the values contained within a <code title="&#64;annotation">@annotation</code>
4436-
<i title="feature_value_block">feature value block</i>, the
4437-
<var title="ornaments attribute">ornaments</var> attribute contains the
4438-
values contained with a <code title="&#64;ornaments">@ornaments</code>
4439-
<i title="feature_value_block">feature value block</i> and so forth.</p>
4440-
4441-
<p>The <code>CSSFontFeatureValuesMap</code> interface uses the
4442-
<a href="https://dev.w3.org/2006/webapi/WebIDL/#es-map-members">default map class methods</a>
4443-
but the <code>set</code> method has different behavior. It takes a sequence of unsigned integers and
4444-
associates it with a given <code>featureValueName</code>. The method
4445-
behaves the same as the default map class method
4446-
except that a single unsigned long value is treated as a sequence of a
4447-
single value. The method throws an exception if an invalid number of
4448-
values is passed in. If the associated
4449-
<i title="feature_value_block">feature value block</i>
4450-
only allows a limited number of values, the <code>set</code> method
4451-
throws an <code>InvalidAccessError</code> exception when the input
4452-
sequence to <code>set</code> contains more than the limited number of
4453-
values. See the
4454-
description of <a href="#multi-valued-feature-value-definitions">multi-valued feature value definitions</a>
4455-
for details on the maximum number of values allowed for a given type
4456-
of <i title="feature_value_block">feature value block</i>. The <code>get</code>
4457-
method always returns a sequence of values, even if the sequence only contains
4458-
a single value.</p>
4459-
44604399
<h2 id="platform-props-to-css" class="no-num">Appendix A: Mapping platform font properties to CSS properties</h2>
44614400

44624401
<em>This appendix is included as background for some of the problems and
@@ -4539,9 +4478,21 @@ <h3 class="no-num" id="recent-changes">
45394478

45404479
<ul>
45414480
<li>'font-language-override' property moved to Fonts 4</li>
4542-
<li>add omitted 'font-variant-position' values to <span title="font-variant!!property">'font-variant'</span> shorthand</li>
4481+
<li>CSSFontFeatureValuesRule interface moved to Fonts 4</li>
4482+
<li>CSSFontFaceRule interface reverted to the widely implemented one
4483+
from DOM Level 2 style</li>
4484+
<li>clarified how small-caps synthesis interacts with 'font-feature-settings'</li>
4485+
<li>all CSS keywords marked as invalid font family names</li>
4486+
<li>clarified that 'font-synthesis' is not reset by the 'font' shorthand.</li>
4487+
<li>use the phrase "installed fonts" rather than "system fonts"</li>
4488+
<li>clarified that malformed @font-face rules which lack font-family: or src: still
4489+
show up in the DOM, but don't affect font selection</li>
4490+
<li>clarified conventional ratio range for the relative sizes when they're
4491+
not modifying an absolute keyword size</li>
4492+
4493+
<li>added omitted 'font-variant-position' values to <span title="font-variant!!property">'font-variant'</span> shorthand</li>
45434494
<li>made negative values for font-size-adjust invalid, along with negative percentage font-size values</li>
4544-
<li>remove the requirement that user agents use OS/2 table subscript/superscript metrics</li>
4495+
<li>removed the requirement that user agents use OS/2 table subscript/superscript metrics</li>
45454496
<li>minor editorial cleanups</li>
45464497
</ul>
45474498

css-fonts-4/Overview.bs

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3665,7 +3665,65 @@ This definition supercedes that one.
36653665
<h3 id="om-fontfeaturevalues">
36663666
The <code>CSSFontFeatureValuesRule</code> interface</h3>
36673667

3668-
Issue: Import from level 3
3668+
<p>The <code>CSSRule</code> interface is extended as follows:</p>
3669+
3670+
<pre class='idl'>partial interface CSSRule {
3671+
const unsigned short FONT_FEATURE_VALUES_RULE = 14;
3672+
}</pre>
3673+
3674+
<p>The <dfn>CSSFontFeatureValuesRule</dfn> interface represents a <code>@font-feature-values</code> rule.</p>
3675+
3676+
<pre class='idl'>interface CSSFontFeatureValuesRule : CSSRule {
3677+
attribute CSSOMString fontFamily;
3678+
readonly attribute CSSFontFeatureValuesMap annotation;
3679+
readonly attribute CSSFontFeatureValuesMap ornaments;
3680+
readonly attribute CSSFontFeatureValuesMap stylistic;
3681+
readonly attribute CSSFontFeatureValuesMap swash;
3682+
readonly attribute CSSFontFeatureValuesMap characterVariant;
3683+
readonly attribute CSSFontFeatureValuesMap styleset;
3684+
}
3685+
3686+
[MapClass(CSSOMString, sequence&lt;unsigned long&gt;)]
3687+
interface CSSFontFeatureValuesMap {
3688+
void set(CSSOMString featureValueName,
3689+
(unsigned long or sequence&lt;unsigned long&gt;) values);
3690+
}</pre>
3691+
3692+
<dl class='idl-attributes'>
3693+
<dt><var>fontFamily</var> of type <code>CSSOMString</code>
3694+
<dd>The list of one or more font families for which a given set of feature values is defined.</dd>
3695+
<dt>value maps of type <code>CSSFontFeatureValuesMap</code>, readonly
3696+
<dd>Maps of feature values associated with feature value names for a given 'font-variant-alternates' value type</dd>
3697+
</dl>
3698+
3699+
Each value map attribute of <code>CSSFontFeatureValuesRule</code> reflects the values
3700+
defined via a corresponding <i title="feature_value_block">feature value block</i>.
3701+
Thus, the <var title="annotation attribute">annotation</var> attribute
3702+
contains the values contained within a <code title="&#64;annotation">@annotation</code>
3703+
<i title="feature_value_block">feature value block</i>, the
3704+
<var title="ornaments attribute">ornaments</var> attribute contains the
3705+
values contained with a <code title="&#64;ornaments">@ornaments</code>
3706+
<i title="feature_value_block">feature value block</i> and so forth.
3707+
3708+
The <code>CSSFontFeatureValuesMap</code> interface uses the
3709+
<a href="https://dev.w3.org/2006/webapi/WebIDL/#es-map-members">default map class methods</a>
3710+
but the <code>set</code> method has different behavior. It takes a sequence of unsigned integers and
3711+
associates it with a given <code>featureValueName</code>. The method
3712+
behaves the same as the default map class method
3713+
except that a single unsigned long value is treated as a sequence of a
3714+
single value. The method throws an exception if an invalid number of
3715+
values is passed in. If the associated
3716+
<i title="feature_value_block">feature value block</i>
3717+
only allows a limited number of values, the <code>set</code> method
3718+
throws an <code>InvalidAccessError</code> exception when the input
3719+
sequence to <code>set</code> contains more than the limited number of
3720+
values. See the
3721+
description of <a href="#multi-valued-feature-value-definitions">multi-valued feature value definitions</a>
3722+
for details on the maximum number of values allowed for a given type
3723+
of <i title="feature_value_block">feature value block</i>. The <code>get</code>
3724+
method always returns a sequence of values, even if the sequence only contains
3725+
a single value.
3726+
36693727

36703728
<h2 id="platform-props-to-css" class="no-num">
36713729
Appendix A: Mapping platform font properties to CSS properties</h2>

0 commit comments

Comments
 (0)