compass 0.13.alpha.7 → 0.13.alpha.8

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.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION.yml +1 -1
  3. data/frameworks/compass/stylesheets/compass/_support.scss +136 -62
  4. data/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +1 -1
  5. data/frameworks/compass/stylesheets/compass/css3/_flexbox.scss +11 -2
  6. data/frameworks/compass/stylesheets/compass/css3/_inline-block.scss +2 -2
  7. data/frameworks/compass/stylesheets/compass/css3/_opacity.scss +1 -1
  8. data/frameworks/compass/stylesheets/compass/css3/_user-interface.scss +1 -1
  9. data/frameworks/compass/stylesheets/compass/typography/lists/_horizontal-list.scss +2 -2
  10. data/frameworks/compass/stylesheets/compass/typography/lists/_inline-list.scss +1 -1
  11. data/frameworks/compass/stylesheets/compass/utilities/general/_float.scss +3 -3
  12. data/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +6 -6
  13. data/lib/compass/browser_support.rb +2 -2
  14. data/lib/compass/caniuse.rb +55 -19
  15. data/lib/compass/sass_extensions/functions/cross_browser_support.rb +34 -10
  16. data/test/fixtures/stylesheets/compass/css/animation-with-legacy-ie.css +0 -3
  17. data/test/fixtures/stylesheets/compass/css/animation.css +0 -3
  18. data/test/fixtures/stylesheets/compass/css/filters.css +30 -6
  19. data/test/fixtures/stylesheets/compass/css/gradients.css +7 -2
  20. data/test/fixtures/stylesheets/compass/css/support.css +23 -16
  21. data/test/fixtures/stylesheets/compass/sass/support.scss +45 -8
  22. data/test/fixtures/stylesheets/envtest/tmp/env.css +3 -3
  23. data/test/units/caniuse_test.rb +29 -10
  24. metadata +3 -91
  25. data/test/fixtures/stylesheets/compass/tmp/animation-with-legacy-ie.css +0 -22
  26. data/test/fixtures/stylesheets/compass/tmp/animation.css +0 -22
  27. data/test/fixtures/stylesheets/compass/tmp/appearance.css +0 -3
  28. data/test/fixtures/stylesheets/compass/tmp/background-clip.css +0 -11
  29. data/test/fixtures/stylesheets/compass/tmp/background-origin.css +0 -11
  30. data/test/fixtures/stylesheets/compass/tmp/background-size.css +0 -17
  31. data/test/fixtures/stylesheets/compass/tmp/border_radius.css +0 -14
  32. data/test/fixtures/stylesheets/compass/tmp/box-sizing.css +0 -9
  33. data/test/fixtures/stylesheets/compass/tmp/box.css +0 -103
  34. data/test/fixtures/stylesheets/compass/tmp/box_shadow.css +0 -24
  35. data/test/fixtures/stylesheets/compass/tmp/brightness.css +0 -14
  36. data/test/fixtures/stylesheets/compass/tmp/browser-support.css +0 -306
  37. data/test/fixtures/stylesheets/compass/tmp/color.css +0 -18
  38. data/test/fixtures/stylesheets/compass/tmp/columns.css +0 -134
  39. data/test/fixtures/stylesheets/compass/tmp/filters.css +0 -29
  40. data/test/fixtures/stylesheets/compass/tmp/flexbox.css +0 -94
  41. data/test/fixtures/stylesheets/compass/tmp/fonts.css +0 -4
  42. data/test/fixtures/stylesheets/compass/tmp/force-wrap.css +0 -9
  43. data/test/fixtures/stylesheets/compass/tmp/gradients.css +0 -230
  44. data/test/fixtures/stylesheets/compass/tmp/grid_background.css +0 -64
  45. data/test/fixtures/stylesheets/compass/tmp/hyphenation.css +0 -16
  46. data/test/fixtures/stylesheets/compass/tmp/image_size.css +0 -15
  47. data/test/fixtures/stylesheets/compass/tmp/images.css +0 -8
  48. data/test/fixtures/stylesheets/compass/tmp/layout.css +0 -16
  49. data/test/fixtures/stylesheets/compass/tmp/legacy_clearfix.css +0 -26
  50. data/test/fixtures/stylesheets/compass/tmp/lists.css +0 -145
  51. data/test/fixtures/stylesheets/compass/tmp/opacity.css +0 -3
  52. data/test/fixtures/stylesheets/compass/tmp/print.css +0 -11
  53. data/test/fixtures/stylesheets/compass/tmp/regions.css +0 -9
  54. data/test/fixtures/stylesheets/compass/tmp/replacement.css +0 -59
  55. data/test/fixtures/stylesheets/compass/tmp/reset.css +0 -59
  56. data/test/fixtures/stylesheets/compass/tmp/selection.css +0 -50
  57. data/test/fixtures/stylesheets/compass/tmp/sprites.css +0 -1263
  58. data/test/fixtures/stylesheets/compass/tmp/sprites_with_explicit_separator.css +0 -16
  59. data/test/fixtures/stylesheets/compass/tmp/stretching.css +0 -66
  60. data/test/fixtures/stylesheets/compass/tmp/support.css +0 -59
  61. data/test/fixtures/stylesheets/compass/tmp/text_shadow.css +0 -29
  62. data/test/fixtures/stylesheets/compass/tmp/transform.css +0 -369
  63. data/test/fixtures/stylesheets/compass/tmp/transition.css +0 -116
  64. data/test/fixtures/stylesheets/compass/tmp/typography/links/hover-link.css +0 -4
  65. data/test/fixtures/stylesheets/compass/tmp/units.css +0 -30
  66. data/test/fixtures/stylesheets/compass/tmp/user-interface.css +0 -52
  67. data/test/fixtures/stylesheets/compass/tmp/utilities.css +0 -71
  68. data/test/fixtures/stylesheets/compass/tmp/vertical_rhythm.css +0 -211
