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

On Tue, May 28, 2013 at 8:45 PM, John Daggett <jdaggett@mozilla.com> wrote:
> This requires that the individual value definition blocks be a
> subclass of CSSRule.

Yes - call them all CSSFontFeatureValueBlockRule (whew!), with a name
and a list of descriptors.

> So then you need to define what it contains.

They contain descriptors with arbitrary user-defined names, and values
which are lists of numbers.

> And
> you really start to bend the notion of what an @-rule is, the value
> definition blocks look like @-rules but basically aren't other than
> from a syntax viewpoint.

"At-rule" is already a very wide term, which covers everything from
@charset (basically a part of the language's syntax, not really a rule
at all) to @import (directive concerning loading) to @font-face
(defines a new value for the stylesheet) to @media (limits the
applicability of contained rules).  *Everything* that's not a style
rule is an at-rule.  What I'm trying to say is, "from a syntax
standpoint" is the *only meaningful standpoint* here.  ^_^

> What does it mean if *other* CSSGroupingRule
> structs contain one of these CSSRule's?!?

You define that that's an error, which causes them to be dropped from
the rule's value.  They're only allowed within a @font-feature-values
rule.

> I think the hacky use of CSSStyleDelcaration in the original
> definition of CSSFontFaceRule in CSS2 [1] should be a cautionary tale,
> it's a bad idea to smush together objects simply because they have a
> few fields or methods that overlap.

Yes, but I don't see the relevance of that to here.  CSSGroupingRule
was defined for the sole purpose of providing the necessary APIs for
rules that contain other rules.  Subclassing it isn't hacky, it's the
intended use.

> I think it would be simpler to leave this as an empty class for now,
> remove the 'familyList' and 'valueText' fields at this level.  We can
> worry about what may or may not be useful once it's used more widely.

That's just weird, and much worse.  That means you can see the rule,
but can't tell what it is, or modify it in any way.

~TJ

Received on Wednesday, 29 May 2013 04:06:42 UTC