cssminify2 2.0.1 → 2.1.0
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.
- checksums.yaml +5 -5
- data/.travis.yml +10 -5
- data/CHANGELOG.md +121 -0
- data/Dockerfile +16 -0
- data/Gemfile +1 -1
- data/README.md +501 -42
- data/cssminify2.gemspec +6 -2
- data/docs/ADVANCED_USAGE.md +616 -0
- data/docs/API_REFERENCE.md +464 -0
- data/docs/EXAMPLES.md +844 -0
- data/docs/MIGRATION_GUIDE.md +586 -0
- data/lib/cssminify2/cssmin.rb +89 -7
- data/lib/cssminify2/cssmin_enhanced.rb +424 -0
- data/lib/cssminify2/enhanced.rb +818 -0
- data/lib/cssminify2/version.rb +1 -1
- data/lib/cssminify2.rb +53 -4
- data/spec/cssminify_spec.rb +49 -34
- data/spec/tests/README +6 -0
- data/spec/tests/_munge.js +8 -0
- data/spec/tests/_munge.js.min +1 -0
- data/spec/tests/_string_combo.js +5 -0
- data/spec/tests/_string_combo.js.min +1 -0
- data/spec/tests/_string_combo2.js +4 -0
- data/spec/tests/_string_combo2.js.min +1 -0
- data/spec/tests/_string_combo3.js +5 -0
- data/spec/tests/_string_combo3.js.min +1 -0
- data/spec/tests/_syntax_error.js +73 -0
- data/spec/tests/_syntax_error.js.min +1 -0
- data/spec/tests/border-none.css +6 -1
- data/spec/tests/border-none.css.min +1 -1
- data/spec/tests/bug-flex.css +3 -0
- data/spec/tests/bug-flex.css.min +1 -0
- data/spec/tests/bug-nested-pseudoclass.css +3 -0
- data/spec/tests/bug-nested-pseudoclass.css.min +1 -0
- data/spec/tests/bug-preservetoken-calc.css +8 -0
- data/spec/tests/bug-preservetoken-calc.css.min +1 -0
- data/spec/tests/color-keyword.css +1 -0
- data/spec/tests/color-keyword.css.min +1 -0
- data/spec/tests/color.css +2 -0
- data/spec/tests/color.css.min +1 -1
- data/spec/tests/concat-charset.css +2 -2
- data/spec/tests/concat-charset.css.min +1 -1
- data/spec/tests/dataurl-singlequote-font.css +1 -1
- data/spec/tests/dataurl-validity.html +29 -0
- data/spec/tests/float.js +2 -0
- data/spec/tests/float.js.min +1 -0
- data/spec/tests/hsla-issue81.css.FAIL +4 -0
- data/spec/tests/hsla-issue81.css.min +1 -0
- data/spec/tests/ie-backslash9-hack.css +2 -0
- data/spec/tests/ie-backslash9-hack.css.min +1 -0
- data/spec/tests/issue-59.css +7 -0
- data/spec/tests/issue-59.css.min +1 -0
- data/spec/tests/issue151.css +8 -0
- data/spec/tests/issue151.css.min +1 -0
- data/spec/tests/issue172.css.FAIL +4 -0
- data/spec/tests/issue172.css.min +1 -0
- data/spec/tests/issue180.css +16 -0
- data/spec/tests/issue180.css.min +1 -0
- data/spec/tests/issue205.css +2 -0
- data/spec/tests/issue205.css.min +1 -0
- data/spec/tests/issue221.css +1 -1
- data/spec/tests/issue221.css.min +1 -1
- data/spec/tests/issue222.css +2 -2
- data/spec/tests/issue222.css.min +1 -1
- data/spec/tests/issue71.js.FAIL +4 -0
- data/spec/tests/issue71.js.min +1 -0
- data/spec/tests/issue86.js +2 -0
- data/spec/tests/issue86.js.min +1 -0
- data/spec/tests/jquery-1.6.4.js +9046 -0
- data/spec/tests/jquery-1.6.4.js.min +23 -0
- data/spec/tests/lowercasing.css +63 -0
- data/spec/tests/lowercasing.css.min +1 -0
- data/spec/tests/media-test.css +2 -2
- data/spec/tests/old-ie-filter-matrix.css +8 -0
- data/spec/tests/old-ie-filter-matrix.css.min +1 -0
- data/spec/tests/opera-pixel-ratio.css +14 -0
- data/spec/tests/opera-pixel-ratio.css.min +1 -0
- data/spec/tests/pointzeros.css +6 -0
- data/spec/tests/pointzeros.css.min +1 -0
- data/spec/tests/preserve-important.css +1 -0
- data/spec/tests/preserve-important.css.min +1 -0
- data/spec/tests/promise-catch-finally-issue203.js +4 -0
- data/spec/tests/promise-catch-finally-issue203.js.min +1 -0
- data/spec/tests/pseudo-first.css +2 -2
- data/spec/tests/rgb-issue81.css.FAIL +4 -0
- data/spec/tests/rgb-issue81.css.min +1 -0
- data/spec/tests/suite.rhino +3 -0
- data/spec/tests/suite.sh +49 -0
- data/spec/tests/zeros.css +2 -2
- data/spec/tests/zeros.css.min +1 -1
- metadata +129 -14
- data/spec/tests/bug2528093.css +0 -3
- data/spec/tests/bug2528093.css.min +0 -1
- data/spec/tests/keyframe.css +0 -4
- data/spec/tests/keyframe.css.min +0 -1
data/lib/cssminify2/version.rb
CHANGED
data/lib/cssminify2.rb
CHANGED
@@ -3,14 +3,20 @@
|
|
3
3
|
require "cssminify2/cssmin"
|
4
4
|
require "cssminify2/version"
|
5
5
|
|
6
|
+
# Optional enhanced features (backward compatible)
|
7
|
+
begin
|
8
|
+
require "cssminify2/enhanced"
|
9
|
+
rescue LoadError
|
10
|
+
# Enhanced features not available, continue with basic functionality
|
11
|
+
end
|
12
|
+
|
6
13
|
class CSSminify2
|
7
14
|
|
8
15
|
def initialize
|
9
16
|
end
|
10
17
|
|
11
|
-
|
12
18
|
#
|
13
|
-
# Compress CSS with YUI
|
19
|
+
# Compress CSS with YUI (Original API - Unchanged)
|
14
20
|
#
|
15
21
|
# @param [String, #read] CSS String or IO-like object that supports #read
|
16
22
|
# @param [Integer] length Maximum line length
|
@@ -19,9 +25,8 @@ class CSSminify2
|
|
19
25
|
self.new.compress(source, length)
|
20
26
|
end
|
21
27
|
|
22
|
-
|
23
28
|
#
|
24
|
-
# Compress CSS with YUI
|
29
|
+
# Compress CSS with YUI (Original API - Unchanged)
|
25
30
|
#
|
26
31
|
# @param [String, #read] CSS String or IO-like object that supports #read
|
27
32
|
# @param [Integer] length Maximum line length
|
@@ -31,4 +36,48 @@ class CSSminify2
|
|
31
36
|
|
32
37
|
CssCompressor.compress(source, length)
|
33
38
|
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# Enhanced compression with additional features (New, Optional)
|
42
|
+
#
|
43
|
+
# @param [String, #read] CSS String or IO-like object that supports #read
|
44
|
+
# @param [Hash] options Configuration options for enhanced features
|
45
|
+
# @option options [Boolean] :merge_duplicate_selectors Merge duplicate selectors
|
46
|
+
# @option options [Boolean] :optimize_shorthand_properties Optimize margin/padding shorthand
|
47
|
+
# @option options [Boolean] :advanced_color_optimization Enhanced color optimization
|
48
|
+
# @option options [Integer] :linebreakpos Maximum line length (default: 5000)
|
49
|
+
# @return [String] Compressed CSS
|
50
|
+
def self.compress_enhanced(source, options = {})
|
51
|
+
if defined?(CSSminify2Enhanced)
|
52
|
+
CSSminify2Enhanced.compress(source, options)
|
53
|
+
else
|
54
|
+
# Fallback to original compression if enhanced features not available
|
55
|
+
compress(source, options[:linebreakpos] || 5000)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
#
|
60
|
+
# Enhanced compression with statistics (New, Optional)
|
61
|
+
#
|
62
|
+
# @param [String, #read] CSS String or IO-like object that supports #read
|
63
|
+
# @param [Hash] options Configuration options
|
64
|
+
# @return [Hash] Hash containing :compressed_css and :statistics
|
65
|
+
def self.compress_with_stats(source, options = {})
|
66
|
+
if defined?(CSSminify2Enhanced)
|
67
|
+
CSSminify2Enhanced.compress_with_stats(source, options)
|
68
|
+
else
|
69
|
+
# Fallback with basic stats
|
70
|
+
original = source.respond_to?(:read) ? source.read : source.to_s
|
71
|
+
compressed = compress(original, options[:linebreakpos] || 5000)
|
72
|
+
{
|
73
|
+
compressed_css: compressed,
|
74
|
+
statistics: {
|
75
|
+
original_size: original.length,
|
76
|
+
compressed_size: compressed.length,
|
77
|
+
compression_ratio: ((original.length - compressed.length).to_f / original.length * 100).round(2),
|
78
|
+
enhanced_features_used: false
|
79
|
+
}
|
80
|
+
}
|
81
|
+
end
|
82
|
+
end
|
34
83
|
end
|
data/spec/cssminify_spec.rb
CHANGED
@@ -10,10 +10,10 @@ describe "CSSminify2" do
|
|
10
10
|
it "minifies CSS" do
|
11
11
|
source = File.open(File.expand_path("../sample.css", __FILE__), "r:UTF-8").read
|
12
12
|
minified = CSSminify2.compress(source)
|
13
|
-
minified.length.
|
14
|
-
|
13
|
+
expect(minified.length).to be < source.length
|
14
|
+
expect {
|
15
15
|
CSSminify2.compress(minified)
|
16
|
-
}.
|
16
|
+
}.to_not raise_error
|
17
17
|
end
|
18
18
|
|
19
19
|
it "honors the specified maximum line length" do
|
@@ -30,27 +30,31 @@ describe "CSSminify2" do
|
|
30
30
|
}
|
31
31
|
EOS
|
32
32
|
minified = CSSminify2.compress(source, 30)
|
33
|
-
minified.split("\n").length.
|
34
|
-
minified.
|
33
|
+
expect(minified.split("\n").length).to eq(2)
|
34
|
+
expect(minified).to eq(".classname1{border:0;background:0;outline:0}\n.classname2{border:0;background:0;outline:0}")
|
35
35
|
end
|
36
36
|
|
37
37
|
it "handles strings as input format" do
|
38
|
-
|
39
|
-
CSSminify2.compress(File.open(File.expand_path("../sample.css", __FILE__), "r:UTF-8").read)
|
40
|
-
}.
|
38
|
+
expect {
|
39
|
+
CSSminify2.compress(File.open(File.expand_path("../sample.css", __FILE__), "r:UTF-8").read)
|
40
|
+
}.to_not raise_error
|
41
|
+
expect(CSSminify2.compress(File.open(File.expand_path("../sample.css", __FILE__), "r:UTF-8").read)).to_not be_empty
|
41
42
|
end
|
42
43
|
|
43
44
|
it "handles files as input format" do
|
44
|
-
|
45
|
-
CSSminify2.compress(File.open(File.expand_path("../sample.css", __FILE__), "r:UTF-8"))
|
46
|
-
}.
|
45
|
+
expect {
|
46
|
+
CSSminify2.compress(File.open(File.expand_path("../sample.css", __FILE__), "r:UTF-8"))
|
47
|
+
}.to_not raise_error
|
48
|
+
expect(CSSminify2.compress(File.open(File.expand_path("../sample.css", __FILE__), "r:UTF-8"))).to_not be_empty
|
47
49
|
end
|
48
50
|
|
49
51
|
it "works as both class and class instance" do
|
50
|
-
|
51
|
-
CSSminify2.compress(File.open(File.expand_path("../sample.css", __FILE__), "r:UTF-8").read)
|
52
|
-
CSSminify2.new.compress(File.open(File.expand_path("../sample.css", __FILE__), "r:UTF-8").read)
|
53
|
-
|
52
|
+
expect {
|
53
|
+
result1 = CSSminify2.compress(File.open(File.expand_path("../sample.css", __FILE__), "r:UTF-8").read)
|
54
|
+
result2 = CSSminify2.new.compress(File.open(File.expand_path("../sample.css", __FILE__), "r:UTF-8").read)
|
55
|
+
expect(result1).to_not be_empty
|
56
|
+
expect(result2).to_not be_empty
|
57
|
+
}.to_not raise_error
|
54
58
|
end
|
55
59
|
|
56
60
|
end
|
@@ -69,7 +73,7 @@ describe "CSSminify2" do
|
|
69
73
|
font-weight: normal;
|
70
74
|
}
|
71
75
|
EOS
|
72
|
-
CSSminify2.compress(source).
|
76
|
+
expect(CSSminify2.compress(source)).to eq('.classname{font-weight:normal}')
|
73
77
|
end
|
74
78
|
|
75
79
|
it "preserves special comments" do
|
@@ -87,7 +91,7 @@ describe "CSSminify2" do
|
|
87
91
|
(c) Very Important Comment
|
88
92
|
*/.classname{font-weight:normal}
|
89
93
|
EOS
|
90
|
-
(CSSminify2.compress(source) + "\n").
|
94
|
+
expect(CSSminify2.compress(source) + "\n").to eq(result)
|
91
95
|
end
|
92
96
|
|
93
97
|
it "removes last semi-colon in a block" do
|
@@ -97,7 +101,7 @@ describe "CSSminify2" do
|
|
97
101
|
border-bottom: 2px;
|
98
102
|
}
|
99
103
|
EOS
|
100
|
-
CSSminify2.compress(source).
|
104
|
+
expect(CSSminify2.compress(source)).to eq('.classname{border-top:1px;border-bottom:2px}')
|
101
105
|
end
|
102
106
|
|
103
107
|
it "removes extra semi-colons" do
|
@@ -107,7 +111,7 @@ describe "CSSminify2" do
|
|
107
111
|
border-bottom: 2px;;;
|
108
112
|
}
|
109
113
|
EOS
|
110
|
-
CSSminify2.compress(source).
|
114
|
+
expect(CSSminify2.compress(source)).to eq('.classname{border-top:1px;border-bottom:2px}')
|
111
115
|
end
|
112
116
|
|
113
117
|
it "removes empty declarations" do
|
@@ -115,7 +119,7 @@ describe "CSSminify2" do
|
|
115
119
|
.empty { ;}
|
116
120
|
.nonempty {border: 0;}
|
117
121
|
EOS
|
118
|
-
CSSminify2.compress(source).
|
122
|
+
expect(CSSminify2.compress(source)).to eq('.nonempty{border:0}')
|
119
123
|
end
|
120
124
|
|
121
125
|
it "simplifies zero values" do
|
@@ -126,7 +130,7 @@ describe "CSSminify2" do
|
|
126
130
|
padding: 0in 0cm 0mm 0pc
|
127
131
|
}
|
128
132
|
EOS
|
129
|
-
CSSminify2.compress(source).
|
133
|
+
expect(CSSminify2.compress(source)).to eq('a{margin:0;background-position:0 0;padding:0}')
|
130
134
|
end
|
131
135
|
|
132
136
|
it "simplifies zero values preserving unit when necessary" do
|
@@ -172,7 +176,7 @@ describe "CSSminify2" do
|
|
172
176
|
}
|
173
177
|
}
|
174
178
|
EOS
|
175
|
-
CSSminify2.compress(source).
|
179
|
+
expect(CSSminify2.compress(source)).to eq('@-webkit-keyframes anim{0%{left:0}100%{left:-100%}}@-moz-keyframes anim{0%{left:0}100%{left:-100%}}@-ms-keyframes anim{0%{left:0}100%{left:-100%}}@-o-keyframes anim{0%{left:0}100%{left:-100%}}@keyframes anim{0%{left:0}100%{left:-100%}}')
|
176
180
|
end
|
177
181
|
|
178
182
|
it "removes leading zeros from floats" do
|
@@ -181,7 +185,7 @@ describe "CSSminify2" do
|
|
181
185
|
margin: 0.6px 0.333pt 1.2em 8.8cm;
|
182
186
|
}
|
183
187
|
EOS
|
184
|
-
CSSminify2.compress(source).
|
188
|
+
expect(CSSminify2.compress(source)).to eq('.classname{margin:.6px .333pt 1.2em 8.8cm}')
|
185
189
|
end
|
186
190
|
|
187
191
|
it "removes leading zeros from groups" do
|
@@ -199,7 +203,7 @@ describe "CSSminify2" do
|
|
199
203
|
0hz /* intentionally on next line */;
|
200
204
|
}
|
201
205
|
EOS
|
202
|
-
CSSminify2.compress(source).
|
206
|
+
expect(CSSminify2.compress(source)).to eq('a{margin:0;_padding-top:0;background-position:0 0;padding:0;transition:opacity 0;transition-delay:0;transform:rotate3d(0,0,0);pitch:0;pitch:0}')
|
203
207
|
end
|
204
208
|
|
205
209
|
it "simplifies color values but preserves filter properties, RGBa values and ID strings" do
|
@@ -210,7 +214,7 @@ describe "CSSminify2" do
|
|
210
214
|
background: none repeat scroll 0 0 rgb(255, 0,0);
|
211
215
|
}
|
212
216
|
EOS
|
213
|
-
CSSminify2.compress(source).
|
217
|
+
expect(CSSminify2.compress(source)).to eq('.color-me{color:#7b7b7b;border-color:#fed;background:none repeat scroll 0 0 red}')
|
214
218
|
|
215
219
|
source = <<-EOS
|
216
220
|
#AABBCC {
|
@@ -218,7 +222,7 @@ describe "CSSminify2" do
|
|
218
222
|
filter: chroma(color="#FFFFFF");
|
219
223
|
}
|
220
224
|
EOS
|
221
|
-
CSSminify2.compress(source).
|
225
|
+
expect(CSSminify2.compress(source)).to eq('#AABBCC{color:rgba(1,2,3,4);filter:chroma(color="#FFFFFF")}')
|
222
226
|
end
|
223
227
|
|
224
228
|
it "only keeps the first charset declaration" do
|
@@ -234,7 +238,7 @@ describe "CSSminify2" do
|
|
234
238
|
border-width: 10px;
|
235
239
|
}
|
236
240
|
EOS
|
237
|
-
CSSminify2.compress(source).
|
241
|
+
expect(CSSminify2.compress(source)).to eq('@charset "utf-8";#foo{border-width:1px}#bar{border-width:10px}')
|
238
242
|
end
|
239
243
|
|
240
244
|
it "simplifies the IE opacity filter syntax" do
|
@@ -244,7 +248,7 @@ describe "CSSminify2" do
|
|
244
248
|
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80); /* IE < 8 */
|
245
249
|
}
|
246
250
|
EOS
|
247
|
-
CSSminify2.compress(source).
|
251
|
+
expect(CSSminify2.compress(source)).to eq('.classname{-ms-filter:"alpha(opacity=80)";filter:alpha(opacity=80)}')
|
248
252
|
end
|
249
253
|
|
250
254
|
it "replaces 'none' values with 0 where allowed" do
|
@@ -255,7 +259,7 @@ describe "CSSminify2" do
|
|
255
259
|
outline: none;
|
256
260
|
}
|
257
261
|
EOS
|
258
|
-
CSSminify2.compress(source).
|
262
|
+
expect(CSSminify2.compress(source)).to eq('.classname{border:0;background:0;outline:0}')
|
259
263
|
end
|
260
264
|
|
261
265
|
it "tolerates underscore/star hacks" do
|
@@ -266,7 +270,7 @@ describe "CSSminify2" do
|
|
266
270
|
_width: 3px;
|
267
271
|
}
|
268
272
|
EOS
|
269
|
-
CSSminify2.compress(source).
|
273
|
+
expect(CSSminify2.compress(source)).to eq('#element{width:1px;*width:2px;_width:3px}')
|
270
274
|
end
|
271
275
|
|
272
276
|
it "tolerates child selector hacks" do
|
@@ -275,7 +279,7 @@ describe "CSSminify2" do
|
|
275
279
|
color: blue;
|
276
280
|
}
|
277
281
|
EOS
|
278
|
-
CSSminify2.compress(source).
|
282
|
+
expect(CSSminify2.compress(source)).to eq('html>/**/body p{color:blue}')
|
279
283
|
end
|
280
284
|
|
281
285
|
it "tolerates IE5/Mac hacks" do
|
@@ -286,7 +290,7 @@ describe "CSSminify2" do
|
|
286
290
|
}
|
287
291
|
/* Stop ignoring in IE mac */
|
288
292
|
EOS
|
289
|
-
CSSminify2.compress(source).
|
293
|
+
expect(CSSminify2.compress(source)).to eq('/*\*/.selector{color:khaki}/**/')
|
290
294
|
end
|
291
295
|
|
292
296
|
it "tolerates box model hacks" do
|
@@ -301,7 +305,18 @@ describe "CSSminify2" do
|
|
301
305
|
width: 200px; /* others */
|
302
306
|
}
|
303
307
|
EOS
|
304
|
-
CSSminify2.compress(source).
|
308
|
+
expect(CSSminify2.compress(source)).to eq('#elem{width:100px;voice-family:"\"}\"";voice-family:inherit;width:200px}html>body #elem{width:200px}')
|
309
|
+
end
|
310
|
+
|
311
|
+
it "keeps a space before opening brace in calc" do
|
312
|
+
source = <<-EOS
|
313
|
+
.content {
|
314
|
+
height: calc(35% - 30px);
|
315
|
+
width: calc(35% - (30px / 2));
|
316
|
+
background-image: url("./bg.png");
|
317
|
+
}
|
318
|
+
EOS
|
319
|
+
expect(CSSminify2.compress(source)).to eq('.content{height:calc(35% - 30px);width:calc(35% - (30px / 2));background-image:url("./bg.png")}')
|
305
320
|
end
|
306
321
|
|
307
322
|
it "should pass all the original tests included in the YUI compressor package" do
|
@@ -311,7 +326,7 @@ describe "CSSminify2" do
|
|
311
326
|
|
312
327
|
for file in files do
|
313
328
|
print " -- testing #{file} ..."
|
314
|
-
CSSminify2.compress(File.read(file)).chomp.strip.
|
329
|
+
expect(CSSminify2.compress(File.read(file)).chomp.strip).to eq(File.read(file + '.min').chomp.strip)
|
315
330
|
print "successful\n"
|
316
331
|
end
|
317
332
|
end
|
data/spec/tests/README
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
(function(){var a=window;a.hello=function(a,b){a.alert("Hello, "+a)}})();
|
@@ -0,0 +1 @@
|
|
1
|
+
function test(){var b="abc"};
|
@@ -0,0 +1 @@
|
|
1
|
+
function test(){var b="a"+"b".toUpperCase()};
|
@@ -0,0 +1 @@
|
|
1
|
+
function test(){for(var c=0;c<3;c++){var b="a"+"bcd"[c]}};
|
@@ -0,0 +1,73 @@
|
|
1
|
+
|
2
|
+
window.$ = $telerik.$;
|
3
|
+
$(document).ready(function() {
|
4
|
+
movePageElements();
|
5
|
+
|
6
|
+
var text = $('textarea').val();
|
7
|
+
|
8
|
+
if (text != "")
|
9
|
+
$('textarea').attr("style", "display: block;");
|
10
|
+
else
|
11
|
+
$('textarea').attr("style", "display: none;");
|
12
|
+
|
13
|
+
//cleanup
|
14
|
+
text = null;
|
15
|
+
});
|
16
|
+
|
17
|
+
function movePageElements() {
|
18
|
+
var num = null;
|
19
|
+
var pagenum = $(".pagecontrolscontainer");
|
20
|
+
if (pagenum.length > 0) {
|
21
|
+
var num = pagenum.attr("pagenumber");
|
22
|
+
if ((num > 5) && (num < 28)) {
|
23
|
+
var x = $('div#commentbutton');
|
24
|
+
$("div.buttonContainer").prepend(x);
|
25
|
+
}
|
26
|
+
else {
|
27
|
+
$('div#commentbutton').attr("style", "display: none;");
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
//Add in dropshadowing
|
32
|
+
if ((num > 5) && (num < 28)) {
|
33
|
+
var top = $('.dropshadow-top');
|
34
|
+
var middle = $('#dropshadow');
|
35
|
+
var bottom = $('.dropshadow-bottom');
|
36
|
+
$('#page').prepend(top);
|
37
|
+
$('#topcontainer').after(middle);
|
38
|
+
middle.append($('#topcontainer'));
|
39
|
+
middle.after(bottom);
|
40
|
+
}
|
41
|
+
|
42
|
+
//cleanup
|
43
|
+
num = null;
|
44
|
+
pagenum = null;
|
45
|
+
top = null;
|
46
|
+
middle = null;
|
47
|
+
bottom=null;
|
48
|
+
}
|
49
|
+
|
50
|
+
function expandCollapseDiv(id) {
|
51
|
+
$telerik.$(id).slideToggle("slow");
|
52
|
+
}
|
53
|
+
|
54
|
+
function expandCollapseHelp() {
|
55
|
+
$('.helpitems').slideToggle("slow");
|
56
|
+
|
57
|
+
//Add in dropshadowing
|
58
|
+
if ($('#helpcontainer').length) {
|
59
|
+
$('#help-dropshadow-bot').insertAfter('#helpcontainer');
|
60
|
+
$('#help-dropshadow-bot').removeAttr("style");
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
function expandCollapseComments() {
|
65
|
+
var style = $('textarea').attr("style");
|
66
|
+
if (style == "display: none;")
|
67
|
+
$('textarea').fadeIn().focus();
|
68
|
+
else
|
69
|
+
$('textarea').fadeOut();
|
70
|
+
|
71
|
+
//cleanup
|
72
|
+
style = null;
|
73
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
window.$=$telerik.$;$(document).ready(function(){movePageElements();var a=$("textarea").val();if(a!=""){$("textarea").attr("style","display: block;")}else{$("textarea").attr("style","display: none;")}a=null});function movePageElements(){var e=null;var b=$(".pagecontrolscontainer");if(b.length>0){var e=b.attr("pagenumber");if((e>5)&&(e<28)){var a=$("div#commentbutton");$("div.buttonContainer").prepend(a)}else{$("div#commentbutton").attr("style","display: none;")}}if((e>5)&&(e<28)){var f=$(".dropshadow-top");var d=$("#dropshadow");var c=$(".dropshadow-bottom");$("#page").prepend(f);$("#topcontainer").after(d);d.append($("#topcontainer"));d.after(c)}e=null;b=null;f=null;d=null;c=null}function expandCollapseDiv(a){$telerik.$(a).slideToggle("slow")}function expandCollapseHelp(){$(".helpitems").slideToggle("slow");if($("#helpcontainer").length){$("#help-dropshadow-bot").insertAfter("#helpcontainer");$("#help-dropshadow-bot").removeAttr("style")}}function expandCollapseComments(){var a=$("textarea").attr("style");if(a=="display: none;"){$("textarea").fadeIn().focus()}else{$("textarea").fadeOut()}a=null};
|
data/spec/tests/border-none.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
a{border:0}b{background:0}s{border-top:0}
|
1
|
+
a{border:0}b{background:0}s{border-top:0;border-right:0;border-bottom:0;border-left:0}
|
@@ -0,0 +1 @@
|
|
1
|
+
.flex-text{flex:0 0}
|
@@ -0,0 +1 @@
|
|
1
|
+
:first-child :last-child{background-color:red}
|
@@ -0,0 +1 @@
|
|
1
|
+
.calculate-classname-test{width:calc(10% + 100px)}.background-url-test{content:'/foo/bar'}
|
@@ -0,0 +1 @@
|
|
1
|
+
.c1{color:#FF0000}.c2{color:#000080}.c3{color:#808080}.c4{color:#808000}.c5{color:#800080}.c6{color:#C0C0C0}.c7{color:#008080}.c8{color:#FFA500}.c9{color:#800000}
|
@@ -0,0 +1 @@
|
|
1
|
+
.c1{color:red}.c2{color:navy}.c3{color:gray}.c4{color:olive}.c5{color:purple}.c6{color:silver}.c7{color:teal}.c8{color:orange}.c9{color:maroon}
|
data/spec/tests/color.css
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
.color {
|
2
2
|
me: rgb(123, 123, 123);
|
3
|
+
test-overflow: rgb(1000, 500, 300);
|
3
4
|
impressed: #FfEedD;
|
4
5
|
again: #ABCDEF;
|
5
6
|
andagain:#aa66cc;
|
@@ -7,6 +8,7 @@
|
|
7
8
|
filter: chroma(color="#FFFFFF");
|
8
9
|
background: none repeat scroll 0 0 rgb(255, 0,0);
|
9
10
|
alpha: rgba(1, 2, 3, 4);
|
11
|
+
border-color: RGBA(1,2,3,4); /* tests uppercase RGBA() */
|
10
12
|
color:#1122aa
|
11
13
|
}
|
12
14
|
|
data/spec/tests/color.css.min
CHANGED
@@ -1 +1 @@
|
|
1
|
-
.color{me:#7b7b7b;impressed:#fed;again:#abcdef;andagain:#a6c;background-color:#aa66ccc;filter:chroma(color="#FFFFFF");background:none repeat scroll 0 0
|
1
|
+
.color{me:#7b7b7b;test-overflow:#fff;impressed:#fed;again:#abcdef;andagain:#a6c;background-color:#aa66ccc;filter:chroma(color="#FFFFFF");background:none repeat scroll 0 0 red;alpha:rgba(1,2,3,4);border-color:RGBA(1,2,3,4);color:#12a}#AABBCC{background-color:#fe1;filter:chroma(color = #FFFFFF);color:#412;foo:#0f1 #ABC #abc #123344;border-color:#aa66ccC}.foo #AABBCC{background-color:#fe1;color:#412;border-color:#AbC;filter:chroma(color= #FFFFFF)}.bar,#AABBCC{background-color:#fe1;border-color:#0f1 #abcdef;filter:chroma(color=#11FFFFFF);color:#412}.foo,#AABBCC.foobar{background-color:#fe1;border-color:#0f1 #abcdef #abc;color:#412}@media screen{.bar,#AABBCC{background-color:#fe1;color:#412}}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* This is invalid CSS, but frequently happens as a result of concatenation. */
|
2
|
-
@
|
2
|
+
@CHARSET "utf-8";
|
3
3
|
#foo {
|
4
4
|
border-width:1px;
|
5
5
|
}
|
@@ -12,4 +12,4 @@ The compressor should not get involved.
|
|
12
12
|
@charset "another one";
|
13
13
|
#bar {
|
14
14
|
border-width:10px;
|
15
|
-
}
|
15
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
@
|
1
|
+
@CHARSET "utf-8";#foo{border-width:1px}#bar{border-width:10px}
|
@@ -22,7 +22,7 @@ Bar
|
|
22
22
|
|
23
23
|
@font-face {
|
24
24
|
font-family: "Foo Bar";
|
25
|
-
src:
|
25
|
+
src: URL('data:font/truetype;base64,gRbIUFAIrsQNGditEWbAUKwAA') format("truetype"),
|
26
26
|
url("http://yuilibrary.com/fonts/foo-bar.svg#webfontse22fewwr") format("svg");
|
27
27
|
font-weight: normal;
|
28
28
|
font-style: normal;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<style>
|
4
|
+
div {
|
5
|
+
margin:10px;
|
6
|
+
}
|
7
|
+
|
8
|
+
div span {
|
9
|
+
background-color:#fff;
|
10
|
+
font-size:small;
|
11
|
+
}
|
12
|
+
</style>
|
13
|
+
<link rel="stylesheet" href="dataurl-nonbase64-doublequotes.css.min" type="text/css">
|
14
|
+
<link rel="stylesheet" href="dataurl-nonbase64-noquotes.css.min" type="text/css">
|
15
|
+
<link rel="stylesheet" href="dataurl-nonbase64-singlequotes.css.min" type="text/css">
|
16
|
+
<link rel="stylesheet" href="dataurl-base64-doublequotes.css.min" type="text/css">
|
17
|
+
<link rel="stylesheet" href="dataurl-base64-noquotes.css.min" type="text/css">
|
18
|
+
<link rel="stylesheet" href="dataurl-base64-singlequotes.css.min" type="text/css">
|
19
|
+
</head>
|
20
|
+
<body>
|
21
|
+
<div class="nonbase64-doublequotes"><span>non-base64 ("")</span></div>
|
22
|
+
<div class="nonbase64-noquotes"><span>non-base64 ()</span></div>
|
23
|
+
<div class="nonbase64-singlequotes"><span>non-base64 ('')</span></div>
|
24
|
+
|
25
|
+
<div class="base64-doublequotes"><span>base64 ("")</span></div>
|
26
|
+
<div class="base64-noquotes"><span>base64 ()</span></div>
|
27
|
+
<div class="base64-singlequotes"><span>base64 ('')</span></div>
|
28
|
+
</body>
|
29
|
+
</html>
|
data/spec/tests/float.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
obj.css({"float":"left"});obj.css({cssFloat:"left"});
|
@@ -0,0 +1 @@
|
|
1
|
+
.color_chip{color:hsl(27,0%,50%);background:rgba(195,198,214,0.85)}
|
@@ -0,0 +1 @@
|
|
1
|
+
@charset "UTF-8";label{padding-left:4px\9}
|
@@ -0,0 +1 @@
|
|
1
|
+
.issue-59{width:100%;width:-webkit-calc(100% + 30px);width:-moz-calc(100% + 30px);width:calc(100% + 30px);background-position:calc(65% - (100px - 350px * 0.65)) 0}
|
@@ -0,0 +1 @@
|
|
1
|
+
@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}
|
@@ -0,0 +1 @@
|
|
1
|
+
div{transform-origin:0;-ms-transform-origin:0}
|