source: frontend/node_modules/cssom/lib/CSSDocumentRule.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[9af201e]1//.CommonJS
2var 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 */
13CSSOM.CSSDocumentRule = function CSSDocumentRule() {
14 CSSOM.CSSRule.call(this);
15 this.matcher = new CSSOM.MatcherList();
16 this.cssRules = [];
17};
18
19CSSOM.CSSDocumentRule.prototype = new CSSOM.CSSRule();
20CSSOM.CSSDocumentRule.prototype.constructor = CSSOM.CSSDocumentRule;
21CSSOM.CSSDocumentRule.prototype.type = 10;
22//FIXME
23//CSSOM.CSSDocumentRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;
24//CSSOM.CSSDocumentRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;
25
26Object.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
38exports.CSSDocumentRule = CSSOM.CSSDocumentRule;
39///CommonJS
Note: See TracBrowser for help on using the repository browser.