W3C home > Mailing lists > Public > www-style@w3.org > July 2013

Re: [css3-fonts] updated CSSFontFeatureValuesRule interface

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Sat, 6 Jul 2013 01:06:39 -0700
Message-ID: <CAAWBYDAnB06vS7Wfz4v-NWSC1FMvgbWjdK+j6O5VcWo+3DS-jQ@mail.gmail.com>
To: John Daggett <jdaggett@mozilla.com>
Cc: www-style list <www-style@w3.org>
On Fri, Jul 5, 2013 at 12:44 AM, John Daggett <jdaggett@mozilla.com> wrote:
>
> Based on feedback from Tab and Cam, I've updated the interface definition of CSSFontFeatureValuesRule.  It's close to the previous proposal Tab made [1]:
>
> http://dev.w3.org/csswg/css-fonts/#om-fontfeaturevalues
>
> interface CSSFontFeatureValuesRule : CSSRule {
>   attribute DOMString fontFamily;
>   readonly attribute CSSFontFeatureValuesMap annotation;
>   readonly attribute CSSFontFeatureValuesMap ornaments;
>   readonly attribute CSSFontFeatureValuesMap stylistic;
>   readonly attribute CSSFontFeatureValuesMap swash;
>   readonly attribute CSSFontFeatureValuesMap characterVariant;
>   readonly attribute CSSFontFeatureValuesMap styleset;
> }
>
> [MapClass(DOMString, sequence<unsigned long>)]
> interface CSSFontFeatureValuesMap {
>   void set(DOMString featureValueName,
>            (unsigned long or sequence<unsigned long>) values);
> }
>
> The gobbledygook in the set method is to allow the set method
> to be called either with a single value or with an array.  The
> custom set method will check the number of values passed in and
> throw an error when the count is invalid.  The get method always
> returns an array of values, whether it's single-valued or not.
>
> Examples:
>
>   rule.swash.set("swishy", 2);
>   rule.swash.set("flowing", [3]);
>   rule.swash.set("toomany", [1, 3]);  /* invalid - only a single value permitted for swash */
>
>   rule.characterVariant.set("alpha-1", 3);
>   rule.characterVariant.set("alpha-3", [3, 3]);
>   rule.characterVariant.set("toomany", [3, 3, 4]);  /* invalid - max two values allowed for character-variant */
>   rule.styleset.set("sitedefaults", [3, 7, 13]);
>
> Comments, thoughts, sweet aphorisms?

+1, ship it.

~TJ
Received on Saturday, 6 July 2013 08:07:26 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:32 UTC