sass 3.4.6 → 3.4.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25939bfbe2548dc0bc9ce36e84b69cb2097defab
4
- data.tar.gz: 70b91642e6e2f72c388d664ab4a322de692d70a6
3
+ metadata.gz: 6ce3a34b6410945928265cb2994c16ff2ba8fe8e
4
+ data.tar.gz: a298709397821b949d06896b2265ea6557fe402e
5
5
  SHA512:
6
- metadata.gz: 0ccbfbd420d684612d1826af5744004b728f480161f4fa241f417fd5edc78177c05de259520e26a4c4cab01779ee4e423043d6d2060c8cc1fec765bf6389acfc
7
- data.tar.gz: 11e59d8d04b67c8272533ec4081e2119c5ffe3cd0f652507cbf80ee400d2465bfe7aa4380bdde2225f6eea9d7112487871fc31016e96a0002d41990ff7ab919f
6
+ metadata.gz: e4326c4cef81a6972653a0fb2371c6d0d09225b3f52fcb2aaeb3e9c897ccdde23217dc10200e34afc3343fd5629404a71669bbe7aea7662be0bb2487d5718186
7
+ data.tar.gz: 1aaa2849ef7c65e26ce841d83453b5d31a99c1f44e6f74441b663f70ca5f9194cd5150bce442e0d4656c8d83e5d4ae4d25c85a861ad9118956f82fbbaad81c04
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.4.6
1
+ 3.4.7
@@ -1 +1 @@
1
- 17 October 2014 01:32:48 UTC
1
+ 31 October 2014 21:28:44 UTC
@@ -170,6 +170,9 @@ module Sass::Script
170
170
  # \{#nth nth($list, $n)}
171
171
  # : Returns a specific item in a list.
172
172
  #
173
+ # \{#set-nth set-nth($list, $n, $value)}
174
+ # : Replaces the nth item in a list.
175
+ #
173
176
  # \{#join join($list1, $list2, \[$separator\])}
174
177
  # : Joins together two lists into one.
175
178
  #
@@ -1287,7 +1290,7 @@ module Sass::Script
1287
1290
  # @param $color1 [Sass::Script::Value::Color]
1288
1291
  # @param $color2 [Sass::Script::Value::Color]
1289
1292
  # @param $weight [Sass::Script::Value::Number] The relative weight of each
1290
- # color. Closer to `0%` gives more weight to `$color`, closer to `100%`
1293
+ # color. Closer to `0%` gives more weight to `$color1`, closer to `100%`
1291
1294
  # gives more weight to `$color2`
1292
1295
  # @return [Sass::Script::Value::Color]
1293
1296
  # @raise [ArgumentError] if `$weight` is out of bounds or any parameter is
@@ -79,11 +79,23 @@ module Sass::Script::Tree
79
79
  end
80
80
 
81
81
  begin
82
- opts(value1.send(@operator, value2))
82
+ result = opts(value1.send(@operator, value2))
83
83
  rescue NoMethodError => e
84
84
  raise e unless e.name.to_s == @operator.to_s
85
85
  raise Sass::SyntaxError.new("Undefined operation: \"#{value1} #{@operator} #{value2}\".")
86
86
  end
87
+
88
+ if @operator == :eq && value1.is_a?(Sass::Script::Value::Number) &&
89
+ value2.is_a?(Sass::Script::Value::Number) && result == Sass::Script::Value::Bool::TRUE &&
90
+ value1.unitless? != value2.unitless?
91
+ Sass::Util.sass_warn <<WARNING
92
+ DEPRECATION WARNING on line #{line}#{" of #{filename}" if filename}:
93
+ The result of `#{value1} == #{value2}` will be `false` in future releases of Sass.
94
+ Unitless numbers will no longer be equal to the same numbers with units.
95
+ WARNING
96
+ end
97
+
98
+ result
87
99
  end
88
100
 
89
101
  private
@@ -490,8 +490,15 @@ module Sass
490
490
 
491
491
  if seq1[1].is_a?(String)
492
492
  return unless seq2[si + 1].is_a?(String)
493
+
493
494
  # .foo ~ .bar is a superselector of .foo + .bar
