Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
81143 views
1
//.CommonJS
2
var CSSOM = {
3
CSSRule: require("./CSSRule").CSSRule
4
};
5
///CommonJS
6
7
8
/**
9
* @constructor
10
* @see http://www.w3.org/TR/css3-animations/#DOM-CSSKeyframesRule
11
*/
12
CSSOM.CSSKeyframesRule = function CSSKeyframesRule() {
13
CSSOM.CSSRule.call(this);
14
this.name = '';
15
this.cssRules = [];
16
};
17
18
CSSOM.CSSKeyframesRule.prototype = new CSSOM.CSSRule;
19
CSSOM.CSSKeyframesRule.prototype.constructor = CSSOM.CSSKeyframesRule;
20
CSSOM.CSSKeyframesRule.prototype.type = 8;
21
//FIXME
22
//CSSOM.CSSKeyframesRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;
23
//CSSOM.CSSKeyframesRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;
24
25
// http://www.opensource.apple.com/source/WebCore/WebCore-955.66.1/css/WebKitCSSKeyframesRule.cpp
26
Object.defineProperty(CSSOM.CSSKeyframesRule.prototype, "cssText", {
27
get: function() {
28
var cssTexts = [];
29
for (var i=0, length=this.cssRules.length; i < length; i++) {
30
cssTexts.push(" " + this.cssRules[i].cssText);
31
}
32
return "@" + (this._vendorPrefix || '') + "keyframes " + this.name + " { \n" + cssTexts.join("\n") + "\n}";
33
}
34
});
35
36
37
//.CommonJS
38
exports.CSSKeyframesRule = CSSOM.CSSKeyframesRule;
39
///CommonJS
40
41