Re: [css3-fonts][cssom] CSSFontFeatureValuesRule vs. CSSKeyframesRule

John Daggett wrote:
> Based on a brief discussion with Cam regarding the new [MapClass]
> thingy in WebIDL, I put together this first attempt at the sort of
> CSSFontFeatureValuesRule definition Tab was asking for:
>
>    [MapClass(DOMString, long)]
>    interface FontFeatureMapSingle {
>      long get(DOMString valueName);
>      boolean has(DOMString valueName);
>      void set(DOMString valueName, long value);
>      boolean delete(DOMString valueName);
>    }
>
>    [MapClass(DOMString, sequence<long>)]
>    interface FontFeatureMapMulti {
>      sequence<long>  get(DOMString valueName);
>      boolean has(DOMString valueName);
>      void set(DOMString valueName, sequence<long>  values);
>      boolean delete(DOMString valueName);
>    }

I don't think we need the custom versions of has, set and delete.  The 
default versions of these should be fine.

> The 'styleset' and 'character-variant' values for
> 'font-variant-alternates' take *multiple* values, while the other
> values only use a single value.  Thus the map associated with each of
> these values reflects that.

(I think either that, or having a single FontFeatureMap that takes (long 
or sequence<long>) values and does checking in prose, would be fine.)

> The error handling here is a bit tricky (dodgy?).  For the
> 'character-variant' value only two values are permitted, so what
> should happen with 'rule.characterVariant.set("blah", [1, 2, 3])'?

I think it should throw in prose.  Maybe InvalidAccessError is the 
closest exception type for this kind of error.

Otherwise, looks good.

Received on Tuesday, 2 July 2013 09:06:18 UTC