494
495
  return unless seq1[1] == "~" ? seq2[si + 1] != ">" : seq1[1] == seq2[si + 1]
496
+
497
+ # .foo > .baz is not a superselector of .foo > .bar > .baz or .foo >
498
+ # .bar .baz, despite the fact that .baz is a superselector of .bar >
499
+ # .baz and .bar .baz. Same goes for + and ~.
500
+ return if seq1.length == 3 && seq2.length > 3
501
+
495
502
  return _superselector?(seq1[2..-1], seq2[si + 2..-1])
496
503
  elsif seq2[si + 1].is_a?(String)
497
504
  return unless seq2[si + 1] == ">"
@@ -89,7 +89,7 @@ module Sass
89
89
  resolved_members = @members.map do |sel|
90
90
  next sel unless sel.is_a?(Pseudo) && sel.selector
91
91
  sel.with_selector(sel.selector.resolve_parent_refs(super_cseq, !:implicit_parent))
92
- end
92
+ end.flatten
93
93
 
94
94
  # Parent selector only appears as the first selector in the sequence
95
95
  unless (parent = resolved_members.first).is_a?(Parent)
@@ -514,6 +514,18 @@ CSS
514
514
  SCSS
515
515
  end
516
516
 
517
+ def test_nested_pseudo_selectors
518
+ assert_equal <<CSS, render(<<SCSS)
519
+ .foo .bar:not(.baz), .bang .bar:not(.baz) {
520
+ a: b; }
521
+ CSS
522
+ .foo {
523
+ .bar:not(.baz) {a: b}
524
+ }
525
+ .bang {@extend .foo}
526
+ SCSS
527
+ end
528
+
517
529
  ## Long Extendees
518
530
 
519
531
  def test_long_extendee
@@ -458,8 +458,13 @@ SASS
458
458
  assert_equal "2in", resolve("1in + 96px")
459
459
  assert_equal "true", resolve("2mm < 1cm")
460
460
  assert_equal "true", resolve("10mm == 1cm")
461
- assert_equal "true", resolve("1 == 1cm")
462
461
  assert_equal "true", resolve("1.1cm == 11mm")
462
+
463
+ assert_warning(<<WARNING) {assert_equal "true", resolve("1 == 1cm")}
464
+ DEPRECATION WARNING on line 1 of test_operator_unit_conversion_inline.sass:
465
+ The result of `1 == 1cm` will be `false` in future releases of Sass.
466
+ Unitless numbers will no longer be equal to the same numbers with units.
467
+ WARNING
463
468
  end
464
469
 
465
470
  def test_length_units
@@ -55,6 +55,25 @@ class SuperselectorTest < MiniTest::Test
55
55
  def test_descendant_is_superselector_of_child
56
56
  assert_strict_superselector '.foo .bar', '.foo > .bar.baz'
57
57
  assert_strict_superselector '.foo .bar', '.foo.baz > .bar'
58
+ assert_strict_superselector '.foo .baz', '.foo > .bar > .baz'
59
+ end
60
+
61
+ def test_child_isnt_superselector_of_longer_child
62
+ refute_superselector '.foo > .baz', '.foo > .bar > .baz'
63
+ refute_superselector '.foo > .baz', '.foo > .bar .baz'
64
+ end
65
+
66
+ def test_following_sibling_isnt_superselector_of_longer_following_sibling
67
+ refute_superselector '.foo + .baz', '.foo + .bar + .baz'
68
+ refute_superselector '.foo + .baz', '.foo + .bar .baz'
69
+ end
70
+
71
+ def test_sibling_isnt_superselector_of_longer_sibling
72
+ # This actually is a superselector, but it's a very narrow edge case and
73
+ # detecting it is very difficult and may be exponential in the worst case.
74
+ refute_superselector '.foo ~ .baz', '.foo ~ .bar ~ .baz'
75
+
76
+ refute_superselector '.foo ~ .baz', '.foo ~ .bar .baz'
58
77
  end
59
78
 
60
79
  def test_matches_is_superselector_of_constituent_selectors
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.4.6
4
+ version: 3.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Natalie Weizenbaum
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-10-17 00:00:00.000000000 Z
13
+ date: 2014-10-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: yard