1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | var Atrule = require('./atrule');
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | var Keyframes = module.exports = function Keyframes(segs, prefix){
|
24 | Atrule.call(this, 'keyframes');
|
25 | this.segments = segs;
|
26 | this.prefix = prefix || 'official';
|
27 | };
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | Keyframes.prototype.__proto__ = Atrule.prototype;
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | Keyframes.prototype.clone = function(parent){
|
43 | var clone = new Keyframes;
|
44 | clone.lineno = this.lineno;
|
45 | clone.column = this.column;
|
46 | clone.filename = this.filename;
|
47 | clone.segments = this.segments.map(function(node) { return node.clone(parent, clone); });
|
48 | clone.prefix = this.prefix;
|
49 | clone.block = this.block.clone(parent, clone);
|
50 | return clone;
|
51 | };
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 | Keyframes.prototype.toJSON = function(){
|
61 | return {
|
62 | __type: 'Keyframes',
|
63 | segments: this.segments,
|
64 | prefix: this.prefix,
|
65 | block: this.block,
|
66 | lineno: this.lineno,
|
67 | column: this.column,
|
68 | filename: this.filename
|
69 | };
|
70 | };
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 | Keyframes.prototype.toString = function(){
|
80 | return '@keyframes ' + this.segments.join('');
|
81 | };
|