W3C home > Mailing lists > Public > www-style@w3.org > April 2011

Re: [css3-animations] CSSKeyframesRule.insertRule and rule ordering

From: Dean Jackson <dino@apple.com>
Date: Sat, 02 Apr 2011 11:49:11 +1100
Cc: www-style@w3.org
Message-id: <D807A391-8240-4F13-AC46-C12F1C7A6CBA@apple.com>
To: "L. David Baron" <dbaron@dbaron.org>

On 02/04/2011, at 7:20 AM, L. David Baron wrote:

> http://dev.w3.org/csswg/css3-animations/#DOM-CSSKeyframesRule
> describes an insertRule method that says the rule is insert
> according to its key.  That doesn't really explain where the rule
> goes in the list of rules (which are in the order given in the
> sheet, which need not match key order).  It seems like to give the
> result that the spec describes for insertRule, it should always
> append the rule -- and then the keys would override the keys of any
> previously-existing rules, since
> http://dev.w3.org/csswg/css3-animations/#keyframes says:
>  # To determine the set of keyframes, all of the values in
>  # selectors are sorted in increasing order by time. If there are
>  # any duplicates, then the last keyframe specified inside the
>  # @keyframes rule will be used to provide the keyframe information
>  # for that time.
> Replacing a rule with exactly the same key seems confusing; it would
> mean you'd get the replacing behavior when appending "25%, 75%" when
> you already had a "25%, 75%", but the non-replacing behavior if you
> already had two identical rules.
> I think the simplest thing is to just append the rule -- though that
> raises the question of why the method is called insertRule rather
> than appendRule.

I'm ok with renaming to appendRule. I'm not a big fan of this API anyway. It's slow and cumbersome, and I've found little use for it (but it is all we have at the moment).

Received on Saturday, 2 April 2011 00:49:46 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:44 UTC