sass 3.3.0.alpha.353 → 3.3.0.alpha.354
Sign up to get free protection for your applications and to get access to all the features.
- data/REVISION +1 -1
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/lib/sass/selector.rb +1 -1
- data/lib/sass/selector/sequence.rb +2 -2
- data/test/sass/extend_test.rb +30 -9
- metadata +3 -3
data/REVISION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
77ed5f71b755020c48ab0243b667a064b0510efb
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.3.0.alpha.
|
1
|
+
3.3.0.alpha.354
|
data/VERSION_DATE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
05 October 2013 01:29:09 GMT
|
data/lib/sass/selector.rb
CHANGED
@@ -464,7 +464,7 @@ module Sass
|
|
464
464
|
# separate sequences should limit the quadratic behavior.
|
465
465
|
seqses.each_with_index do |seqs1, i|
|
466
466
|
result[i] = seqs1.reject do |seq1|
|
467
|
-
|
467
|
+
max_spec = _sources(seq1).map {|seq| seq.specificity}.max || 0
|
468
468
|
result.any? do |seqs2|
|
469
469
|
next if seqs1.equal?(seqs2)
|
470
470
|
# Second Law of Extend: the specificity of a generated selector
|
@@ -472,7 +472,7 @@ module Sass
|
|
472
472
|
# selector.
|
473
473
|
#
|
474
474
|
# See https://github.com/nex3/sass/issues/324.
|
475
|
-
seqs2.any? {|seq2| _specificity(seq2) >=
|
475
|
+
seqs2.any? {|seq2| _specificity(seq2) >= max_spec && _superselector?(seq2, seq1)}
|
476
476
|
end
|
477
477
|
end
|
478
478
|
end
|
data/test/sass/extend_test.rb
CHANGED
@@ -1151,6 +1151,27 @@ SCSS
|
|
1151
1151
|
end
|
1152
1152
|
end
|
1153
1153
|
|
1154
|
+
def test_multiple_source_redundancy_elimination
|
1155
|
+
assert_equal <<CSS, render(<<SCSS)
|
1156
|
+
.test-case, .test-case:active {
|
1157
|
+
color: red; }
|
1158
|
+
|
1159
|
+
.test-case:hover {
|
1160
|
+
color: green; }
|
1161
|
+
CSS
|
1162
|
+
%default-color {color: red}
|
1163
|
+
%alt-color {color: green}
|
1164
|
+
|
1165
|
+
%default-style {
|
1166
|
+
@extend %default-color;
|
1167
|
+
&:hover {@extend %alt-color}
|
1168
|
+
&:active {@extend %default-color}
|
1169
|
+
}
|
1170
|
+
|
1171
|
+
.test-case {@extend %default-style}
|
1172
|
+
SCSS
|
1173
|
+
end
|
1174
|
+
|
1154
1175
|
def test_nested_sibling_extend
|
1155
1176
|
assert_equal <<CSS, render(<<SCSS)
|
1156
1177
|
.parent .bar, .parent .foo {
|
@@ -1341,22 +1362,22 @@ SCSS
|
|
1341
1362
|
|
1342
1363
|
def test_extend_cross_branch_redundancy_elimination
|
1343
1364
|
assert_equal <<CSS, render(<<SCSS)
|
1344
|
-
a c d, b c a d {
|
1365
|
+
.a .c .d, .b .c .a .d {
|
1345
1366
|
a: b; }
|
1346
1367
|
CSS
|
1347
|
-
%x c %y {a: b}
|
1348
|
-
a, b {@extend %x}
|
1349
|
-
a d {@extend %y}
|
1368
|
+
%x .c %y {a: b}
|
1369
|
+
.a, .b {@extend %x}
|
1370
|
+
.a .d {@extend %y}
|
1350
1371
|
SCSS
|
1351
1372
|
|
1352
1373
|
assert_equal <<CSS, render(<<SCSS)
|
1353
|
-
e a c d, a c e d, e b c a d, b c a e d {
|
1374
|
+
.e .a .c .d, .a .c .e .d, .e .b .c .a .d, .b .c .a .e .d {
|
1354
1375
|
a: b; }
|
1355
1376
|
CSS
|
1356
|
-
e %z {a: b}
|
1357
|
-
%x c %y {@extend %z}
|
1358
|
-
a, b {@extend %x}
|
1359
|
-
a d {@extend %y}
|
1377
|
+
.e %z {a: b}
|
1378
|
+
%x .c %y {@extend %z}
|
1379
|
+
.a, .b {@extend %x}
|
1380
|
+
.a .d {@extend %y}
|
1360
1381
|
SCSS
|
1361
1382
|
end
|
1362
1383
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 592302537
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 3
|
9
9
|
- 0
|
10
10
|
- alpha
|
11
|
-
-
|
12
|
-
version: 3.3.0.alpha.
|
11
|
+
- 354
|
12
|
+
version: 3.3.0.alpha.354
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Nathan Weizenbaum
|