@@ -5,8 +5,8 @@ module Compass
5
5
  ASPECTS = %w(webkit moz o ms svg css2)
6
6
 
7
7
  SIMPLE_FUNCTIONS = {
8
- "image" => %w(), # No browsers implement this yet.
9
- "cross-fade" => %w() # No browsers implement this yet.
8
+ "image" => %w(webkit),
9
+ "cross-fade" => %w(webkit)
10
10
  }
11
11
 
12
12
  # Adds support for one or more aspects for the given simple function
@@ -76,34 +76,58 @@ class Compass::CanIUse
76
76
  result
77
77
  end
78
78
 
79
- def browser_minimums(capability, prefix = nil)
79
+ def browser_ranges(capability, prefix = nil, include_unprefixed_versions = true)
80
80
  assert_valid_capability capability
81
81
  browsers = prefix.nil? ? browsers() : browsers_with_prefix(prefix)
82
82
  browsers.inject({}) do |m, browser|
83
- version = versions(browser).find do |version|
84
- support = browser_support(browser, version, capability)
85
- if prefix.nil?
86
- support !~ /\bn\b/ && support !~ /\bx\b/
87
- else
88
- actual_prefix = prefix(browser, version)
89
- support !~ /\bn\b/ && support =~ /\bx\b/ && prefix == actual_prefix
90
- end
91
- end
92
- m.update(browser => version) if version
83
+ browser_versions = versions(browser)
84
+ min_version = find_first_prefixed_version(browser, browser_versions, capability, prefix)
85
+ if min_version
86
+ max_version = if include_unprefixed_versions
87
+ browser_versions.last
88
+ else
89
+ find_first_prefixed_version(browser, browser_versions.reverse, capability, prefix)
90
+ end
91
+ m.update(browser => [min_version, max_version])
92
+ end
93
93
  m
94
94
  end
95
95
  end
96
96
 
97
- # How many users would be omitted if support for the given browser starts
98
- # with the given version.
99
- def omitted_usage(browser, min_version)
100
- assert_valid_browser browser
97
+ def find_first_prefixed_version(browser, versions, capability, prefix)
98
+ versions.find do |version|
99
+ support = browser_support(browser, version, capability)
100
+ if prefix.nil?
101
+ support !~ /\bn\b/ && support !~ /\bx\b/
102
+ else
103
+ actual_prefix = prefix(browser, version)
104
+ support !~ /\bn\b/ && support =~ /\bx\b/ && prefix == actual_prefix
105
+ end
106
+ end
107
+ end
108
+
109
+ # @overload omitted_usage(browser, min_supported_version)
110
+ # How many users would be omitted if support for the given browser starts
111
+ # with the given version.
112
+ #
113
+ # @overload omitted_usage(browser, min_unsupported_version, max_unsupported_version)
114
+ # How many users would be omitted if the browsers with version
115
+ def omitted_usage(browser, min_version, max_version = nil)
116
+ versions = versions(browser)
117
+ if max_version.nil?
118
+ assert_valid_version browser, min_version
119
+ else
120
+ assert_valid_version browser, min_version, max_version
121
+ end
101
122
  usage = 0
