sass 3.4.25 → 3.5.0.pre.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/README.md +1 -1
- data/Rakefile +13 -157
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/VERSION_NAME +1 -1
- data/lib/sass.rb +3 -10
- data/lib/sass/cache_stores/filesystem.rb +1 -1
- data/lib/sass/css.rb +2 -3
- data/lib/sass/engine.rb +46 -32
- data/lib/sass/environment.rb +27 -6
- data/lib/sass/error.rb +5 -5
- data/lib/sass/exec/base.rb +3 -12
- data/lib/sass/features.rb +1 -0
- data/lib/sass/importers/filesystem.rb +2 -2
- data/lib/sass/plugin.rb +1 -1
- data/lib/sass/plugin/compiler.rb +21 -51
- data/lib/sass/plugin/configuration.rb +1 -1
- data/lib/sass/plugin/rack.rb +3 -3
- data/lib/sass/plugin/staleness_checker.rb +3 -3
- data/lib/sass/railtie.rb +1 -1
- data/lib/sass/script.rb +3 -3
- data/lib/sass/script/functions.rb +238 -47
- data/lib/sass/script/lexer.rb +8 -6
- data/lib/sass/script/parser.rb +76 -75
- data/lib/sass/script/tree/funcall.rb +35 -30
- data/lib/sass/script/tree/list_literal.rb +23 -8
- data/lib/sass/script/tree/map_literal.rb +2 -2
- data/lib/sass/script/tree/node.rb +2 -10
- data/lib/sass/script/tree/operation.rb +16 -50
- data/lib/sass/script/value.rb +2 -0
- data/lib/sass/script/value/arg_list.rb +1 -1
- data/lib/sass/script/value/base.rb +20 -3
- data/lib/sass/script/value/callable.rb +25 -0
- data/lib/sass/script/value/color.rb +10 -10
- data/lib/sass/script/value/function.rb +19 -0
- data/lib/sass/script/value/helpers.rb +16 -7
- data/lib/sass/script/value/list.rb +33 -12
- data/lib/sass/script/value/map.rb +2 -2
- data/lib/sass/script/value/number.rb +3 -3
- data/lib/sass/script/value/string.rb +12 -5
- data/lib/sass/scss/parser.rb +101 -45
- data/lib/sass/scss/rx.rb +5 -11
- data/lib/sass/scss/static_parser.rb +0 -7
- data/lib/sass/selector.rb +4 -0
- data/lib/sass/selector/abstract_sequence.rb +5 -5
- data/lib/sass/selector/comma_sequence.rb +3 -15
- data/lib/sass/selector/pseudo.rb +4 -0
- data/lib/sass/selector/sequence.rb +30 -3
- data/lib/sass/selector/simple.rb +13 -7
- data/lib/sass/selector/simple_sequence.rb +1 -1
- data/lib/sass/shared.rb +3 -5
- data/lib/sass/source/map.rb +4 -4
- data/lib/sass/source/position.rb +4 -4
- data/lib/sass/stack.rb +21 -1
- data/lib/sass/tree/charset_node.rb +1 -1
- data/lib/sass/tree/comment_node.rb +1 -1
- data/lib/sass/tree/node.rb +3 -3
- data/lib/sass/tree/prop_node.rb +46 -54
- data/lib/sass/tree/rule_node.rb +7 -15
- data/lib/sass/tree/visitors/check_nesting.rb +1 -1
- data/lib/sass/tree/visitors/convert.rb +2 -3
- data/lib/sass/tree/visitors/cssize.rb +1 -10
- data/lib/sass/tree/visitors/deep_copy.rb +2 -2
- data/lib/sass/tree/visitors/perform.rb +23 -12
- data/lib/sass/tree/visitors/set_options.rb +1 -1
- data/lib/sass/tree/visitors/to_css.rb +46 -12
- data/lib/sass/util.rb +16 -321
- data/lib/sass/util/multibyte_string_scanner.rb +127 -131
- data/lib/sass/util/normalized_map.rb +1 -8
- data/lib/sass/version.rb +2 -2
- data/test/sass-spec.yml +1 -1
- data/test/sass/compiler_test.rb +4 -14
- data/test/sass/conversion_test.rb +113 -162
- data/test/sass/css2sass_test.rb +17 -19
- data/test/sass/css_variable_test.rb +176 -70
- data/test/sass/encoding_test.rb +2 -32
- data/test/sass/engine_test.rb +114 -65
- data/test/sass/extend_test.rb +37 -51
- data/test/sass/functions_test.rb +57 -15
- data/test/sass/importer_test.rb +2 -2
- data/test/sass/more_templates/more1.sass +10 -10
- data/test/sass/more_templates/more_import.sass +2 -2
- data/test/sass/plugin_test.rb +9 -12
- data/test/sass/script_conversion_test.rb +9 -0
- data/test/sass/script_test.rb +38 -48
- data/test/sass/scss/css_test.rb +5 -19
- data/test/sass/scss/scss_test.rb +58 -39
- data/test/sass/source_map_test.rb +26 -28
- data/test/sass/templates/_partial.sass +1 -1
- data/test/sass/templates/basic.sass +10 -10
- data/test/sass/templates/bork1.sass +1 -1
- data/test/sass/templates/bork5.sass +1 -1
- data/test/sass/templates/compact.sass +10 -10
- data/test/sass/templates/complex.sass +187 -187
- data/test/sass/templates/compressed.sass +10 -10
- data/test/sass/templates/expanded.sass +10 -10
- data/test/sass/templates/import.sass +2 -2
- data/test/sass/templates/importee.sass +3 -3
- data/test/sass/templates/mixins.sass +22 -22
- data/test/sass/templates/multiline.sass +4 -4
- data/test/sass/templates/nested.sass +13 -13
- data/test/sass/templates/parent_ref.sass +12 -12
- data/test/sass/templates/script.sass +70 -70
- data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +1 -1
- data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +2 -2
- data/test/sass/templates/subdir/subdir.sass +3 -3
- data/test/sass/templates/units.sass +10 -10
- data/test/sass/util/multibyte_string_scanner_test.rb +139 -149
- data/test/sass/util_test.rb +0 -36
- data/test/test_helper.rb +39 -0
- metadata +30 -57
- data/extra/sass-spec-ref.sh +0 -32
- data/lib/sass/deprecation.rb +0 -55
- data/lib/sass/script/css_variable_warning.rb +0 -52
- data/lib/sass/util/cross_platform_random.rb +0 -19
- data/lib/sass/util/ordered_hash.rb +0 -192
- data/test/sass/results/import_charset_1_8.css +0 -5
- data/test/sass/templates/import_charset_1_8.sass +0 -6
- data/vendor/listen/CHANGELOG.md +0 -1
- data/vendor/listen/CONTRIBUTING.md +0 -38
- data/vendor/listen/Gemfile +0 -20
- data/vendor/listen/Guardfile +0 -8
- data/vendor/listen/LICENSE +0 -20
- data/vendor/listen/README.md +0 -349
- data/vendor/listen/Rakefile +0 -5
- data/vendor/listen/Vagrantfile +0 -96
- data/vendor/listen/lib/listen.rb +0 -54
- data/vendor/listen/lib/listen/adapter.rb +0 -327
- data/vendor/listen/lib/listen/adapters/bsd.rb +0 -75
- data/vendor/listen/lib/listen/adapters/darwin.rb +0 -48
- data/vendor/listen/lib/listen/adapters/linux.rb +0 -81
- data/vendor/listen/lib/listen/adapters/polling.rb +0 -58
- data/vendor/listen/lib/listen/adapters/windows.rb +0 -91
- data/vendor/listen/lib/listen/directory_record.rb +0 -406
- data/vendor/listen/lib/listen/listener.rb +0 -323
- data/vendor/listen/lib/listen/turnstile.rb +0 -32
- data/vendor/listen/lib/listen/version.rb +0 -3
- data/vendor/listen/listen.gemspec +0 -28
- data/vendor/listen/spec/listen/adapter_spec.rb +0 -149
- data/vendor/listen/spec/listen/adapters/bsd_spec.rb +0 -36
- data/vendor/listen/spec/listen/adapters/darwin_spec.rb +0 -37
- data/vendor/listen/spec/listen/adapters/linux_spec.rb +0 -47
- data/vendor/listen/spec/listen/adapters/polling_spec.rb +0 -68
- data/vendor/listen/spec/listen/adapters/windows_spec.rb +0 -30
- data/vendor/listen/spec/listen/directory_record_spec.rb +0 -1250
- data/vendor/listen/spec/listen/listener_spec.rb +0 -258
- data/vendor/listen/spec/listen/turnstile_spec.rb +0 -56
- data/vendor/listen/spec/listen_spec.rb +0 -67
- data/vendor/listen/spec/spec_helper.rb +0 -25
- data/vendor/listen/spec/support/adapter_helper.rb +0 -666
- data/vendor/listen/spec/support/directory_record_helper.rb +0 -57
- data/vendor/listen/spec/support/fixtures_helper.rb +0 -29
- data/vendor/listen/spec/support/listeners_helper.rb +0 -179
- data/vendor/listen/spec/support/platform_helper.rb +0 -15
data/test/sass/scss/css_test.rb
CHANGED
@@ -49,26 +49,13 @@ baz {bar: baz}
|
|
49
49
|
SCSS
|
50
50
|
end
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
assert_parses <<SCSS
|
55
|
-
@charset "UTF-8";
|
56
|
-
foo {
|
57
|
-
bar: föö bâr; }
|
58
|
-
SCSS
|
59
|
-
assert_parses <<SCSS
|
60
|
-
foo {
|
61
|
-
bar: föö bâr; }
|
62
|
-
SCSS
|
63
|
-
end
|
64
|
-
else
|
65
|
-
def test_unicode
|
66
|
-
assert_parses <<SCSS
|
52
|
+
def test_unicode
|
53
|
+
assert_parses <<SCSS
|
67
54
|
@charset "UTF-8";
|
68
55
|
foo {
|
69
56
|
bar: föö bâr; }
|
70
57
|
SCSS
|
71
|
-
|
58
|
+
assert_equal <<CSS, render(<<SCSS)
|
72
59
|
@charset "UTF-8";
|
73
60
|
foo {
|
74
61
|
bar: föö bâr; }
|
@@ -76,7 +63,6 @@ CSS
|
|
76
63
|
foo {
|
77
64
|
bar: föö bâr; }
|
78
65
|
SCSS
|
79
|
-
end
|
80
66
|
end
|
81
67
|
|
82
68
|
def test_invisible_comments
|
@@ -819,10 +805,10 @@ SCSS
|
|
819
805
|
assert_selector_parses('E > F')
|
820
806
|
assert_selector_parses('E + F')
|
821
807
|
assert_selector_parses('E ~ F')
|
822
|
-
|
808
|
+
assert_selector_parses('E /foo/ F')
|
823
809
|
silence_warnings {assert_selector_parses('E! > F')}
|
824
810
|
|
825
|
-
|
811
|
+
assert_selector_parses('E /ns|foo/ F')
|
826
812
|
|
827
813
|
# From http://dev.w3.org/csswg/css-scoping-1/
|
828
814
|
assert_selector_parses('E:host(s)')
|
data/test/sass/scss/scss_test.rb
CHANGED
@@ -1015,8 +1015,7 @@ SASS
|
|
1015
1015
|
end
|
1016
1016
|
|
1017
1017
|
def test_disallowed_function_names
|
1018
|
-
|
1019
|
-
assert_warning(<<WARNING) {render(<<SCSS)}
|
1018
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1020
1019
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1021
1020
|
Naming a function "calc" is disallowed and will be an error in future versions of Sass.
|
1022
1021
|
This name conflicts with an existing CSS function with special parse rules.
|
@@ -1024,7 +1023,7 @@ WARNING
|
|
1024
1023
|
@function calc() {}
|
1025
1024
|
SCSS
|
1026
1025
|
|
1027
|
-
|
1026
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1028
1027
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1029
1028
|
Naming a function "-my-calc" is disallowed and will be an error in future versions of Sass.
|
1030
1029
|
This name conflicts with an existing CSS function with special parse rules.
|
@@ -1032,7 +1031,7 @@ WARNING
|
|
1032
1031
|
@function -my-calc() {}
|
1033
1032
|
SCSS
|
1034
1033
|
|
1035
|
-
|
1034
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1036
1035
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1037
1036
|
Naming a function "element" is disallowed and will be an error in future versions of Sass.
|
1038
1037
|
This name conflicts with an existing CSS function with special parse rules.
|
@@ -1040,7 +1039,7 @@ WARNING
|
|
1040
1039
|
@function element() {}
|
1041
1040
|
SCSS
|
1042
1041
|
|
1043
|
-
|
1042
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1044
1043
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1045
1044
|
Naming a function "-my-element" is disallowed and will be an error in future versions of Sass.
|
1046
1045
|
This name conflicts with an existing CSS function with special parse rules.
|
@@ -1048,7 +1047,7 @@ WARNING
|
|
1048
1047
|
@function -my-element() {}
|
1049
1048
|
SCSS
|
1050
1049
|
|
1051
|
-
|
1050
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1052
1051
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1053
1052
|
Naming a function "expression" is disallowed and will be an error in future versions of Sass.
|
1054
1053
|
This name conflicts with an existing CSS function with special parse rules.
|
@@ -1056,14 +1055,13 @@ WARNING
|
|
1056
1055
|
@function expression() {}
|
1057
1056
|
SCSS
|
1058
1057
|
|
1059
|
-
|
1058
|
+
assert_warning(<<WARNING) {render(<<SCSS)}
|
1060
1059
|
DEPRECATION WARNING on line 1 of test_disallowed_function_names_inline.scss:
|
1061
1060
|
Naming a function "url" is disallowed and will be an error in future versions of Sass.
|
1062
1061
|
This name conflicts with an existing CSS function with special parse rules.
|
1063
1062
|
WARNING
|
1064
1063
|
@function url() {}
|
1065
1064
|
SCSS
|
1066
|
-
end
|
1067
1065
|
end
|
1068
1066
|
|
1069
1067
|
def test_allowed_function_names
|
@@ -2174,7 +2172,7 @@ SCSS
|
|
2174
2172
|
end
|
2175
2173
|
|
2176
2174
|
def test_selector_interpolation_in_reference_combinator
|
2177
|
-
|
2175
|
+
assert_equal <<CSS, render(<<SCSS)
|
2178
2176
|
.foo /a/ .bar /b|c/ .baz {
|
2179
2177
|
a: b; }
|
2180
2178
|
CSS
|
@@ -3389,22 +3387,22 @@ SCSS
|
|
3389
3387
|
def test_uses_property_exception_with_star_hack
|
3390
3388
|
render <<SCSS
|
3391
3389
|
foo {
|
3392
|
-
*bar:baz
|
3390
|
+
*bar:baz <fail>; }
|
3393
3391
|
SCSS
|
3394
3392
|
assert(false, "Expected syntax error")
|
3395
3393
|
rescue Sass::SyntaxError => e
|
3396
|
-
assert_equal 'Invalid CSS after " *bar:baz ": expected
|
3394
|
+
assert_equal 'Invalid CSS after " *bar:baz <fail>": expected expression (e.g. 1px, bold), was "; }"', e.message
|
3397
3395
|
assert_equal 2, e.sass_line
|
3398
3396
|
end
|
3399
3397
|
|
3400
3398
|
def test_uses_property_exception_with_colon_hack
|
3401
3399
|
render <<SCSS
|
3402
3400
|
foo {
|
3403
|
-
:bar:baz
|
3401
|
+
:bar:baz <fail>; }
|
3404
3402
|
SCSS
|
3405
3403
|
assert(false, "Expected syntax error")
|
3406
3404
|
rescue Sass::SyntaxError => e
|
3407
|
-
assert_equal 'Invalid CSS after " :bar:baz ": expected
|
3405
|
+
assert_equal 'Invalid CSS after " :bar:baz <fail>": expected expression (e.g. 1px, bold), was "; }"', e.message
|
3408
3406
|
assert_equal 2, e.sass_line
|
3409
3407
|
end
|
3410
3408
|
|
@@ -3422,22 +3420,22 @@ SCSS
|
|
3422
3420
|
def test_uses_property_exception_with_space_after_name
|
3423
3421
|
render <<SCSS
|
3424
3422
|
foo {
|
3425
|
-
bar: baz
|
3423
|
+
bar: baz <fail>; }
|
3426
3424
|
SCSS
|
3427
3425
|
assert(false, "Expected syntax error")
|
3428
3426
|
rescue Sass::SyntaxError => e
|
3429
|
-
assert_equal 'Invalid CSS after " bar: baz ": expected
|
3427
|
+
assert_equal 'Invalid CSS after " bar: baz <fail>": expected expression (e.g. 1px, bold), was "; }"', e.message
|
3430
3428
|
assert_equal 2, e.sass_line
|
3431
3429
|
end
|
3432
3430
|
|
3433
3431
|
def test_uses_property_exception_with_non_identifier_after_name
|
3434
3432
|
render <<SCSS
|
3435
3433
|
foo {
|
3436
|
-
bar:1px
|
3434
|
+
bar:1px <fail>; }
|
3437
3435
|
SCSS
|
3438
3436
|
assert(false, "Expected syntax error")
|
3439
3437
|
rescue Sass::SyntaxError => e
|
3440
|
-
assert_equal 'Invalid CSS after " bar:1px ": expected
|
3438
|
+
assert_equal 'Invalid CSS after " bar:1px <fail>": expected expression (e.g. 1px, bold), was "; }"', e.message
|
3441
3439
|
assert_equal 2, e.sass_line
|
3442
3440
|
end
|
3443
3441
|
|
@@ -3668,9 +3666,8 @@ SCSS
|
|
3668
3666
|
# Ensures that the fix for #2031 doesn't hide legitimate warnings.
|
3669
3667
|
def test_interpolation_warning_in_selector_like_property
|
3670
3668
|
assert_warning(<<WARNING) {assert_equal(<<CSS, render(<<SCSS))}
|
3671
|
-
DEPRECATION WARNING on line 2 of #{filename_for_test :scss}:
|
3672
|
-
|
3673
|
-
To preserve the current behavior, use quotes:
|
3669
|
+
DEPRECATION WARNING on line 2 of #{filename_for_test :scss}: \#{} interpolation near operators will be simplified
|
3670
|
+
in a future version of Sass. To preserve the current behavior, use quotes:
|
3674
3671
|
|
3675
3672
|
unquote("n+1")
|
3676
3673
|
|
@@ -3860,19 +3857,7 @@ SCSS
|
|
3860
3857
|
end
|
3861
3858
|
|
3862
3859
|
def test_reference_combinator_with_parent_ref
|
3863
|
-
|
3864
|
-
a /foo/ b {
|
3865
|
-
c: d; }
|
3866
|
-
CSS
|
3867
|
-
a {& /foo/ b {c: d}}
|
3868
|
-
SCSS
|
3869
|
-
end
|
3870
|
-
|
3871
|
-
def test_reference_combinator_warning
|
3872
|
-
assert_warning(<<WARNING) {assert_equal <<CSS, render(<<SCSS)}
|
3873
|
-
DEPRECATION WARNING on line 1, column 8 of test_reference_combinator_warning_inline.scss:
|
3874
|
-
The reference combinator /foo/ is deprecated and will be removed in a future release.
|
3875
|
-
WARNING
|
3860
|
+
assert_equal <<CSS, render(<<SCSS)
|
3876
3861
|
a /foo/ b {
|
3877
3862
|
c: d; }
|
3878
3863
|
CSS
|
@@ -3942,12 +3927,13 @@ a.\#{"foo"} b
|
|
3942
3927
|
SCSS
|
3943
3928
|
end
|
3944
3929
|
|
3945
|
-
def
|
3946
|
-
|
3947
|
-
|
3948
|
-
|
3949
|
-
|
3950
|
-
|
3930
|
+
def test_extra_comma_in_mixin_arglist
|
3931
|
+
assert_equal <<CSS, render(<<SCSS)
|
3932
|
+
.bar {
|
3933
|
+
baz: bar; }
|
3934
|
+
CSS
|
3935
|
+
@mixin foo($a1,) {
|
3936
|
+
baz: $a1;
|
3951
3937
|
}
|
3952
3938
|
|
3953
3939
|
.bar {
|
@@ -3956,6 +3942,39 @@ MESSAGE
|
|
3956
3942
|
SCSS
|
3957
3943
|
end
|
3958
3944
|
|
3945
|
+
|
3946
|
+
def test_extra_comma_between_parameters_in_mixin_arglist
|
3947
|
+
assert_raise_message(Sass::SyntaxError, "Invalid CSS after \"...nclude foo(bar,\": expected \")\", was \", baz );\"") {render <<SCSS}
|
3948
|
+
@mixin foo($a1, $a2) {
|
3949
|
+
baz: $a1;
|
3950
|
+
bef: $a2;
|
3951
|
+
}
|
3952
|
+
|
3953
|
+
.bar {
|
3954
|
+
@include foo(bar,, baz );
|
3955
|
+
}
|
3956
|
+
SCSS
|
3957
|
+
end
|
3958
|
+
|
3959
|
+
|
3960
|
+
def test_extra_comma_in_mixin_arglist_ending_needs_have_parentheses_after
|
3961
|
+
assert_raise_message(Sass::SyntaxError, "Invalid CSS after \" bri,\": expected \")\", was \"};\"") {render <<SCSS}
|
3962
|
+
@mixin foo($a1, $a2) {
|
3963
|
+
baz: $a1;
|
3964
|
+
bal: $a2;
|
3965
|
+
}
|
3966
|
+
|
3967
|
+
.bar {
|
3968
|
+
@include foo(
|
3969
|
+
bar,
|
3970
|
+
bri,
|
3971
|
+
};
|
3972
|
+
}
|
3973
|
+
SCSS
|
3974
|
+
end
|
3975
|
+
|
3976
|
+
|
3977
|
+
|
3959
3978
|
def test_interpolation
|
3960
3979
|
assert_equal <<CSS, render(<<SCSS)
|
3961
3980
|
ul li#foo a span.label {
|
@@ -37,7 +37,7 @@ JSON
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def test_simple_mapping_sass
|
40
|
-
|
40
|
+
assert_parses_with_sourcemap <<SASS, <<CSS, <<JSON, :syntax => :sass
|
41
41
|
a
|
42
42
|
foo: bar
|
43
43
|
/* SOME COMMENT */
|
@@ -61,7 +61,7 @@ JSON
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def test_simple_mapping_with_file_uris
|
64
|
-
uri = Sass::Util.file_uri_from_path(
|
64
|
+
uri = Sass::Util.file_uri_from_path(File.absolute_path(filename_for_test(:scss)))
|
65
65
|
assert_parses_with_sourcemap <<SCSS, <<CSS, <<JSON, :sourcemap => :file
|
66
66
|
a {
|
67
67
|
foo: bar;
|
@@ -114,7 +114,7 @@ JSON
|
|
114
114
|
|
115
115
|
def test_mapping_with_directory_sass
|
116
116
|
options = {:filename => "sass/style.sass", :output => "css/style.css", :syntax => :sass}
|
117
|
-
|
117
|
+
assert_parses_with_sourcemap <<SASS, <<CSS, <<JSON, options
|
118
118
|
a
|
119
119
|
foo: bar
|
120
120
|
/* SOME COMMENT */
|
@@ -137,9 +137,8 @@ CSS
|
|
137
137
|
JSON
|
138
138
|
end
|
139
139
|
|
140
|
-
|
141
|
-
|
142
|
-
assert_parses_with_sourcemap <<SCSS, <<CSS, <<JSON
|
140
|
+
def test_simple_charset_mapping_scss
|
141
|
+
assert_parses_with_sourcemap <<SCSS, <<CSS, <<JSON
|
143
142
|
a {
|
144
143
|
fóó: bár;
|
145
144
|
}
|
@@ -158,10 +157,10 @@ CSS
|
|
158
157
|
"file": "test.css"
|
159
158
|
}
|
160
159
|
JSON
|
161
|
-
|
160
|
+
end
|
162
161
|
|
163
|
-
|
164
|
-
|
162
|
+
def test_simple_charset_mapping_sass
|
163
|
+
assert_parses_with_sourcemap <<SASS, <<CSS, <<JSON, :syntax => :sass
|
165
164
|
a
|
166
165
|
fóó: bár
|
167
166
|
SASS
|
@@ -179,10 +178,10 @@ CSS
|
|
179
178
|
"file": "test.css"
|
180
179
|
}
|
181
180
|
JSON
|
182
|
-
|
181
|
+
end
|
183
182
|
|
184
|
-
|
185
|
-
|
183
|
+
def test_different_charset_than_encoding_scss
|
184
|
+
assert_parses_with_sourcemap(<<SCSS.force_encoding("IBM866"), <<CSS, <<JSON)
|
186
185
|
@charset "IBM866";
|
187
186
|
f\x86\x86 {
|
188
187
|
\x86: b;
|
@@ -202,10 +201,10 @@ CSS
|
|
202
201
|
"file": "test.css"
|
203
202
|
}
|
204
203
|
JSON
|
205
|
-
|
204
|
+
end
|
206
205
|
|
207
|
-
|
208
|
-
|
206
|
+
def test_different_charset_than_encoding_sass
|
207
|
+
assert_parses_with_sourcemap(<<SASS.force_encoding("IBM866"), <<CSS, <<JSON, :syntax => :sass)
|
209
208
|
@charset "IBM866"
|
210
209
|
f\x86\x86
|
211
210
|
\x86: b
|
@@ -224,7 +223,6 @@ CSS
|
|
224
223
|
"file": "test.css"
|
225
224
|
}
|
226
225
|
JSON
|
227
|
-
end
|
228
226
|
end
|
229
227
|
|
230
228
|
def test_import_sourcemap_scss
|
@@ -362,7 +360,8 @@ $translucent-red: rgba(255, 0, 0, 0.5);
|
|
362
360
|
}
|
363
361
|
}
|
364
362
|
{{22}}&:active {{/22}}{
|
365
|
-
{{23}}
|
363
|
+
{{23}}color{{/23}}: {{24}}#010203 + #040506{{/24}};
|
364
|
+
{{25}}border{{/25}}: {{26}}$width solid black{{/26}};
|
366
365
|
}
|
367
366
|
{{2}}/* SOME COMMENT */{{/2}}
|
368
367
|
{{3}}font{{/3}}: {{4}}2px/3px {{/4}}{
|
@@ -385,7 +384,8 @@ SCSS
|
|
385
384
|
{{19}}a .special:after{{/19}} {
|
386
385
|
{{20}}content{{/20}}: {{21}}"I ate 15 pies 2px thick!"{{/21}}; }
|
387
386
|
{{22}}a:active{{/22}} {
|
388
|
-
{{23}}
|
387
|
+
{{23}}color{{/23}}: {{24}}#050709{{/24}};
|
388
|
+
{{25}}border{{/25}}: {{26}}2px solid black{{/26}}; }
|
389
389
|
|
390
390
|
/*# sourceMappingURL=test.css.map */
|
391
391
|
CSS
|
@@ -405,7 +405,8 @@ $translucent-red: rgba(255, 0, 0, 0.5)
|
|
405
405
|
{{19}}&:after{{/19}}
|
406
406
|
{{20}}content{{/20}}: {{21}}"I ate #{5 + 10} pies #{$width} thick!"{{/21}}
|
407
407
|
{{22}}&:active{{/22}}
|
408
|
-
{{23}}
|
408
|
+
{{23}}color{{/23}}: {{24}}#010203 + #040506{{/24}}
|
409
|
+
{{25}}border{{/25}}: {{26}}$width solid black{{/26}}
|
409
410
|
|
410
411
|
{{2}}/* SOME COMMENT */{{/2}}
|
411
412
|
{{3}}font{{/3}}: {{4}}2px/3px{{/4}}
|
@@ -426,7 +427,8 @@ SASS
|
|
426
427
|
{{19}}a .special:after{{/19}} {
|
427
428
|
{{20}}content{{/20}}: {{21}}"I ate 15 pies 2px thick!"{{/21}}; }
|
428
429
|
{{22}}a:active{{/22}} {
|
429
|
-
{{23}}
|
430
|
+
{{23}}color{{/23}}: {{24}}#050709{{/24}};
|
431
|
+
{{25}}border{{/25}}: {{26}}2px solid black{{/26}}; }
|
430
432
|
|
431
433
|
/*# sourceMappingURL=test.css.map */
|
432
434
|
CSS
|
@@ -663,7 +665,7 @@ CSS
|
|
663
665
|
end
|
664
666
|
|
665
667
|
def test_mixin_sourcemap_sass
|
666
|
-
|
668
|
+
assert_parses_with_mapping <<'SASS', <<'CSS', :syntax => :sass
|
667
669
|
=large-text
|
668
670
|
:font
|
669
671
|
{{2}}size{{/2}}: {{3}}20px{{/3}}
|
@@ -757,7 +759,7 @@ CSS
|
|
757
759
|
# Regression tests
|
758
760
|
|
759
761
|
def test_properties_sass
|
760
|
-
|
762
|
+
assert_parses_with_mapping <<SASS, <<CSS, :syntax => :sass
|
761
763
|
{{1}}.foo{{/1}}
|
762
764
|
:{{2}}name{{/2}} {{3}}value{{/3}}
|
763
765
|
{{4}}name{{/4}}: {{5}}value{{/5}}
|
@@ -796,7 +798,7 @@ SCSS
|
|
796
798
|
|
797
799
|
interpolated = engine.to_tree.children.
|
798
800
|
first.children.
|
799
|
-
first.value.children[1]
|
801
|
+
first.value.first.children[1]
|
800
802
|
assert_equal "123", interpolated.to_sass
|
801
803
|
range = interpolated.source_range
|
802
804
|
assert_equal 3, range.start_pos.line
|
@@ -984,11 +986,7 @@ CSS
|
|
984
986
|
def assert_ranges_equal(expected, actual, lines, prefix)
|
985
987
|
assert_positions_equal(expected.start_pos, actual.start_pos, lines, prefix + " start position")
|
986
988
|
assert_positions_equal(expected.end_pos, actual.end_pos, lines, prefix + " end position")
|
987
|
-
|
988
|
-
assert_nil(actual.file)
|
989
|
-
else
|
990
|
-
assert_equal(expected.file, actual.file)
|
991
|
-
end
|
989
|
+
assert_equal(expected.file, actual.file)
|
992
990
|
end
|
993
991
|
|
994
992
|
def assert_sourcemaps_equal(source, css, expected, actual)
|
@@ -1,2 +1,2 @@
|
|
1
1
|
#foo
|
2
|
-
background-color
|
2
|
+
:background-color #baf
|
@@ -1,23 +1,23 @@
|
|
1
1
|
|
2
2
|
|
3
3
|
body
|
4
|
-
font
|
5
|
-
background
|
4
|
+
:font Arial
|
5
|
+
:background blue
|
6
6
|
|
7
7
|
#page
|
8
|
-
width
|
9
|
-
height
|
8
|
+
:width 700px
|
9
|
+
:height 100
|
10
10
|
#header
|
11
|
-
height
|
11
|
+
:height 300px
|
12
12
|
h1
|
13
|
-
font-size
|
14
|
-
color
|
13
|
+
:font-size 50px
|
14
|
+
:color blue
|
15
15
|
|
16
16
|
#content.user.show
|
17
17
|
#container.top
|
18
18
|
#column.left
|
19
|
-
width
|
19
|
+
:width 100px
|
20
20
|
#column.right
|
21
|
-
width
|
21
|
+
:width 600px
|
22
22
|
#container.bottom
|
23
|
-
background
|
23
|
+
:background brown
|