Bug 841896: Rename CSSKeyframesRule.insertRule to appendRule to match spec change.

Note that this does not change the IID of nsIDOMMozCSSKeyframesRule
since neither the method signature nor semantics have changed; only the
name is different.
This commit is contained in:
L. David Baron 2013-02-15 21:38:34 -08:00
parent f3cff43ce7
commit 27b5ab689a
5 changed files with 12 additions and 12 deletions

View File

@ -11,7 +11,7 @@ interface nsIDOMMozCSSKeyframesRule : nsIDOMCSSRule
attribute DOMString name;
readonly attribute nsIDOMCSSRuleList cssRules;
void insertRule(in DOMString rule);
void appendRule(in DOMString rule);
void deleteRule(in DOMString key);
nsIDOMMozCSSKeyframeRule findRule(in DOMString key);
};

View File

@ -2315,7 +2315,7 @@ nsCSSKeyframesRule::GetCssRules(nsIDOMCSSRuleList* *aRuleList)
}
NS_IMETHODIMP
nsCSSKeyframesRule::InsertRule(const nsAString& aRule)
nsCSSKeyframesRule::AppendRule(const nsAString& aRule)
{
// The spec is confusing, and I think we should just append the rule,
// which also turns out to match WebKit:

View File

@ -29,7 +29,7 @@ var keyframesRule = rules[0];
var keyframeRules = keyframesRule.cssRules;
is(keyframeRules.length, 0, "Should have no keyframe rules yet");
keyframesRule.insertRule('0% { }');
keyframesRule.appendRule('0% { }');
is(keyframeRules.length, 1, "Should have a keyframe rule now");
var keyframeRule = keyframeRules[0];
is(keyframeRule.parentRule, keyframesRule,

View File

@ -119,14 +119,14 @@ bounce.deleteRule("75% ,85%");
is(bounce.cssRules.length, 3, "deleteRule should match keys in order, parsed");
bounce.deleteRule("0%");
is(bounce.cssRules.length, 2, "deleteRule should match keys in order, parsed");
bounce.insertRule("from { color: blue }");
is(bounce.cssRules.length, 3, "insertRule should append");
is(bounce.cssRules[2].keyText, "0%", "insertRule should append");
bounce.insertRule("from { color: blue }");
is(bounce.cssRules.length, 4, "insertRule should append");
is(bounce.cssRules[3].keyText, "0%", "insertRule should append");
bounce.insertRule("from { color: blue } to { color: green }");
is(bounce.cssRules.length, 4, "insertRule should ignore garbage at end");
bounce.appendRule("from { color: blue }");
is(bounce.cssRules.length, 3, "appendRule should append");
is(bounce.cssRules[2].keyText, "0%", "appendRule should append");
bounce.appendRule("from { color: blue }");
is(bounce.cssRules.length, 4, "appendRule should append");
is(bounce.cssRules[3].keyText, "0%", "appendRule should append");
bounce.appendRule("from { color: blue } to { color: green }");
is(bounce.cssRules.length, 4, "appendRule should ignore garbage at end");
</script>
</pre>

View File

@ -102,7 +102,7 @@ try {
} catch(ex) {}
rule = make_rule_and_remove_sheet("@keyframes a { from { color: blue } }");
rule.insertRule("from { color: fuchsia}");
rule.appendRule("from { color: fuchsia}");
rule.deleteRule("from");
rule.name = "b";
rule.cssRules[0].keyText = "50%";