102
- versions(browser).each do |version|
103
- return usage if version == min_version
104
- usage += usage(browser, version)
123
+ in_range = max_version.nil?
124
+ versions.each do |version|
125
+ break if max_version.nil? && version == min_version
126
+ in_range = true if (!max_version.nil? && version == min_version)
127
+ usage += usage(browser, version) if in_range
128
+ break if !max_version.nil? && version == max_version
105
129
  end
106
- raise ArgumentError, "#{min_version} is not a version for #{browser}"
130
+ return usage
107
131
  end
108
132
 
109
133
  # returns the list of browsers that use the given prefix
@@ -150,6 +174,18 @@ class Compass::CanIUse
150
174
  usage
151
175
  end
152
176
 
177
+ def next_version(browser, version)
178
+ versions = versions(browser)
179
+ index = versions.index(version)
180
+ index < versions.length - 1 ? versions[index + 1] : nil
181
+ end
182
+
183
+ def previous_version(browser, version)
184
+ versions = versions(browser)
185
+ index = versions.index(version)
186
+ index > 0 ? versions[index - 1] : nil
187
+ end
188
+
153
189
  # Returns whether the given minimum version of a browser
154
190
  # requires the use of a prefix for the stated capability.
155
191
  def requires_prefix(browser, min_version, capability, capability_options_list)
@@ -139,12 +139,34 @@ module Compass::SassExtensions::Functions::CrossBrowserSupport
139
139
 
140
140
  # The percent of users that are omitted by setting the min_version of browser
141
141
  # as specified.
142
- def omitted_usage(browser, min_version)
142
+ def omitted_usage(browser, min_version, max_version = nil)
143
143
  assert_type browser, :String
144
- assert_type min_version, :String
145
- number(Compass::CanIUse.instance.omitted_usage(browser.value, min_version.value))
144
+ assert_type min_version, :String, :min_version
145
+ assert_type(max_version, :String, :max_version) if max_version
146
+ versions = [min_version.value]
147
+ versions << max_version.value if max_version
148
+ number(Compass::CanIUse.instance.omitted_usage(browser.value, *versions))
146
149
  end
147
150
  Sass::Script::Functions.declare(:omitted_usage, [:browser, :min_version])
151
+ Sass::Script::Functions.declare(:omitted_usage, [:browser, :min_version, :max_version])
152
+
153
+ # The version before the version for the browser specified
154
+ def previous_version(browser, version)
155
+ assert_type browser, :String
156
+ assert_type version, :String
157
+ previous = Compass::CanIUse.instance.previous_version(browser.value, version.value)
158
+ previous.nil? ? null() : quoted_string(previous)
159
+ end
160
+ Sass::Script::Functions.declare(:previous_version, [:browser, :version])
161
+
162
+ # The version before the version for the browser specified
163
+ def next_version(browser, version)
164
+ assert_type browser, :String
165
+ assert_type version, :String
166
+ next_version = Compass::CanIUse.instance.next_version(browser.value, version.value)
167
+ next_version.nil? ? null() : quoted_string(next_version)
168
+ end
169
+ Sass::Script::Functions.declare(:next_version, [:browser, :version])
148
170
 
149
171
  # The percent of users relying on a particular prefix
150
172
  def prefix_usage(prefix, capability, capability_options)
@@ -164,9 +186,9 @@ module Compass::SassExtensions::Functions::CrossBrowserSupport
164
186
  # * <0 if the first version is less than the second
165
187
  # * >0 if the first version is more than the second
166
188
  def compare_browser_versions(browser, version1, version2)
