1 |
|
2 | var CSSOM = {
|
3 | CSSRule: require("./CSSRule").CSSRule,
|
4 | MatcherList: require("./MatcherList").MatcherList
|
5 | };
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | CSSOM.CSSDocumentRule = function CSSDocumentRule() {
|
14 | CSSOM.CSSRule.call(this);
|
15 | this.matcher = new CSSOM.MatcherList();
|
16 | this.cssRules = [];
|
17 | };
|
18 |
|
19 | CSSOM.CSSDocumentRule.prototype = new CSSOM.CSSRule();
|
20 | CSSOM.CSSDocumentRule.prototype.constructor = CSSOM.CSSDocumentRule;
|
21 | CSSOM.CSSDocumentRule.prototype.type = 10;
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | Object.defineProperty(CSSOM.CSSDocumentRule.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 "@-moz-document " + this.matcher.matcherText + " {" + cssTexts.join("") + "}";
|
33 | }
|
34 | });
|
35 |
|
36 |
|
37 |
|
38 | exports.CSSDocumentRule = CSSOM.CSSDocumentRule;
|
39 |
|