stylus-source 0.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. data/.DS_Store +0 -0
  2. data/README.md +3 -0
  3. data/lib/.DS_Store +0 -0
  4. data/lib/node_modules/cssom/.idea/CSSOM.iml +9 -0
  5. data/lib/node_modules/cssom/.idea/dictionaries/nv.xml +3 -0
  6. data/lib/node_modules/cssom/.idea/encodings.xml +5 -0
  7. data/lib/node_modules/cssom/.idea/misc.xml +17 -0
  8. data/lib/node_modules/cssom/.idea/modules.xml +9 -0
  9. data/lib/node_modules/cssom/.idea/projectCodeStyle.xml +82 -0
  10. data/lib/node_modules/cssom/.idea/vcs.xml +8 -0
  11. data/lib/node_modules/cssom/.idea/workspace.xml +467 -0
  12. data/lib/node_modules/cssom/.livereload +19 -0
  13. data/lib/node_modules/cssom/Jakefile +37 -0
  14. data/lib/node_modules/cssom/README.mdown +33 -0
  15. data/lib/node_modules/cssom/Rakefile +23 -0
  16. data/lib/node_modules/cssom/docs/.livereload +19 -0
  17. data/lib/node_modules/cssom/docs/bar.css +3 -0
  18. data/lib/node_modules/cssom/docs/demo.css +0 -0
  19. data/lib/node_modules/cssom/docs/foo.css +4 -0
  20. data/lib/node_modules/cssom/docs/parse.html +170 -0
  21. data/lib/node_modules/cssom/docs/parse2.html +431 -0
  22. data/lib/node_modules/cssom/index.html +100 -0
  23. data/lib/node_modules/cssom/lib/CSSImportRule.js +34 -0
  24. data/lib/node_modules/cssom/lib/CSSMediaRule.js +38 -0
  25. data/lib/node_modules/cssom/lib/CSSOM.js +3 -0
  26. data/lib/node_modules/cssom/lib/CSSRule.js +38 -0
  27. data/lib/node_modules/cssom/lib/CSSStyleDeclaration.js +130 -0
  28. data/lib/node_modules/cssom/lib/CSSStyleRule.js +187 -0
  29. data/lib/node_modules/cssom/lib/CSSStyleSheet.js +85 -0
  30. data/lib/node_modules/cssom/lib/MediaList.js +61 -0
  31. data/lib/node_modules/cssom/lib/StyleSheet.js +15 -0
  32. data/lib/node_modules/cssom/lib/clone.js +69 -0
  33. data/lib/node_modules/cssom/lib/index.js +10 -0
  34. data/lib/node_modules/cssom/lib/parse.js +195 -0
  35. data/lib/node_modules/cssom/media.html +17 -0
  36. data/lib/node_modules/cssom/package.json +30 -0
  37. data/lib/node_modules/cssom/plugins/toHTML.js +32 -0
  38. data/lib/node_modules/cssom/server/index.html +22 -0
  39. data/lib/node_modules/cssom/server/index.js +21 -0
  40. data/lib/node_modules/cssom/shorthands.html +21 -0
  41. data/lib/node_modules/cssom/test/CSSStyleDeclaration.test.js +35 -0
  42. data/lib/node_modules/cssom/test/CSSStyleRule.test.js +12 -0
  43. data/lib/node_modules/cssom/test/CSSStyleSheet.test.js +16 -0
  44. data/lib/node_modules/cssom/test/MediaList.test.js +21 -0
  45. data/lib/node_modules/cssom/test/clone.test.js +38 -0
  46. data/lib/node_modules/cssom/test/fixtures/dummy.css +3 -0
  47. data/lib/node_modules/cssom/test/helper.js +97 -0
  48. data/lib/node_modules/cssom/test/index.html +42 -0
  49. data/lib/node_modules/cssom/test/parse.test.js +346 -0
  50. data/lib/node_modules/cssom/test/vendor/qunit.css +189 -0
  51. data/lib/node_modules/cssom/test/vendor/qunit.js +1341 -0
  52. data/lib/node_modules/growl/History.md +16 -0
  53. data/lib/node_modules/growl/Readme.md +74 -0
  54. data/lib/node_modules/growl/lib/growl.js +82 -0
  55. data/lib/node_modules/growl/package.json +6 -0
  56. data/lib/node_modules/growl/test.js +17 -0
  57. data/lib/stylus/colors.js +156 -0
  58. data/lib/stylus/convert/css.js +130 -0
  59. data/lib/stylus/errors.js +58 -0
  60. data/lib/stylus/functions/image.js +120 -0
  61. data/lib/stylus/functions/index.js +722 -0
  62. data/lib/stylus/functions/index.styl +123 -0
  63. data/lib/stylus/functions/url.js +98 -0
  64. data/lib/stylus/lexer.js +728 -0
  65. data/lib/stylus/middleware.js +223 -0
  66. data/lib/stylus/nodes/arguments.js +65 -0
  67. data/lib/stylus/nodes/binop.js +54 -0
  68. data/lib/stylus/nodes/block.js +99 -0
  69. data/lib/stylus/nodes/boolean.js +103 -0
  70. data/lib/stylus/nodes/call.js +57 -0
  71. data/lib/stylus/nodes/charset.js +42 -0
  72. data/lib/stylus/nodes/comment.js +32 -0
  73. data/lib/stylus/nodes/each.js +56 -0
  74. data/lib/stylus/nodes/expression.js +168 -0
  75. data/lib/stylus/nodes/fontface.js +55 -0
  76. data/lib/stylus/nodes/function.js +104 -0
  77. data/lib/stylus/nodes/group.js +79 -0
  78. data/lib/stylus/nodes/hsla.js +256 -0
  79. data/lib/stylus/nodes/ident.js +127 -0
  80. data/lib/stylus/nodes/if.js +55 -0
  81. data/lib/stylus/nodes/import.js +30 -0
  82. data/lib/stylus/nodes/index.js +52 -0
  83. data/lib/stylus/nodes/jsliteral.js +32 -0
  84. data/lib/stylus/nodes/keyframes.js +78 -0
  85. data/lib/stylus/nodes/literal.js +92 -0
  86. data/lib/stylus/nodes/media.js +42 -0
  87. data/lib/stylus/nodes/node.js +209 -0
  88. data/lib/stylus/nodes/null.js +72 -0
  89. data/lib/stylus/nodes/page.js +43 -0
  90. data/lib/stylus/nodes/params.js +72 -0
  91. data/lib/stylus/nodes/property.js +72 -0
  92. data/lib/stylus/nodes/return.js +44 -0
  93. data/lib/stylus/nodes/rgba.js +335 -0
  94. data/lib/stylus/nodes/root.js +50 -0
  95. data/lib/stylus/nodes/selector.js +57 -0
  96. data/lib/stylus/nodes/string.js +120 -0
  97. data/lib/stylus/nodes/ternary.js +51 -0
  98. data/lib/stylus/nodes/unaryop.js +46 -0
  99. data/lib/stylus/nodes/unit.js +207 -0
  100. data/lib/stylus/parser.js +1514 -0
  101. data/lib/stylus/renderer.js +157 -0
  102. data/lib/stylus/source.rb +7 -0
  103. data/lib/stylus/stack/frame.js +66 -0
  104. data/lib/stylus/stack/index.js +146 -0
  105. data/lib/stylus/stack/scope.js +53 -0
  106. data/lib/stylus/stylus.js +102 -0
  107. data/lib/stylus/token.js +53 -0
  108. data/lib/stylus/utils.js +237 -0
  109. data/lib/stylus/visitor/compiler.js +472 -0
  110. data/lib/stylus/visitor/evaluator.js +1070 -0
  111. data/lib/stylus/visitor/index.js +31 -0
  112. data/stylus-source.gemspec +15 -0
  113. metadata +158 -0