167
- assert_type browser, :String
168
- assert_type version1, :String
169
- assert_type version2, :String
189
+ assert_type browser, :String, :browser
190
+ assert_type version1, :String, :version1
191
+ assert_type version2, :String, :version2
170
192
  index1 = index2 = nil
171
193
  Compass::CanIUse.instance.versions(browser.value).each_with_index do |v, i|
172
194
  index1 = i if v == version1.value
@@ -191,12 +213,14 @@ module Compass::SassExtensions::Functions::CrossBrowserSupport
191
213
  # without a prefix.
192
214
  #
193
215
  # If a browser does not have the capability, it will not included in the map.
194
- def browser_minimums(capability, prefix = null())
216
+ def browser_ranges(capability, prefix = null(), include_unprefixed_versions = bool(true))
195
217
  assert_type capability, :String
196
218
  assert_type(prefix, :String) unless prefix == null()
197
- mins = Compass::CanIUse.instance.browser_minimums(capability.value, prefix.value)
198
- Sass::Script::Value::Map.new(mins.inject({}) do |m, (h, k)|
199
- m[identifier(h)] = quoted_string(k)
219
+ mins = Compass::CanIUse.instance.browser_ranges(capability.value,
220
+ prefix.value,
221
+ include_unprefixed_versions.to_bool)
222
+ Sass::Script::Value::Map.new(mins.inject({}) do |m, (h, range)|
223
+ m[identifier(h)] = list(range.map{|version| quoted_string(version)}, :space)
200
224
  m
201
225
  end)
202
226
  end
@@ -4,21 +4,18 @@
4
4
 
5
5
  50% {
6
6
  opacity: 0; } }
7
-
8
7
  @-webkit-keyframes test {
9
8
  0%, 100% {
10
9
  opacity: 1; }
11
10
 
12
11
  50% {
13
12
  opacity: 0; } }
14
-
15
13
  @keyframes test {
16
14
  0%, 100% {
17
15
  opacity: 1; }
18
16
 
19
17
  50% {
20
18
  opacity: 0; } }
21
-
22
19
  .animation {
23
20
  -moz-animation: test;
24
21
  -webkit-animation: test;
@@ -4,21 +4,18 @@
4
4
 
5
5
  50% {
6
6
  background-color: blue; } }
7
-
8
7
  @-webkit-keyframes test {
9
8
  0%, 100% {
10
9
  background-color: red; }
11
10
 
12
11
  50% {
13
12
  background-color: blue; } }
14
-
15
13
  @keyframes test {
16
14
  0%, 100% {
17
15
  background-color: red; }
18
16
 
19
17
  50% {
20
18
  background-color: blue; } }
