The spec currently defines this DOMString argument[1] thus:
# The key must resolve to a number between 0 and 1, or the rule is ignored.
If it meant to say 10% ought to be passed in as '0.1' it is an interesting
inconsistency since CSSKeyframeRule.keyText is defined as a list of percentage
values i.e. one couldn't extract a key out of it and use it to delete a rule.
Both Gecko and WebKit expect a percentage value; IE10 followed the spec literally
and expects '0.1' for the 10% rule.
IE, Firefox and Chrome agree to treat they key as single-valued. Comma-separated or
space-separated lists fail. The same browsers also agree to map 0% to the specified
'from' rule, and 100% to 'to'. Likewise, Gecko and WebKit map a 'from' key to the
specified 0% rule and 'to' to 100%. IE10 only maps only from numeric selector to
keyword but not the other way.
I propose we define the key argument for findRule and deleteRule to:
1. Contain a single value
2. The value must be one of: a percentage value, 'from' or 'to'
3. 'from' is treated as equivalent to '0% and vice-versa; 'to' as equivalent to '100%' and
vice-versa
#1 does imply that one can't blindly pass CSSKeyframeRule.keyText to
CSSKeyframesRule.findRule/deleteRule and retrieve the same object. Supporting this pattern
may, however, require findRule() to be able to return more than one CSSKeyframeRule.
Thoughts?
Note: this is currently tracked by bug 14788[2].
[1] http://dev.w3.org/csswg/css3-animations/#CSSKeyframesRules-deleteRule
[2] https://www.w3.org/Bugs/Public/show_bug.cgi?id=14788