Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
81143 views
1
//.CommonJS
2
var CSSOM = {
3
CSSRule: require("./CSSRule").CSSRule,
4
MatcherList: require("./MatcherList").MatcherList
5
};
6
///CommonJS
7
8
9
/**
10
* @constructor
11
* @see https://developer.mozilla.org/en/CSS/@-moz-document
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
//FIXME
23
//CSSOM.CSSDocumentRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;
24
//CSSOM.CSSDocumentRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;
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
//.CommonJS
38
exports.CSSDocumentRule = CSSOM.CSSDocumentRule;
39
///CommonJS
40
41