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

[css3-animations] CSSKeyframesRule.insertRule and rule ordering

From: L. David Baron <dbaron@dbaron.org>
Date: Fri, 1 Apr 2011 13:20:05 -0700
To: www-style@w3.org
Message-ID: <20110401202005.GA19549@pickering.dbaron.org>
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.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Friday, 1 April 2011 20:20:34 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:39 GMT