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

[css3-fonts] updated CSSFontFeatureValuesRule interface

From: John Daggett <jdaggett@mozilla.com>
Date: Fri, 5 Jul 2013 00:44:03 -0700 (PDT)
To: www-style list <www-style@w3.org>
Message-ID: <17579888.1309661.1373010243371.JavaMail.zimbra@mozilla.com>

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?

John

[1] http://lists.w3.org/Archives/Public/www-style/2013Jun/0664.html
Received on Friday, 5 July 2013 07:44:30 UTC

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