sass 3.2.11 → 3.2.12
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/lib/sass/plugin/staleness_checker.rb +2 -0
- data/lib/sass/selector.rb +1 -1
- data/lib/sass/selector/sequence.rb +2 -2
- data/lib/sass/util.rb +1 -0
- data/test/sass/extend_test.rb +30 -9
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.2.
|
1
|
+
3.2.12
|
data/VERSION_DATE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
05 October 2013 01:29:11 UTC
|
data/lib/sass/selector.rb
CHANGED
@@ -450,7 +450,7 @@ module Sass
|
|
450
450
|
# separate sequences should limit the quadratic behavior.
|
451
451
|
seqses.each_with_index do |seqs1, i|
|
452
452
|
result[i] = seqs1.reject do |seq1|
|
453
|
-
|
453
|
+
max_spec = _sources(seq1).map {|seq| seq.specificity}.max || 0
|
454
454
|
result.any? do |seqs2|
|
455
455
|
next if seqs1.equal?(seqs2)
|
456
456
|
# Second Law of Extend: the specificity of a generated selector
|
@@ -458,7 +458,7 @@ module Sass
|
|
458
458
|
# selector.
|
459
459
|
#
|
460
460
|
# See https://github.com/nex3/sass/issues/324.
|
461
|
-
seqs2.any? {|seq2| _specificity(seq2) >=
|
461
|
+
seqs2.any? {|seq2| _specificity(seq2) >= max_spec && _superselector?(seq2, seq1)}
|
462
462
|
end
|
463
463
|
end
|
464
464
|
end
|
data/lib/sass/util.rb
CHANGED
data/test/sass/extend_test.rb
CHANGED
@@ -1207,6 +1207,27 @@ SCSS
|
|
1207
1207
|
end
|
1208
1208
|
end
|
1209
1209
|
|
1210
|
+
def test_multiple_source_redundancy_elimination
|
1211
|
+
assert_equal <<CSS, render(<<SCSS)
|
1212
|
+
.test-case, .test-case:active {
|
1213
|
+
color: red; }
|
1214
|
+
|
1215
|
+
.test-case:hover {
|
1216
|
+
color: green; }
|
1217
|
+
CSS
|
1218
|
+
%default-color {color: red}
|
1219
|
+
%alt-color {color: green}
|
1220
|
+
|
1221
|
+
%default-style {
|
1222
|
+
@extend %default-color;
|
1223
|
+
&:hover {@extend %alt-color}
|
1224
|
+
&:active {@extend %default-color}
|
1225
|
+
}
|
1226
|
+
|
1227
|
+
.test-case {@extend %default-style}
|
1228
|
+
SCSS
|
1229
|
+
end
|
1230
|
+
|
1210
1231
|
def test_nested_sibling_extend
|
1211
1232
|
assert_equal <<CSS, render(<<SCSS)
|
1212
1233
|
.parent .bar, .parent .foo {
|
@@ -1397,22 +1418,22 @@ SCSS
|
|
1397
1418
|
|
1398
1419
|
def test_extend_cross_branch_redundancy_elimination
|
1399
1420
|
assert_equal <<CSS, render(<<SCSS)
|
1400
|
-
a c d, b c a d {
|
1421
|
+
.a .c .d, .b .c .a .d {
|
1401
1422
|
a: b; }
|
1402
1423
|
CSS
|
1403
|
-
%x c %y {a: b}
|
1404
|
-
a, b {@extend %x}
|
1405
|
-
a d {@extend %y}
|
1424
|
+
%x .c %y {a: b}
|
1425
|
+
.a, .b {@extend %x}
|
1426
|
+
.a .d {@extend %y}
|
1406
1427
|
SCSS
|
1407
1428
|
|
1408
1429
|
assert_equal <<CSS, render(<<SCSS)
|
1409
|
-
e a c d, a c e d, e b c a d, b c a e d {
|
1430
|
+
.e .a .c .d, .a .c .e .d, .e .b .c .a .d, .b .c .a .e .d {
|
1410
1431
|
a: b; }
|
1411
1432
|
CSS
|
1412
|
-
e %z {a: b}
|
1413
|
-
%x c %y {@extend %z}
|
1414
|
-
a, b {@extend %x}
|
1415
|
-
a d {@extend %y}
|
1433
|
+
.e %z {a: b}
|
1434
|
+
%x .c %y {@extend %z}
|
1435
|
+
.a, .b {@extend %x}
|
1436
|
+
.a .d {@extend %y}
|
1416
1437
|
SCSS
|
1417
1438
|
end
|
1418
1439
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.12
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-
|
14
|
+
date: 2013-10-05 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: yard
|