21
-
22
19
  .animation {
23
20
  -moz-animation: test;
24
21
  -webkit-animation: test;
@@ -1,29 +1,53 @@
1
1
  .blur {
2
- /* Capability css-filters is prefixed with -webkit because omitting it would affect 42.57254% of users and the threshold is 0.1%. */
2
+ /* Capability css-filters is not prefixed with -moz because 0% of users are affected which is less than the threshold of 0.1. */
3
+ /* Capability css-filters is not prefixed with -ms because 0% of users are affected which is less than the threshold of 0.1. */
4
+ /* Capability css-filters is not prefixed with -o because 0% of users are affected which is less than the threshold of 0.1. */
5
+ /* Capability css-filters is prefixed with -webkit because 42.57254% of users need it which is more than the threshold of 0.1%. */
6
+ /* Creating new -webkit context. */
3
7
  -webkit-filter: blur(5px);
4
8
  filter: blur(5px); }
5
9
 
6
10
  .brightness {
7
- /* Capability css-filters is prefixed with -webkit because omitting it would affect 42.57254% of users and the threshold is 0.1%. */
11
+ /* Capability css-filters is not prefixed with -moz because 0% of users are affected which is less than the threshold of 0.1. */
12
+ /* Capability css-filters is not prefixed with -ms because 0% of users are affected which is less than the threshold of 0.1. */
13
+ /* Capability css-filters is not prefixed with -o because 0% of users are affected which is less than the threshold of 0.1. */
14
+ /* Capability css-filters is prefixed with -webkit because 42.57254% of users need it which is more than the threshold of 0.1%. */
15
+ /* Creating new -webkit context. */
8
16
  -webkit-filter: brightness(0.2);
9
17
  filter: brightness(0.2); }
10
18
 
11
19
  .hue-rotate {
12
- /* Capability css-filters is prefixed with -webkit because omitting it would affect 42.57254% of users and the threshold is 0.1%. */
20
+ /* Capability css-filters is not prefixed with -moz because 0% of users are affected which is less than the threshold of 0.1. */
21
+ /* Capability css-filters is not prefixed with -ms because 0% of users are affected which is less than the threshold of 0.1. */
22
+ /* Capability css-filters is not prefixed with -o because 0% of users are affected which is less than the threshold of 0.1. */
23
+ /* Capability css-filters is prefixed with -webkit because 42.57254% of users need it which is more than the threshold of 0.1%. */
24
+ /* Creating new -webkit context. */
13
25
  -webkit-filter: hue-rotate(20deg);
14
26
  filter: hue-rotate(20deg); }
15
27
 
16
28
  .contrast {
17
- /* Capability css-filters is prefixed with -webkit because omitting it would affect 42.57254% of users and the threshold is 0.1%. */
29
+ /* Capability css-filters is not prefixed with -moz because 0% of users are affected which is less than the threshold of 0.1. */
30
+ /* Capability css-filters is not prefixed with -ms because 0% of users are affected which is less than the threshold of 0.1. */
31
+ /* Capability css-filters is not prefixed with -o because 0% of users are affected which is less than the threshold of 0.1. */
32
+ /* Capability css-filters is prefixed with -webkit because 42.57254% of users need it which is more than the threshold of 0.1%. */
33
+ /* Creating new -webkit context. */
18
34
  -webkit-filter: contrast(150%);
19
35
  filter: contrast(150%); }
20
36
 
21
37
  .grayscale {
22
- /* Capability css-filters is prefixed with -webkit because omitting it would affect 42.57254% of users and the threshold is 0.1%. */
38
+ /* Capability css-filters is not prefixed with -moz because 0% of users are affected which is less than the threshold of 0.1. */
39
+ /* Capability css-filters is not prefixed with -ms because 0% of users are affected which is less than the threshold of 0.1. */
40
+ /* Capability css-filters is not prefixed with -o because 0% of users are affected which is less than the threshold of 0.1. */
41
+ /* Capability css-filters is prefixed with -webkit because 42.57254% of users need it which is more than the threshold of 0.1%. */
42
+ /* Creating new -webkit context. */
23
43
  -webkit-filter: grayscale(150%);
24
44
  filter: grayscale(150%); }
25
45
 
26
46
  .sepia {
27
- /* Capability css-filters is prefixed with -webkit because omitting it would affect 42.57254% of users and the threshold is 0.1%. */
47
+ /* Capability css-filters is not prefixed with -moz because 0% of users are affected which is less than the threshold of 0.1. */
48
+ /* Capability css-filters is not prefixed with -ms because 0% of users are affected which is less than the threshold of 0.1. */
49
+ /* Capability css-filters is not prefixed with -o because 0% of users are affected which is less than the threshold of 0.1. */
50
+ /* Capability css-filters is prefixed with -webkit because 42.57254% of users need it which is more than the threshold of 0.1%. */
51
+ /* Creating new -webkit context. */
28
52
  -webkit-filter: sepia(150%);
29
53
  filter: sepia(150%); }
@@ -128,9 +128,14 @@
128
128
 
129
129
  .border-image-gradient {
130
130
  -moz-border-image: -moz-radial-gradient(#00ff00, #ff0000 100px) 100 stretch;
131
+ -moz-border-image: radial-gradient(#00ff00, #ff0000 100px) 100 stretch;
131
132
  -o-border-image: -o-radial-gradient(#00ff00, #ff0000 100px) 100 stretch;
133
+ -o-border-image: radial-gradient(#00ff00, #ff0000 100px) 100 stretch;
132
134
  -webkit-border-image: -webkit-radial-gradient(#00ff00, #ff0000 100px) 100 stretch;
135
+ -webkit-border-image: radial-gradient(#00ff00, #ff0000 100px) 100 stretch;
136
+ border-image: -moz-radial-gradient(#00ff00, #ff0000 100px) 100 stretch;
133
137
  border-image: -o-radial-gradient(#00ff00, #ff0000 100px) 100 stretch;
138
+ border-image: -webkit-radial-gradient(#00ff00, #ff0000 100px) 100 stretch;
134
139
  border-image: radial-gradient(#00ff00, #ff0000 100px) 100 stretch; }
135
140
 
136
141
  .direct-list-image-plain {
@@ -178,13 +183,13 @@
178
183
  .image-fallback {
179
184
  background-image: image(-moz-radial-gradient(#dddddd, #aaaaaa 100px), url('/images/4x6.png?busted=true'), #cc0000);
180
185
  background-image: image(-o-radial-gradient(#dddddd, #aaaaaa 100px), url('/images/4x6.png?busted=true'), #cc0000);
181
- background-image: image(-webkit-radial-gradient(#dddddd, #aaaaaa 100px), url('/images/4x6.png?busted=true'), #cc0000);
186
+ background-image: -webkit-image(-webkit-radial-gradient(#dddddd, #aaaaaa 100px), url('/images/4x6.png?busted=true'), #cc0000);
182
187
  background-image: image(radial-gradient(#dddddd, #aaaaaa 100px), url('/images/4x6.png?busted=true'), #cc0000); }
183
188
 
184
189
  .cross-fade {
185
190
  background-image: cross-fade(-moz-radial-gradient(#dddddd, #aaaaaa 100px), url('/images/4x6.png?busted=true'));
186
191
  background-image: cross-fade(-o-radial-gradient(#dddddd, #aaaaaa 100px), url('/images/4x6.png?busted=true'));
187
- background-image: cross-fade(-webkit-radial-gradient(#dddddd, #aaaaaa 100px), url('/images/4x6.png?busted=true'));
192
+ background-image: -webkit-cross-fade(-webkit-radial-gradient(#dddddd, #aaaaaa 100px), url('/images/4x6.png?busted=true'));
188
193
  background-image: cross-fade(radial-gradient(#dddddd, #aaaaaa 100px), url('/images/4x6.png?busted=true')); }
189
194
 
190
195
  .unknown-function-wrapper {
@@ -8,55 +8,62 @@
8
8
  /* - [function] support-legacy-browser() from threshold (2 assertions, 2 passed, 0 failed) */
9
9
  /* - [function] support-legacy-browser() from minimums (2 assertions, 2 passed, 0 failed) */
10
10
  /* - [function] browser-out-of-scope() with no scope (2 assertions, 2 passed, 0 failed) */
11
+ /* - prefix context tracking (9 assertions, 9 passed, 0 failed) */
11
12
  /* - [function] browser-out-of-scope() with a scope (2 assertions, 2 passed, 0 failed) */
12
13
  /* - [function] browser-out-of-scope() with version (3 assertions, 3 passed, 0 failed) */
13
14
  /* - [mixin] with-prefix() (4 assertions, 4 passed, 0 failed) */
14
15
  /* - [mixin] with-each-prefix() (1 assertions, 1 passed, 0 failed) */
15
16
  /* - [mixin] with-each-prefix() respects $supported-browsers (1 assertions, 1 passed, 0 failed) */
16
- /* - [mixin] with-each-prefix() respects $current-prefix (2 assertions, 2 passed, 0 failed) */
17
+ /* - [mixin] with-each-prefix() respects $current-prefix (3 assertions, 3 passed, 0 failed) */
18
+ /* - [fuction] has-browser-subset() (5 assertions, 5 passed, 0 failed) */
17
19
  /*
18
20
  Summary:
19
- - 13 Tests
20
- - 13 Passed
21
+ - 15 Tests
22
+ - 15 Passed
21
23
  - 0 Failed */
22
- /* Capability css-animation is prefixed with -moz because omitting it would affect 1.03559% of users and the threshold is 0.1%. */
24
+ /* Capability css-animation is prefixed with -moz because 1.03559% of users need it which is more than the threshold of 0.1%. */
25
+ /* Creating new -moz context. */
23
26
  @-moz-keyframes foo {
24
27
  0% {
25
28
  /* Content for ie 8 omitted.
26
- Not allowed in the current scope: The ie 8 is incompatible with -moz. */
29
+ Not allowed in the current scope: ie 8 is incompatible with -moz. */
27
30
  opacity: 0; }
28
31
 
29
32
  100% {
30
33
  /* Content for ie 8 omitted.
31
- Not allowed in the current scope: The ie 8 is incompatible with -moz. */
34
+ Not allowed in the current scope: ie 8 is incompatible with -moz. */
32
35
  opacity: 1; } }
33
-
34
- /* Capability css-animation is prefixed with -webkit because omitting it would affect 51.42143% of users and the threshold is 0.1%. */
36
+ /* Capability css-animation is not prefixed with -ms because 0% of users are affected which is less than the threshold of 0.1. */
37
+ /* Capability css-animation is not prefixed with -o because 0.04931% of users are affected which is less than the threshold of 0.1. */
38
+ /* Capability css-animation is prefixed with -webkit because 51.42143% of users need it which is more than the threshold of 0.1%. */
39
+ /* Creating new -webkit context. */
35
40
  @-webkit-keyframes foo {
36
41
  0% {
37
42
  /* Content for ie 8 omitted.
38
- Not allowed in the current scope: The ie 8 is incompatible with -webkit. */
43
+ Not allowed in the current scope: ie 8 is incompatible with -webkit. */
39
44
  opacity: 0; }
40
45
 
41
46
  100% {
42
47
  /* Content for ie 8 omitted.
43
- Not allowed in the current scope: The ie 8 is incompatible with -webkit. */
48
+ Not allowed in the current scope: ie 8 is incompatible with -webkit. */
44
49
  opacity: 1; } }
45
-
46
50
  @keyframes foo {
47
51
  0% {
48
52
  /* Content for ie 8 omitted.
49
- Not allowed in the current scope: The current scope only works with ie 10 or greater. */
53
+ Not allowed in the current scope: The current scope only works with ie 10 - 11. */
50
54
  opacity: 0; }
51
55
 
52
56
  100% {
53
57
  /* Content for ie 8 omitted.
54
- Not allowed in the current scope: The current scope only works with ie 10 or greater. */
58
+ Not allowed in the current scope: The current scope only works with ie 10 - 11. */
55
59
  opacity: 1; } }
56
-
57
60
  .foo {
58
- /* Capability css-animation is prefixed with -moz because omitting it would affect 1.03559% of users and the threshold is 0.1%. */
61
+ /* Capability css-animation is prefixed with -moz because 1.03559% of users need it which is more than the threshold of 0.1%. */
62
+ /* Creating new -moz context. */
59
63
  -moz-animation: foo 1s;
60
- /* Capability css-animation is prefixed with -webkit because omitting it would affect 51.42143% of users and the threshold is 0.1%. */
64
+ /* Capability css-animation is not prefixed with -ms because 0% of users are affected which is less than the threshold of 0.1. */
65
+ /* Capability css-animation is not prefixed with -o because 0.04931% of users are affected which is less than the threshold of 0.1. */
66
+ /* Capability css-animation is prefixed with -webkit because 51.42143% of users need it which is more than the threshold of 0.1%. */
67
+ /* Creating new -webkit context. */
61
68
  -webkit-animation: foo 1s;
62
69
  animation: foo 1s; }
@@ -44,17 +44,17 @@ $some-default-value: some default value;
44
44
  }
45
45
 
46
46
  @include test('[function] support-legacy-browser() from threshold') {
47
- @include assert-true(support-legacy-browser('ie', '6', 0.00000001),
47
+ @include assert-true(support-legacy-browser('ie', '6', $threshold: 0.00000001),
48
48
  "should be supported because of user support threshold.");
49
- @include assert-false(support-legacy-browser('ie', '6', 10.000),
49
+ @include assert-false(support-legacy-browser('ie', '6', $threshold: 10.000),
50
50
  "should not be supported because of support threshold.");
51
51
  }
52
52
 
53
53
  @include test('[function] support-legacy-browser() from minimums') {
54
54
  @include with-declared-minimums(('ie': '7')) {
55
- @include assert-true(support-legacy-browser('ie', '7', 10.00),
55
+ @include assert-true(support-legacy-browser('ie', '7', $threshold: 10.00),
56
56
  "should be supported because of minimum version.");
57
- @include assert-false(support-legacy-browser('ie', '6', 10.000),
57
+ @include assert-false(support-legacy-browser('ie', '6', $threshold: 10.000),
58
58
  "should not be supported because of minimum version.");
59
59
  }
60
60
  }
@@ -64,6 +64,30 @@ $some-default-value: some default value;
64
64
  @include assert-true(not browser-out-of-scope('chrome'), "should be in scope.");
65
65
  }
66
66
 
67
+ @include test('prefix context tracking') {
68
+ $outer-prefix-invoked: false;
69
+ $inner-prefix-invoked: false;
70
+ $mismatched-prefix-invoked: false;
71
+ @include with-prefix(-webkit) {
72
+ $outer-prefix-invoked: true;
73
+ @include assert-equal(-webkit, $current-prefix, "should be equal.");
74
+ @include assert-equal(-webkit, $prefix-context, "should be equal.");
75
+ @include with-prefix(null) {
76
+ $inner-prefix-invoked: true;
77
+ @include assert-equal(null, $current-prefix, "should be equal.");
78
+ @include assert-equal(-webkit, $prefix-context, "should be equal.");
79
+ }
80
+ @include with-prefix(-ms) {
81
+ $mismatched-prefix-invoked: true;
82
+ }
83
+ }
84
+ @include assert-true($inner-prefix-invoked, "should have been invoked");
85
+ @include assert-true($outer-prefix-invoked, "should have been invoked");
86
+ @include assert-false($mismatched-prefix-invoked, "should not have been invoked");
87
+ @include assert-equal(null, $prefix-context, "should be null");
88
+ @include assert-equal(null, $current-prefix, "should be null");
89
+ }
90
+
67
91
  @include test('[function] browser-out-of-scope() with a scope') {
68
92
  @include with-prefix(browser-prefix('chrome')) {
69
93
  @include assert-true(not browser-out-of-scope('chrome'), "should be in scope.");
@@ -72,7 +96,7 @@ $some-default-value: some default value;
72
96
  }
73
97
 
74
98
  @include test('[function] browser-out-of-scope() with version') {
75
- @include with-browser-minimums((ie: '8')) {
99
+ @include with-browser-ranges((ie: '8' '8')) {
76
100
  @include assert-true(not browser-out-of-scope('ie', '10'), "should be in scope.");
77
101
  @include assert-true(not browser-out-of-scope('ie', '8'), "should be in scope.");
78
102
  @include assert-false(not browser-out-of-scope('ie', '7'), "should not be in scope.");
@@ -115,14 +139,27 @@ $some-default-value: some default value;
115
139
  }
116
140
 
117
141
  @include test('[mixin] with-each-prefix() respects $current-prefix') {
142
+ $contexts: ();
143
+ $prefixes: ();
118
144
  @include with-prefix(-webkit) {
119
- $prefixes: ();
145
+ $prefixes: append($prefixes, $current-prefix);
146
+ $contexts: append($contexts, $prefix-context);
120
147
  @include with-each-prefix(css-regions, 0.0001) {
121
148
  $prefixes: append($prefixes, $current-prefix);
149
+ $contexts: append($contexts, $prefix-context);
122
150
  }
123
- @include assert-equal(false, index($prefixes, null), "Not not have a null");
124
- @include assert-equal("-webkit", #{$prefixes}, "Not equal");
125
151
  }
152
+ @include assert-true(index($prefixes, null), "Must have a null");
153
+ @include assert-equal((-webkit -webkit null), $prefixes, "Not equal");
154
+ @include assert-equal((-webkit -webkit -webkit), $contexts, "Not equal");
155
+ }
156
+
157
+ @include test('[fuction] has-browser-subset()') {
158
+ @include assert-true(has-browser-subset((firefox: "16" "25"), (firefox: "2" "25")), "Should detect version overlap");
159
+ @include assert-true(not has-browser-subset((firefox: "16" "25"), (firefox: "2" "15")), "Should not detect version overlap");
160
+ @include assert-true(not has-browser-subset((firefox: "2" "15"), (firefox: "16" "25")), "Should not detect version overlap");
161
+ @include assert-true(has-browser-subset((firefox: "16" "24"), (firefox: "2" "25")), "Should detect version overlap");
162
+ @include assert-true(has-browser-subset((firefox: "2" "25"), (firefox: "16" "24")), "Should detect version overlap");
126
163
  }
127
164
  }
128
165