@@ -0,0 +1,100 @@
1
+ <!DOCTYPE html>
2
+ <style type="text/css">
3
+ html, body {
4
+ background: #CCC;
5
+ font-size: 14px;
6
+ margin: 0;
7
+ height: 100%;
8
+ }
9
+ table {
10
+ width: 100%;
11
+ border-collapse: collapse;
12
+ }
13
+ td {
14
+ width: 50%;
15
+ padding: 0;
16
+ vertical-align: top;
17
+ }
18
+ #output, #style {
19
+ width: 49%;
20
+ min-height: 99%;
21
+ display: inline-block;
22
+ vertical-align: top;
23
+ }
24
+ #style {
25
+ position: absolute;
26
+ top: 0;
27
+ height: 100%;
28
+ left: 4px;
29
+ width: 49%;
30
+ background: #FFF;
31
+ border: 1px solid #999;
32
+ font: 14px monospace;
33
+ white-space: pre-wrap;
34
+ }
35
+ #output {
36
+ position: absolute;
37
+ top: 0;
38
+ min-height: 100%;
39
+ right: 0;
40
+ width: 50%;
41
+ margin: 0;
42
+ padding: 4px;
43
+ box-sizing: border-box;
44
+ -webkit-box-sizing: border-box;
45
+ background: #333;
46
+ }
47
+
48
+ .rule {
49
+ color: #8CB7D1;
50
+ }
51
+ .name {
52
+ color: #D7AA69;
53
+ }
54
+ .value {
55
+ color: #D7AA69;
56
+ }
57
+ .brace-open, .brace-close, .colon, .semicolon {
58
+ color: #625035;
59
+ }
60
+ /*@import url("test/fixtures/dummy.css") screen, handheld;*/
61
+ @media screen, all {
62
+ body {
63
+ color: black;
64
+ }
65
+ }
66
+ </style>
67
+
68
+ <textarea id="style">.rule {
69
+ display: block;
70
+ }
71
+ .properties {
72
+ display: block;
73
+ }</textarea>
74
+ <pre id="output"></pre>
75
+
76
+
77
+ <script type="text/javascript" src="lib/StyleSheet.js"></script>
78
+ <script type="text/javascript" src="lib/CSSStyleSheet.js"></script>
79
+ <script type="text/javascript" src="lib/MediaList.js"></script>
80
+ <script type="text/javascript" src="lib/CSSRule.js"></script>
81
+ <script type="text/javascript" src="lib/CSSStyleRule.js"></script>
82
+ <script type="text/javascript" src="lib/CSSMediaRule.js"></script>
83
+ <script type="text/javascript" src="lib/CSSStyleDeclaration.js"></script>
84
+ <script type="text/javascript" src="lib/parse.js"></script>
85
+ <script type="text/javascript" src="lib/parse.js"></script>
86
+ <script type="text/javascript" src="plugins/toHTML.js"></script>
87
+ <script type="text/javascript">
88
+ CSSStyleSheet.prototype.toHTML = toHTML;
89
+ window.onload = function(){
90
+ var style = document.getElementById("style");
91
+ var output = document.getElementById("output")
92
+
93
+ function outputUpdated(){
94
+ output.innerHTML = parse(style.value).toHTML();
95
+ }
96
+
97
+ style.onkeyup = outputUpdated;
98
+ outputUpdated();
99
+ }
100
+ </script>
@@ -0,0 +1,34 @@
1
+ //.CommonJS
2
+ var CSSOM = {
3
+ CSSRule: require("./CSSRule").CSSRule,
4
+ CSSStyleSheet: require("./CSSStyleSheet").CSSStyleSheet,
5
+ MediaList: require("./MediaList").MediaList
6
+ };
7
+ ///CommonJS
8
+
9
+
10
+ /**
11
+ * @constructor
12
+ * @see http://dev.w3.org/csswg/cssom/#cssimportrule
13
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSImportRule
14
+ */
15
+ CSSOM.CSSImportRule = function CSSImportRule() {
16
+ this.href = "";
17
+ this.media = new CSSOM.MediaList;
18
+ this.styleSheet = new CSSOM.CSSStyleSheet;
19
+ };
20
+
21
+ CSSOM.CSSImportRule.prototype = new CSSOM.CSSRule;
22
+ CSSOM.CSSImportRule.prototype.constructor = CSSOM.CSSImportRule;
23
+ CSSOM.CSSImportRule.prototype.type = 3;
24
+ CSSOM.CSSImportRule.prototype.__defineGetter__("cssText", function() {
25
+ return "@import url("+ this.href +") "+ this.media.mediaText +";"
26
+ });
27
+ CSSOM.CSSImportRule.prototype.__defineSetter__("cssText", function() {
28
+ return "@import url("+ this.href +") "+ this.media.mediaText +";"
29
+ });
30
+
31
+
32
+ //.CommonJS
33
+ exports.CSSImportRule = CSSOM.CSSImportRule;
34
+ ///CommonJS
@@ -0,0 +1,38 @@
1
+ //.CommonJS
2
+ var CSSOM = {
3
+ CSSRule: require("./CSSRule").CSSRule,
4
+ MediaList: require("./MediaList").MediaList
5
+ };
6
+ ///CommonJS
7
+
8
+
9
+ /**
10
+ * @constructor
11
+ * @see http://dev.w3.org/csswg/cssom/#cssmediarule
12
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule
13
+ */
14
+ CSSOM.CSSMediaRule = function CSSMediaRule() {
15
+ this.media = new CSSOM.MediaList;
16
+ this.cssRules = [];
17
+ };
18
+
19
+ CSSOM.CSSMediaRule.prototype = new CSSOM.CSSRule;
20
+ CSSOM.CSSMediaRule.prototype.constructor = CSSOM.CSSMediaRule;
21
+ CSSOM.CSSMediaRule.prototype.type = 4;
22
+ //FIXME
23
+ //CSSOM.CSSMediaRule.prototype.insertRule = CSSStyleSheet.prototype.insertRule;
24
+ //CSSOM.CSSMediaRule.prototype.deleteRule = CSSStyleSheet.prototype.deleteRule;
25
+
26
+ // http://opensource.apple.com/source/WebCore/WebCore-658.28/css/CSSMediaRule.cpp
27
+ CSSOM.CSSMediaRule.prototype.__defineGetter__("cssText", 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 "@media " + this.media.mediaText + " {" + cssTexts.join("") + "}"
33
+ });
34
+
35
+
36
+ //.CommonJS
37
+ exports.CSSMediaRule = CSSOM.CSSMediaRule;
38
+ ///CommonJS
@@ -0,0 +1,3 @@
1
+ var CSSOM = {};
2
+
3
+
@@ -0,0 +1,38 @@
1
+ //.CommonJS
2
+ var CSSOM = {};
3
+ ///CommonJS
4
+
5
+
6
+ /**
7
+ * @constructor
8
+ * @see http://dev.w3.org/csswg/cssom/#the-cssrule-interface
9
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule
10
+ */
11
+ CSSOM.CSSRule = function CSSRule() {
12
+ this.parentRule = null;
13
+ };
14
+
15
+ CSSOM.CSSRule.STYLE_RULE = 1;
16
+ CSSOM.CSSRule.IMPORT_RULE = 3;
17
+ CSSOM.CSSRule.MEDIA_RULE = 4;
18
+ CSSOM.CSSRule.FONT_FACE_RULE = 5;
19
+ CSSOM.CSSRule.PAGE_RULE = 6;
20
+ CSSOM.CSSRule.WEBKIT_KEYFRAMES_RULE = 8;
21
+ CSSOM.CSSRule.WEBKIT_KEYFRAME_RULE = 9;
22
+
23
+ // Obsolete in CSSOM http://dev.w3.org/csswg/cssom/
24
+ //CSSOM.CSSRule.UNKNOWN_RULE = 0;
25
+ //CSSOM.CSSRule.CHARSET_RULE = 2;
26
+
27
+ // Never implemented
28
+ //CSSOM.CSSRule.VARIABLES_RULE = 7;
29
+
30
+ CSSOM.CSSRule.prototype = {
31
+ constructor: CSSOM.CSSRule
32
+ //FIXME
33
+ };
34
+
35
+
36
+ //.CommonJS
37
+ exports.CSSRule = CSSOM.CSSRule;
38
+ ///CommonJS
@@ -0,0 +1,130 @@
1
+ //.CommonJS
2
+ var CSSOM = {};
3
+ ///CommonJS
4
+
5
+
6
+ /**
7
+ * @constructor
8
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration
9
+ */
10
+ CSSOM.CSSStyleDeclaration = function CSSStyleDeclaration(){
11
+ this.length = 0;
12
+
13
+ // NON-STANDARD
14
+ this._importants = {};
15
+ };
16
+
17
+
18
+ CSSOM.CSSStyleDeclaration.prototype = {
19
+
20
+ constructor: CSSOM.CSSStyleDeclaration,
21
+
22
+ /**
23
+ *
24
+ * @param {string} name
25
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-getPropertyValue
26
+ * @return {string} the value of the property if it has been explicitly set for this declaration block.
27
+ * Returns the empty string if the property has not been set.
28
+ */
29
+ getPropertyValue: function(name) {
30
+ return this[name] || ""
31
+ },
32
+
33
+ /**
34
+ *
35
+ * @param {string} name
36
+ * @param {string} value
37
+ * @param {string} [priority=null] "important" or null
38
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-setProperty
39
+ */
40
+ setProperty: function(name, value, priority) {
41
+ if (this[name]) {
42
+ // Property already exist. Overwrite it.
43
+ var index = Array.prototype.indexOf.call(this, name);
44
+ if (index < 0) {
45
+ this[this.length] = name;
46
+ this.length++;
47
+ }
48
+ } else {
49
+ // New property.
50
+ this[this.length] = name;
51
+ this.length++;
52
+ }
53
+ this[name] = value;
54
+ this._importants[name] = priority;
55
+ },
56
+
57
+ /**
58
+ *
59
+ * @param {string} name
60
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-removeProperty
61
+ * @return {string} the value of the property if it has been explicitly set for this declaration block.
62
+ * Returns the empty string if the property has not been set or the property name does not correspond to a known CSS property.
63
+ */
64
+ removeProperty: function(name) {
65
+ if (!(name in this)) {
66
+ return ""
67
+ }
68
+ var index = Array.prototype.indexOf.call(this, name);
69
+ if (index < 0) {
70
+ return ""
71
+ }
72
+ var prevValue = this[name];
73
+ this[name] = "";
74
+
75
+ // That's what WebKit and Opera do
76
+ Array.prototype.splice.call(this, index, 1);
77
+
78
+ // That's what Firefox does
79
+ //this[index] = ""
80
+
81
+ return prevValue
82
+ },
83
+
84
+ getPropertyCSSValue: function() {
85
+ //FIXME
86
+ },
87
+
88
+ /**
89
+ *
90
+ * @param {String} name
91
+ */
92
+ getPropertyPriority: function(name) {
93
+ return this._importants[name] || "";
94
+ },
95
+
96
+
97
+ /**
98
+ * element.style.overflow = "auto"
99
+ * element.style.getPropertyShorthand("overflow-x")
100
+ * -> "overflow"
101
+ */
102
+ getPropertyShorthand: function() {
103
+ //FIXME
104
+ },
105
+
106
+ isPropertyImplicit: function() {
107
+ //FIXME
108
+ },
109
+
110
+ // Doesn't work in IE < 9
111
+ get cssText(){
112
+ var properties = [];
113
+ for (var i=0, length=this.length; i < length; ++i) {
114
+ var name = this[i];
115
+ var value = this.getPropertyValue(name);
116
+ var priority = this.getPropertyPriority(name);
117
+ if (priority) {
118
+ priority = " !" + priority;
119
+ }
120
+ properties[i] = name + ": " + value + priority + ";";
121
+ }
122
+ return properties.join(" ")
123
+ }
124
+
125
+ };
126
+
127
+
128
+ //.CommonJS
129
+ exports.CSSStyleDeclaration = CSSOM.CSSStyleDeclaration;
130
+ ///CommonJS
@@ -0,0 +1,187 @@
1
+ //.CommonJS
2
+ var CSSOM = {
3
+ CSSStyleDeclaration: require("./CSSStyleDeclaration").CSSStyleDeclaration,
4
+ CSSRule: require("./CSSRule").CSSRule
5
+ };
6
+ ///CommonJS
7
+
8
+
9
+ /**
10
+ * @constructor
11
+ * @see http://dev.w3.org/csswg/cssom/#cssstylerule
12
+ * @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleRule
13
+ */
14
+ CSSOM.CSSStyleRule = function CSSStyleRule() {
15
+ this.selectorText = "";
16
+ this.style = new CSSOM.CSSStyleDeclaration;
17
+ };
18
+
19
+ CSSOM.CSSStyleRule.prototype = new CSSOM.CSSRule;
20
+ CSSOM.CSSStyleRule.prototype.constructor = CSSOM.CSSStyleRule;
21
+ CSSOM.CSSStyleRule.prototype.type = 1;
22
+
23
+ CSSOM.CSSStyleRule.prototype.__defineGetter__("cssText", function() {
24
+ var text;
25
+ if (this.selectorText) {
26
+ text = this.selectorText + " {" + this.style.cssText + "}";
27
+ } else {
28
+ text = "";
29
+ }
30
+ return text;
31
+ });
32
+
33
+ CSSOM.CSSStyleRule.prototype.__defineSetter__("cssText", function(cssText) {
34
+ var rule = CSSOM.CSSStyleRule.parse(cssText);
35
+ this.style = rule.style;
36
+ this.selectorText = rule.selectorText;
37
+ });
38
+
39
+
40
+ /**
41
+ * NON-STANDARD
42
+ * lightweight version of parse.js.
43
+ * @param {string} ruleText
44
+ * @return CSSStyleRule
45
+ */
46
+ CSSOM.CSSStyleRule.parse = function(ruleText) {
47
+ var i = 0;
48
+ var state = "selector";
49
+ var index;
50
+ var j = i;
51
+ var buffer = "";
52
+
53
+ var SIGNIFICANT_WHITESPACE = {
54
+ "selector": true,
55
+ "value": true
56
+ };
57
+
58
+ var styleRule = new CSSOM.CSSStyleRule;
59
+ var selector, name, value, priority="";
60
+
61
+ for (var character; character = ruleText.charAt(i); i++) {
62
+
63
+ switch (character) {
64
+
65
+ case " ":
66
+ case "\t":
67
+ case "\r":
68
+ case "\n":
69
+ case "\f":
70
+ if (SIGNIFICANT_WHITESPACE[state]) {
71
+ // Squash 2 or more white-spaces in the row into 1
72
+ switch (ruleText.charAt(i - 1)) {
73
+ case " ":
74
+ case "\t":
75
+ case "\r":
76
+ case "\n":
77
+ case "\f":
78
+ break;
79
+ default:
80
+ buffer += " ";
81
+ break;
82
+ }
83
+ }
84
+ break;
85
+
86
+ // String
87
+ case '"':
88
+ j = i + 1;
89
+ index = ruleText.indexOf('"', j) + 1;
90
+ if (!index) {
91
+ throw '" is missing';
92
+ }
93
+ buffer += ruleText.slice(i, index);
94
+ i = index - 1;
95
+ break;
96
+
97
+ case "'":
98
+ j = i + 1;
99
+ index = ruleText.indexOf("'", j) + 1;
100
+ if (!index) {
101
+ throw "' is missing";
102
+ }
103
+ buffer += ruleText.slice(i, index);
104
+ i = index - 1;
105
+ break;
106
+
107
+ // Comment
108
+ case "/":
109
+ if (ruleText.charAt(i + 1) == "*") {
110
+ i += 2;
111
+ index = ruleText.indexOf("*/", i);
112
+ if (index == -1) {
113
+ throw SyntaxError("Missing */");
114
+ } else {
115
+ i = index + 1;
116
+ }
117
+ } else {
118
+ buffer += character;
119
+ }
120
+ break;
121
+
122
+ case "{":
123
+ if (state == "selector") {
124
+ styleRule.selectorText = buffer.trim();
125
+ buffer = "";
126
+ state = "name";
127
+ }
128
+ break;
129
+
130
+ case ":":
131
+ if (state == "name") {
132
+ name = buffer.trim();
133
+ buffer = "";
134
+ state = "value";
135
+ } else {
136
+ buffer += character;
137
+ }
138
+ break;
139
+
140
+ case "!":
141
+ if (state == "value" && ruleText.indexOf("!important", i) === i) {
142
+ priority = "important";
143
+ i += "important".length;
144
+ } else {
145
+ buffer += character;
146
+ }
147
+ break;
148
+
149
+ case ";":
150
+ if (state == "value") {
151
+ styleRule.style.setProperty(name, buffer.trim(), priority);
152
+ priority = "";
153
+ buffer = "";
154
+ state = "name";
155
+ } else {
156
+ buffer += character;
157
+ }
158
+ break;
159
+
160
+ case "}":
161
+ if (state == "value") {
162
+ styleRule.style.setProperty(name, buffer.trim(), priority);
163
+ priority = "";
164
+ buffer = "";
165
+ } else if (state == "name") {
166
+ break;
167
+ } else {
168
+ buffer += character;
169
+ }
170
+ state = "selector";
171
+ break;
172
+
173
+ default:
174
+ buffer += character;
175
+ break;
176
+
177
+ }
178
+ }
179
+
180
+ return styleRule;
181
+
182
+ };
183
+
184
+
185
+ //.CommonJS
186
+ exports.CSSStyleRule = CSSOM.CSSStyleRule;
187
+ ///CommonJS