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 CHANGED
@@ -1 +1 @@
1
- da2d3e225bd2eb195eef404a6dc5ae48e51b1fdc
1
+ 77ed5f71b755020c48ab0243b667a064b0510efb
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.0.alpha.353
1
+ 3.3.0.alpha.354
data/VERSION_DATE CHANGED
@@ -1 +1 @@
1
- 04 October 2013 22:23:30 GMT
1
+ 05 October 2013 01:29:09 GMT
data/lib/sass/selector.rb CHANGED
@@ -118,7 +118,7 @@ module Sass
118
118
 
119
119
  # @see AbstractSequence#specificity
120
120
  def specificity
121
- 0
121
+ SPECIFICITY_BASE
122
122
  end
123
123
  end
124
124
 
@@ -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
- min_spec = _sources(seq1).map {|seq| seq.specificity}.min || 0
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) >= min_spec && _superselector?(seq2, seq1)}
475
+ seqs2.any? {|seq2| _specificity(seq2) >= max_spec && _superselector?(seq2, seq1)}
476
476
  end
477
477
  end
478
478
  end
@@ -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: 592302543
4
+ hash: 592302537
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 3
9
9
  - 0
10
10
  - alpha
11
- - 353
12
- version: 3.3.0.alpha.353
11
+ - 354
12
+ version: 3.3.0.alpha.354
13
13
  platform: ruby
14
14
  authors:
15
15
  - Nathan Weizenbaum