Re: [css3-fonts] updated CSSFontFeatureValuesRule interface

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