less 2.4.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +4 -0
- data/Gemfile +1 -1
- data/less.gemspec +1 -1
- data/lib/less/defaults.rb +3 -3
- data/lib/less/java_script/v8_context.rb +1 -1
- data/lib/less/js/.gitattributes +3 -2
- data/lib/less/js/.gitignore +18 -2
- data/lib/less/js/.jshintrc +11 -0
- data/lib/less/js/CHANGELOG.md +87 -2
- data/lib/less/js/CONTRIBUTING.md +4 -3
- data/lib/less/js/Gruntfile.js +290 -0
- data/lib/less/js/README.md +342 -12
- data/lib/less/js/benchmark/benchmark.less +194 -194
- data/lib/less/js/benchmark/less-benchmark.js +9 -10
- data/lib/less/js/bin/lessc +154 -12
- data/lib/less/js/bower.json +18 -0
- data/lib/less/js/build.gradle +347 -0
- data/lib/less/js/build/README.md +350 -0
- data/lib/less/js/build/browser-header.js +4 -0
- data/lib/less/js/build/build.yml +160 -0
- data/lib/less/js/build/require-rhino.js +7 -2
- data/lib/less/js/build/rhino-header.js +4 -0
- data/lib/less/js/build/rhino-modules.js +131 -0
- data/lib/less/js/build/tasks/.gitkeep +1 -0
- data/lib/less/js/dist/less-1.5.0.js +6914 -0
- data/lib/less/js/dist/less-1.5.0.min.js +13 -0
- data/lib/less/js/dist/less-1.5.1.js +6941 -0
- data/lib/less/js/dist/less-1.5.1.min.js +13 -0
- data/lib/less/js/dist/less-1.6.0.js +7485 -0
- data/lib/less/js/dist/less-1.6.0.min.js +16 -0
- data/lib/less/js/dist/less-1.6.1.js +7513 -0
- data/lib/less/js/dist/less-1.6.1.min.js +16 -0
- data/lib/less/js/dist/less-1.6.2.js +7624 -0
- data/lib/less/js/dist/less-1.6.2.min.js +16 -0
- data/lib/less/js/dist/less-rhino-1.5.1.js +6831 -0
- data/lib/less/js/dist/less-rhino-1.6.2.js +9017 -0
- data/lib/less/js/dist/lessc-rhino-1.6.2.js +449 -0
- data/lib/less/js/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/lib/less/js/gradle/wrapper/gradle-wrapper.properties +6 -0
- data/lib/less/js/gradlew +164 -0
- data/lib/less/js/gradlew.bat +90 -0
- data/lib/less/js/lib/less/browser.js +482 -367
- data/lib/less/js/lib/less/colors.js +0 -1
- data/lib/less/js/lib/less/encoder.js +4 -0
- data/lib/less/js/lib/less/env.js +50 -19
- data/lib/less/js/lib/less/extend-visitor.js +66 -41
- data/lib/less/js/lib/less/functions.js +309 -104
- data/lib/less/js/lib/less/import-visitor.js +21 -10
- data/lib/less/js/lib/less/index.js +90 -68
- data/lib/less/js/lib/less/join-selector-visitor.js +11 -4
- data/lib/less/js/lib/less/lessc_helper.js +56 -45
- data/lib/less/js/lib/less/parser.js +830 -460
- data/lib/less/js/lib/less/rhino.js +380 -58
- data/lib/less/js/lib/less/source-map-output.js +141 -0
- data/lib/less/js/lib/less/to-css-visitor.js +215 -0
- data/lib/less/js/lib/less/tree.js +57 -5
- data/lib/less/js/lib/less/tree/alpha.js +13 -5
- data/lib/less/js/lib/less/tree/anonymous.js +11 -5
- data/lib/less/js/lib/less/tree/assignment.js +11 -5
- data/lib/less/js/lib/less/tree/call.js +19 -8
- data/lib/less/js/lib/less/tree/color.js +59 -36
- data/lib/less/js/lib/less/tree/comment.js +17 -4
- data/lib/less/js/lib/less/tree/condition.js +3 -3
- data/lib/less/js/lib/less/tree/dimension.js +161 -153
- data/lib/less/js/lib/less/tree/directive.js +39 -18
- data/lib/less/js/lib/less/tree/element.js +41 -18
- data/lib/less/js/lib/less/tree/expression.js +11 -5
- data/lib/less/js/lib/less/tree/extend.js +11 -1
- data/lib/less/js/lib/less/tree/import.js +34 -20
- data/lib/less/js/lib/less/tree/javascript.js +16 -10
- data/lib/less/js/lib/less/tree/keyword.js +5 -2
- data/lib/less/js/lib/less/tree/media.js +39 -22
- data/lib/less/js/lib/less/tree/mixin.js +135 -56
- data/lib/less/js/lib/less/tree/negative.js +4 -2
- data/lib/less/js/lib/less/tree/operation.js +17 -12
- data/lib/less/js/lib/less/tree/paren.js +5 -2
- data/lib/less/js/lib/less/tree/quoted.js +9 -6
- data/lib/less/js/lib/less/tree/rule.js +39 -21
- data/lib/less/js/lib/less/tree/ruleset.js +229 -145
- data/lib/less/js/lib/less/tree/selector.js +101 -34
- data/lib/less/js/lib/less/tree/unicode-descriptor.js +4 -3
- data/lib/less/js/lib/less/tree/url.js +33 -11
- data/lib/less/js/lib/less/tree/value.js +13 -6
- data/lib/less/js/lib/less/tree/variable.js +13 -8
- data/lib/less/js/lib/less/visitor.js +117 -25
- data/lib/less/js/lib/source-map/source-map-0.1.31.js +1933 -0
- data/lib/less/js/lib/source-map/source-map-footer.js +4 -0
- data/lib/less/js/lib/source-map/source-map-header.js +3 -0
- data/lib/less/js/package.json +30 -15
- data/lib/less/js/test/browser/common.js +131 -56
- data/lib/less/js/test/browser/css/global-vars/simple.css +3 -0
- data/lib/less/js/test/browser/css/modify-vars/simple.css +8 -0
- data/lib/less/js/test/browser/css/relative-urls/urls.css +8 -9
- data/lib/less/js/test/browser/css/rootpath-relative/urls.css +0 -1
- data/lib/less/js/test/browser/css/rootpath/urls.css +0 -1
- data/lib/less/js/test/browser/css/urls.css +18 -14
- data/lib/less/js/test/browser/es5.js +27 -0
- data/lib/less/js/test/{less/errors/color-operation-error.less → browser/less/console-errors/test-error.less} +0 -0
- data/lib/less/js/test/browser/less/console-errors/test-error.txt +2 -0
- data/lib/less/js/test/browser/less/global-vars/simple.less +3 -0
- data/lib/less/js/test/browser/less/modify-vars/imports/simple2.less +4 -0
- data/lib/less/js/test/browser/less/modify-vars/simple.less +8 -0
- data/lib/less/js/test/browser/less/relative-urls/urls.less +1 -1
- data/lib/less/js/test/browser/less/rootpath-relative/urls.less +1 -1
- data/lib/less/js/test/browser/less/rootpath/urls.less +1 -1
- data/lib/less/js/test/browser/less/urls.less +9 -1
- data/lib/less/js/test/browser/phantom-runner.js +112 -103
- data/lib/less/js/test/browser/runner-browser-options.js +42 -0
- data/lib/less/js/test/browser/{runner-browser.js → runner-browser-spec.js} +7 -2
- data/lib/less/js/test/browser/runner-console-errors.js +5 -0
- data/lib/less/js/test/browser/runner-errors-options.js +5 -0
- data/lib/less/js/test/browser/runner-errors-spec.js +4 -0
- data/lib/less/js/test/browser/runner-global-vars-options.js +4 -0
- data/lib/less/js/test/browser/runner-global-vars-spec.js +3 -0
- data/lib/less/js/test/browser/runner-legacy-options.js +4 -0
- data/lib/less/js/test/browser/{runner-legacy.js → runner-legacy-spec.js} +1 -4
- data/lib/less/js/test/browser/runner-main-options.js +15 -0
- data/lib/less/js/test/browser/runner-main-spec.js +3 -0
- data/lib/less/js/test/browser/runner-modify-vars-options.js +2 -0
- data/lib/less/js/test/browser/runner-modify-vars-spec.js +43 -0
- data/lib/less/js/test/browser/runner-no-js-errors-options.js +4 -0
- data/lib/less/js/test/browser/runner-no-js-errors-spec.js +4 -0
- data/lib/less/js/test/browser/runner-production-options.js +3 -0
- data/lib/less/js/test/browser/{runner-production.js → runner-production-spec.js} +1 -3
- data/lib/less/js/test/browser/runner-relative-urls-options.js +3 -0
- data/lib/less/js/test/browser/{runner-relative-urls.js → runner-relative-urls-spec.js} +1 -2
- data/lib/less/js/test/browser/runner-rootpath-options.js +3 -0
- data/lib/less/js/test/browser/runner-rootpath-relative-options.js +4 -0
- data/lib/less/js/test/browser/{runner-rootpath-relative.js → runner-rootpath-relative-spec.js} +1 -3
- data/lib/less/js/test/browser/{runner-rootpath.js → runner-rootpath-spec.js} +1 -2
- data/lib/less/js/test/browser/test-runner-template.tmpl +47 -0
- data/lib/less/js/test/css/colors.css +7 -0
- data/lib/less/js/test/css/comments.css +9 -4
- data/lib/less/js/test/css/compression/compression.css +3 -2
- data/lib/less/js/test/css/css-3.css +17 -5
- data/lib/less/js/test/css/css-guards.css +37 -0
- data/lib/less/js/test/css/debug/linenumbers-all.css +6 -0
- data/lib/less/js/test/css/debug/linenumbers-comments.css +5 -0
- data/lib/less/js/test/css/debug/linenumbers-mediaquery.css +5 -0
- data/lib/less/js/test/css/empty.css +0 -0
- data/lib/less/js/test/css/extend-chaining.css +9 -0
- data/lib/less/js/test/css/extend-selector.css +10 -2
- data/lib/less/js/test/css/extract-and-length.css +133 -0
- data/lib/less/js/test/css/functions.css +23 -10
- data/lib/less/js/test/css/globalVars/extended.css +12 -0
- data/lib/less/js/test/css/globalVars/simple.css +6 -0
- data/lib/less/js/test/css/import-inline.css +5 -0
- data/lib/less/js/test/css/import-once.css +12 -0
- data/lib/less/js/test/css/import-reference.css +49 -0
- data/lib/less/js/test/css/import.css +0 -2
- data/lib/less/js/test/css/media.css +21 -5
- data/lib/less/js/test/css/merge.css +26 -0
- data/lib/less/js/test/css/mixins-guards-default-func.css +129 -0
- data/lib/less/js/test/css/mixins-guards.css +6 -0
- data/lib/less/js/test/css/mixins-important.css +7 -0
- data/lib/less/js/test/css/mixins-interpolated.css +39 -0
- data/lib/less/js/test/css/mixins.css +20 -0
- data/lib/less/js/test/css/modifyVars/extended.css +9 -0
- data/lib/less/js/test/css/no-output.css +0 -0
- data/lib/less/js/test/css/parens.css +3 -0
- data/lib/less/js/test/css/property-name-interp.css +20 -0
- data/lib/less/js/test/css/selectors.css +12 -0
- data/lib/less/js/test/css/static-urls/urls.css +7 -4
- data/lib/less/js/test/css/strings.css +3 -0
- data/lib/less/js/test/css/url-args/urls.css +56 -0
- data/lib/less/js/test/css/urls.css +21 -9
- data/lib/less/js/test/index.js +45 -0
- data/lib/less/js/test/less-test.js +234 -191
- data/lib/less/js/test/less/colors.less +6 -0
- data/lib/less/js/test/less/comments.less +7 -1
- data/lib/less/js/test/less/compression/compression.less +21 -1
- data/lib/less/js/test/less/css-3.less +12 -0
- data/lib/less/js/test/less/css-guards.less +99 -0
- data/lib/less/js/test/less/debug/linenumbers.less +11 -1
- data/lib/less/js/test/less/empty.less +0 -0
- data/lib/less/js/test/less/errors/add-mixed-units.txt +4 -2
- data/lib/less/js/test/less/errors/add-mixed-units2.txt +4 -2
- data/lib/less/js/test/less/errors/color-func-invalid-color.less +3 -0
- data/lib/less/js/test/less/errors/color-func-invalid-color.txt +4 -0
- data/lib/less/js/test/less/errors/css-guard-default-func.less +4 -0
- data/lib/less/js/test/less/errors/css-guard-default-func.txt +4 -0
- data/lib/less/js/test/less/errors/import-subfolder2.txt +4 -2
- data/lib/less/js/test/less/errors/javascript-undefined-var.less +3 -0
- data/lib/less/js/test/less/errors/javascript-undefined-var.txt +4 -0
- data/lib/less/js/test/less/errors/mixins-guards-default-func-1.less +9 -0
- data/lib/less/js/test/less/errors/mixins-guards-default-func-1.txt +4 -0
- data/lib/less/js/test/less/errors/mixins-guards-default-func-2.less +9 -0
- data/lib/less/js/test/less/errors/mixins-guards-default-func-2.txt +4 -0
- data/lib/less/js/test/less/errors/mixins-guards-default-func-3.less +9 -0
- data/lib/less/js/test/less/errors/mixins-guards-default-func-3.txt +4 -0
- data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors.less +4 -0
- data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors.txt +4 -0
- data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors2.less +4 -0
- data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors2.txt +4 -0
- data/lib/less/js/test/less/errors/parse-error-curly-bracket.less +4 -1
- data/lib/less/js/test/less/errors/parse-error-curly-bracket.txt +4 -2
- data/lib/less/js/test/less/errors/parse-error-extra-parens.less +5 -0
- data/lib/less/js/test/less/errors/parse-error-extra-parens.txt +3 -0
- data/lib/less/js/test/less/errors/parse-error-missing-bracket.txt +2 -2
- data/lib/less/js/test/less/errors/parse-error-missing-parens.less +5 -0
- data/lib/less/js/test/less/errors/parse-error-missing-parens.txt +3 -0
- data/lib/less/js/test/less/errors/property-asterisk-only-name.less +3 -0
- data/lib/less/js/test/less/errors/property-asterisk-only-name.txt +4 -0
- data/lib/less/js/test/less/errors/property-interp-not-defined.less +1 -0
- data/lib/less/js/test/less/errors/property-interp-not-defined.txt +2 -0
- data/lib/less/js/test/less/errors/svg-gradient1.less +3 -0
- data/lib/less/js/test/less/errors/svg-gradient1.txt +4 -0
- data/lib/less/js/test/less/errors/svg-gradient2.less +3 -0
- data/lib/less/js/test/less/errors/svg-gradient2.txt +4 -0
- data/lib/less/js/test/less/errors/svg-gradient3.less +3 -0
- data/lib/less/js/test/less/errors/svg-gradient3.txt +4 -0
- data/lib/less/js/test/less/errors/unit-function.less +3 -0
- data/lib/less/js/test/less/errors/unit-function.txt +4 -0
- data/lib/less/js/test/less/extend-chaining.less +12 -0
- data/lib/less/js/test/less/extend-selector.less +15 -0
- data/lib/less/js/test/less/extract-and-length.less +133 -0
- data/lib/less/js/test/less/functions.less +15 -2
- data/lib/less/js/test/less/globalVars/extended.json +5 -0
- data/lib/less/js/test/less/globalVars/extended.less +10 -0
- data/lib/less/js/test/less/globalVars/simple.json +3 -0
- data/lib/less/js/test/less/globalVars/simple.less +3 -0
- data/lib/less/js/test/less/import-inline.less +2 -0
- data/lib/less/js/test/less/import-once.less +2 -0
- data/lib/less/js/test/less/import-reference.less +18 -0
- data/lib/less/js/test/less/import/import-and-relative-paths-test.less +11 -0
- data/lib/less/js/test/less/import/import-reference.less +43 -0
- data/lib/less/js/test/less/import/import-test-f.less +5 -0
- data/lib/less/js/test/less/import/invalid-css.less +1 -0
- data/lib/less/js/test/less/media.less +25 -1
- data/lib/less/js/test/less/merge.less +59 -0
- data/lib/less/js/test/less/mixins-args.less +10 -0
- data/lib/less/js/test/less/mixins-guards-default-func.less +195 -0
- data/lib/less/js/test/less/mixins-guards.less +16 -0
- data/lib/less/js/test/less/mixins-important.less +4 -1
- data/lib/less/js/test/less/mixins-interpolated.less +69 -0
- data/lib/less/js/test/less/mixins.less +27 -0
- data/lib/less/js/test/less/modifyVars/extended.json +5 -0
- data/lib/less/js/test/less/modifyVars/extended.less +11 -0
- data/lib/less/js/test/less/no-js-errors/no-js-errors.less +3 -0
- data/lib/less/js/test/less/no-js-errors/no-js-errors.txt +4 -0
- data/lib/less/js/test/less/no-output.less +2 -0
- data/lib/less/js/test/less/parens.less +4 -0
- data/lib/less/js/test/less/property-name-interp.less +53 -0
- data/lib/less/js/test/less/selectors.less +13 -0
- data/lib/less/js/test/less/sourcemaps/basic.json +3 -0
- data/lib/less/js/test/less/sourcemaps/basic.less +27 -0
- data/lib/less/js/test/less/sourcemaps/imported.css +7 -0
- data/lib/less/js/test/less/strings.less +6 -0
- data/lib/less/js/test/less/url-args/urls.less +63 -0
- data/lib/less/js/test/less/urls.less +15 -0
- data/lib/less/js/test/rhino/test-header.js +15 -0
- data/lib/less/js/test/sourcemaps/basic.json +1 -0
- data/lib/less/js/test/sourcemaps/index.html +17 -0
- data/lib/less/loader.rb +48 -40
- data/lib/less/version.rb +1 -1
- data/spec/less/parser_spec.rb +15 -15
- metadata +146 -40
- data/lib/less/js/Makefile +0 -102
- data/lib/less/js/build/header.js +0 -9
- data/lib/less/js/test/browser-test-prepare.js +0 -46
- data/lib/less/js/test/browser/runner-errors.js +0 -5
- data/lib/less/js/test/browser/runner-main.js +0 -15
- data/lib/less/js/test/browser/template.htm +0 -10
- data/lib/less/js/test/less/errors/color-operation-error.txt +0 -2
data/lib/less/js/package.json
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "less",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.6.2",
|
4
4
|
"description": "Leaner CSS",
|
5
5
|
"homepage": "http://lesscss.org",
|
6
|
-
"author":
|
6
|
+
"author": {
|
7
|
+
"name": "Alexis Sellier",
|
8
|
+
"email": "self@cloudhead.net"
|
9
|
+
},
|
7
10
|
"contributors": [
|
8
11
|
"The Core Less Team"
|
9
12
|
],
|
@@ -14,6 +17,12 @@
|
|
14
17
|
"type": "git",
|
15
18
|
"url": "https://github.com/less/less.js.git"
|
16
19
|
},
|
20
|
+
"licenses": [
|
21
|
+
{
|
22
|
+
"type": "Apache v2",
|
23
|
+
"url": "https://github.com/less/less.js/blob/master/LICENSE"
|
24
|
+
}
|
25
|
+
],
|
17
26
|
"bin": {
|
18
27
|
"lessc": "./bin/lessc"
|
19
28
|
},
|
@@ -22,23 +31,35 @@
|
|
22
31
|
"test": "./test"
|
23
32
|
},
|
24
33
|
"jam": {
|
25
|
-
"main": "./dist/less-1.
|
34
|
+
"main": "./dist/less-1.5.0.js"
|
26
35
|
},
|
27
36
|
"engines": {
|
28
37
|
"node": ">=0.4.2"
|
29
38
|
},
|
30
39
|
"scripts": {
|
31
|
-
"test": "
|
40
|
+
"test": "grunt test"
|
32
41
|
},
|
33
42
|
"optionalDependencies": {
|
34
43
|
"mime": "1.2.x",
|
35
44
|
"request": ">=2.12.0",
|
36
|
-
"mkdirp": "~0.3.
|
37
|
-
"
|
45
|
+
"mkdirp": "~0.3.5",
|
46
|
+
"clean-css": "2.0.x",
|
47
|
+
"source-map": "0.1.x"
|
38
48
|
},
|
39
49
|
"devDependencies": {
|
40
|
-
"diff": "~1.0"
|
41
|
-
|
50
|
+
"diff": "~1.0",
|
51
|
+
"grunt": "~0.4.1",
|
52
|
+
"grunt-contrib-clean": "~0.5.0",
|
53
|
+
"grunt-contrib-concat": "~0.3.0",
|
54
|
+
"grunt-contrib-connect": "~0.3.0",
|
55
|
+
"grunt-contrib-jasmine": "~0.5.2",
|
56
|
+
"grunt-contrib-jshint": "~0.7.2",
|
57
|
+
"grunt-contrib-uglify": "~0.2.7",
|
58
|
+
"grunt-shell": "~0.3.1",
|
59
|
+
"http-server": "~0.5.5",
|
60
|
+
"matchdep": "~0.1.2",
|
61
|
+
"time-grunt": "~0.1.1"
|
62
|
+
},
|
42
63
|
"keywords": [
|
43
64
|
"compile less",
|
44
65
|
"css nesting",
|
@@ -63,11 +84,5 @@
|
|
63
84
|
"stylesheet",
|
64
85
|
"variables in css",
|
65
86
|
"css less"
|
66
|
-
],
|
67
|
-
"licenses": [
|
68
|
-
{
|
69
|
-
"type": "Apache v2",
|
70
|
-
"url": "https://github.com/less/less.js/blob/master/LICENSE"
|
71
|
-
}
|
72
87
|
]
|
73
|
-
}
|
88
|
+
}
|
@@ -1,99 +1,174 @@
|
|
1
|
-
/*if not async then phantomjs fails to run the webserver and the test concurrently*/
|
2
|
-
var less = { async: true, strictMath: true };
|
3
|
-
|
4
1
|
/* record log messages for testing */
|
2
|
+
// var logAllIds = function() {
|
3
|
+
// var allTags = document.head.getElementsByTagName('style');
|
4
|
+
// var ids = [];
|
5
|
+
// for (var tg = 0; tg < allTags.length; tg++) {
|
6
|
+
// var tag = allTags[tg];
|
7
|
+
// if (tag.id) {
|
8
|
+
// console.log(tag.id);
|
9
|
+
// }
|
10
|
+
// }
|
11
|
+
// };
|
12
|
+
|
5
13
|
var logMessages = [],
|
6
|
-
|
14
|
+
realConsoleLog = console.log;
|
7
15
|
console.log = function(msg) {
|
8
|
-
|
9
|
-
|
16
|
+
logMessages.push(msg);
|
17
|
+
realConsoleLog.call(console, msg);
|
10
18
|
};
|
11
19
|
|
12
20
|
var testLessEqualsInDocument = function() {
|
13
|
-
|
21
|
+
testLessInDocument(testSheet);
|
14
22
|
};
|
15
23
|
|
16
|
-
var testLessErrorsInDocument = function() {
|
17
|
-
testLessInDocument(testErrorSheet);
|
24
|
+
var testLessErrorsInDocument = function(isConsole) {
|
25
|
+
testLessInDocument(isConsole ? testErrorSheetConsole : testErrorSheet);
|
18
26
|
};
|
19
27
|
|
20
28
|
var testLessInDocument = function(testFunc) {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
}
|
29
|
+
var links = document.getElementsByTagName('link'),
|
30
|
+
typePattern = /^text\/(x-)?less$/;
|
31
|
+
|
32
|
+
for (var i = 0; i < links.length; i++) {
|
33
|
+
if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&
|
34
|
+
(links[i].type.match(typePattern)))) {
|
35
|
+
testFunc(links[i]);
|
29
36
|
}
|
37
|
+
}
|
30
38
|
};
|
31
39
|
|
32
40
|
var testSheet = function(sheet) {
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
41
|
+
it(sheet.id + " should match the expected output", function() {
|
42
|
+
var lessOutputId = sheet.id.replace("original-", ""),
|
43
|
+
expectedOutputId = "expected-" + lessOutputId,
|
44
|
+
lessOutputObj,
|
45
|
+
lessOutput,
|
46
|
+
expectedOutputHref = document.getElementById(expectedOutputId).href,
|
47
|
+
expectedOutput = loadFile(expectedOutputHref);
|
48
|
+
|
49
|
+
// Browser spec generates less on the fly, so we need to loose control
|
50
|
+
waitsFor(function() {
|
51
|
+
lessOutputObj = document.getElementById(lessOutputId);
|
52
|
+
// the type condition is necessary because of inline browser tests
|
53
|
+
return lessOutputObj !== null && lessOutputObj.type === "text/css";
|
54
|
+
}, "generation of " + lessOutputId + "", 700);
|
55
|
+
|
56
|
+
runs(function() {
|
57
|
+
lessOutput = lessOutputObj.innerText || lessOutputObj.innerHTML;
|
58
|
+
});
|
39
59
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
expect(
|
47
|
-
});
|
60
|
+
waitsFor(function() {
|
61
|
+
return expectedOutput.loaded;
|
62
|
+
}, "failed to load expected outout", 10000);
|
63
|
+
|
64
|
+
runs(function() {
|
65
|
+
// use sheet to do testing
|
66
|
+
expect(expectedOutput.text).toEqual(lessOutput);
|
48
67
|
});
|
68
|
+
});
|
49
69
|
};
|
50
70
|
|
71
|
+
//TODO: do it cleaner - the same way as in css
|
72
|
+
|
73
|
+
function extractId(href) {
|
74
|
+
return href.replace(/^[a-z-]+:\/+?[^\/]+/, '') // Remove protocol & domain
|
75
|
+
.replace(/^\//, '') // Remove root /
|
76
|
+
.replace(/\.[a-zA-Z]+$/, '') // Remove simple extension
|
77
|
+
.replace(/[^\.\w-]+/g, '-') // Replace illegal characters
|
78
|
+
.replace(/\./g, ':'); // Replace dots with colons(for valid id)
|
79
|
+
}
|
80
|
+
|
51
81
|
var testErrorSheet = function(sheet) {
|
82
|
+
it(sheet.id + " should match an error", function() {
|
83
|
+
var lessHref = sheet.href,
|
84
|
+
id = "less-error-message:" + extractId(lessHref),
|
85
|
+
// id = sheet.id.replace(/^original-less:/, "less-error-message:"),
|
86
|
+
errorHref = lessHref.replace(/.less$/, ".txt"),
|
87
|
+
errorFile = loadFile(errorHref),
|
88
|
+
actualErrorElement,
|
89
|
+
actualErrorMsg;
|
90
|
+
|
91
|
+
// Less.js sets 10ms timer in order to add error message on top of page.
|
92
|
+
waitsFor(function() {
|
93
|
+
actualErrorElement = document.getElementById(id);
|
94
|
+
return actualErrorElement !== null;
|
95
|
+
}, "error message was not generated", 70);
|
96
|
+
|
97
|
+
runs(function() {
|
98
|
+
actualErrorMsg = actualErrorElement.innerText
|
99
|
+
.replace(/\n\d+/g, function(lineNo) {
|
100
|
+
return lineNo + " ";
|
101
|
+
})
|
102
|
+
.replace(/\n\s*in /g, " in ")
|
103
|
+
.replace("\n\n", "\n");
|
104
|
+
});
|
105
|
+
|
106
|
+
waitsFor(function() {
|
107
|
+
return errorFile.loaded;
|
108
|
+
}, "failed to load expected outout", 10000);
|
109
|
+
|
110
|
+
runs(function() {
|
111
|
+
var errorTxt = errorFile.text
|
112
|
+
.replace("{path}", "")
|
113
|
+
.replace("{pathrel}", "")
|
114
|
+
.replace("{pathhref}", "http://localhost:8081/test/less/errors/")
|
115
|
+
.replace("{404status}", " (404)");
|
116
|
+
expect(errorTxt).toEqual(actualErrorMsg);
|
117
|
+
if (errorTxt == actualErrorMsg) {
|
118
|
+
actualErrorElement.style.display = "none";
|
119
|
+
}
|
120
|
+
});
|
121
|
+
});
|
122
|
+
};
|
123
|
+
|
124
|
+
var testErrorSheetConsole = function(sheet) {
|
52
125
|
it(sheet.id + " should match an error", function() {
|
53
126
|
var lessHref = sheet.href,
|
54
127
|
id = sheet.id.replace(/^original-less:/, "less-error-message:"),
|
55
128
|
errorHref = lessHref.replace(/.less$/, ".txt"),
|
56
129
|
errorFile = loadFile(errorHref),
|
57
130
|
actualErrorElement = document.getElementById(id),
|
58
|
-
actualErrorMsg;
|
131
|
+
actualErrorMsg = logMessages[logMessages.length - 1];
|
59
132
|
|
60
133
|
describe("the error", function() {
|
61
|
-
expect(actualErrorElement).
|
134
|
+
expect(actualErrorElement).toBe(null);
|
135
|
+
|
62
136
|
});
|
63
|
-
|
64
|
-
actualErrorMsg = actualErrorElement.innerText
|
65
|
-
|
66
|
-
|
67
|
-
|
137
|
+
|
138
|
+
/*actualErrorMsg = actualErrorElement.innerText
|
139
|
+
.replace(/\n\d+/g, function(lineNo) { return lineNo + " "; })
|
140
|
+
.replace(/\n\s*in /g, " in ")
|
141
|
+
.replace("\n\n", "\n");*/
|
68
142
|
|
69
143
|
waitsFor(function() {
|
70
144
|
return errorFile.loaded;
|
71
145
|
}, "failed to load expected outout", 10000);
|
72
|
-
|
146
|
+
|
73
147
|
runs(function() {
|
74
148
|
var errorTxt = errorFile.text
|
75
149
|
.replace("{path}", "")
|
76
150
|
.replace("{pathrel}", "")
|
77
|
-
.replace("{pathhref}", "http://localhost:8081/less/
|
78
|
-
.replace("{404status}", " (404)")
|
79
|
-
|
80
|
-
|
81
|
-
actualErrorElement.style.display = "none";
|
82
|
-
}
|
83
|
-
});
|
151
|
+
.replace("{pathhref}", "http://localhost:8081/browser/less/")
|
152
|
+
.replace("{404status}", " (404)")
|
153
|
+
.trim();
|
154
|
+
expect(errorTxt).toEqual(actualErrorMsg);
|
84
155
|
});
|
156
|
+
});
|
85
157
|
};
|
86
158
|
|
87
159
|
var loadFile = function(href) {
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
request.
|
96
|
-
|
160
|
+
var request = new XMLHttpRequest(),
|
161
|
+
response = {
|
162
|
+
loaded: false,
|
163
|
+
text: ""
|
164
|
+
};
|
165
|
+
request.open('GET', href, true);
|
166
|
+
request.onload = function(e) {
|
167
|
+
response.text = request.response.replace(/\r/g, "");
|
168
|
+
response.loaded = true;
|
169
|
+
};
|
170
|
+
request.send();
|
171
|
+
return response;
|
97
172
|
};
|
98
173
|
|
99
174
|
(function() {
|
@@ -119,7 +194,7 @@ var loadFile = function(href) {
|
|
119
194
|
|
120
195
|
function execJasmine() {
|
121
196
|
setTimeout(function() {
|
122
|
-
|
197
|
+
jasmineEnv.execute();
|
123
198
|
}, 3000);
|
124
199
|
}
|
125
200
|
|
@@ -1,21 +1,20 @@
|
|
1
|
-
@import "http://localhost:8081/browser/less/imports/modify-this.css";
|
2
|
-
|
3
|
-
@import "http://localhost:8081/browser/less/imports/modify-again.css";
|
1
|
+
@import "http://localhost:8081/test/browser/less/imports/modify-this.css";
|
2
|
+
@import "http://localhost:8081/test/browser/less/imports/modify-again.css";
|
4
3
|
.modify {
|
5
|
-
my-url: url("http://localhost:8081/browser/less/imports/a.png");
|
4
|
+
my-url: url("http://localhost:8081/test/browser/less/imports/a.png");
|
6
5
|
}
|
7
6
|
.modify {
|
8
|
-
my-url: url("http://localhost:8081/browser/less/imports/b.png");
|
7
|
+
my-url: url("http://localhost:8081/test/browser/less/imports/b.png");
|
9
8
|
}
|
10
9
|
@font-face {
|
11
10
|
src: url("/fonts/garamond-pro.ttf");
|
12
|
-
src: local(Futura-Medium), url(http://localhost:8081/browser/less/relative-urls/fonts.svg#MyGeometricModern) format("svg");
|
11
|
+
src: local(Futura-Medium), url(http://localhost:8081/test/browser/less/relative-urls/fonts.svg#MyGeometricModern) format("svg");
|
13
12
|
}
|
14
13
|
#shorthands {
|
15
14
|
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
|
16
15
|
}
|
17
16
|
#misc {
|
18
|
-
background-image: url(http://localhost:8081/browser/less/relative-urls/images/image.jpg);
|
17
|
+
background-image: url(http://localhost:8081/test/browser/less/relative-urls/images/image.jpg);
|
19
18
|
}
|
20
19
|
#data-uri {
|
21
20
|
background: url(data:image/png;charset=utf-8;base64,
|
@@ -29,8 +28,8 @@
|
|
29
28
|
background: transparent url('data:image/svg+xml, <svg version="1.1"><g></g></svg>');
|
30
29
|
}
|
31
30
|
.comma-delimited {
|
32
|
-
background: url(http://localhost:8081/browser/less/relative-urls/bg.jpg) no-repeat, url(http://localhost:8081/browser/less/relative-urls/bg.png) repeat-x top left, url(http://localhost:8081/browser/less/relative-urls/bg);
|
31
|
+
background: url(http://localhost:8081/test/browser/less/relative-urls/bg.jpg) no-repeat, url(http://localhost:8081/test/browser/less/relative-urls/bg.png) repeat-x top left, url(http://localhost:8081/test/browser/less/relative-urls/bg);
|
33
32
|
}
|
34
33
|
.values {
|
35
|
-
url: url('http://localhost:8081/browser/less/relative-urls/Trebuchet');
|
34
|
+
url: url('http://localhost:8081/test/browser/less/relative-urls/Trebuchet');
|
36
35
|
}
|
@@ -1,21 +1,20 @@
|
|
1
|
-
@import "http://localhost:8081/browser/less/modify-this.css";
|
2
|
-
|
3
|
-
@import "http://localhost:8081/browser/less/modify-again.css";
|
1
|
+
@import "http://localhost:8081/test/browser/less/modify-this.css";
|
2
|
+
@import "http://localhost:8081/test/browser/less/modify-again.css";
|
4
3
|
.modify {
|
5
|
-
my-url: url("http://localhost:8081/browser/less/a.png");
|
4
|
+
my-url: url("http://localhost:8081/test/browser/less/a.png");
|
6
5
|
}
|
7
6
|
.modify {
|
8
|
-
my-url: url("http://localhost:8081/browser/less/b.png");
|
7
|
+
my-url: url("http://localhost:8081/test/browser/less/b.png");
|
9
8
|
}
|
10
9
|
@font-face {
|
11
10
|
src: url("/fonts/garamond-pro.ttf");
|
12
|
-
src: local(Futura-Medium), url(http://localhost:8081/browser/less/fonts.svg#MyGeometricModern) format("svg");
|
11
|
+
src: local(Futura-Medium), url(http://localhost:8081/test/browser/less/fonts.svg#MyGeometricModern) format("svg");
|
13
12
|
}
|
14
13
|
#shorthands {
|
15
14
|
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
|
16
15
|
}
|
17
16
|
#misc {
|
18
|
-
background-image: url(http://localhost:8081/browser/less/images/image.jpg);
|
17
|
+
background-image: url(http://localhost:8081/test/browser/less/images/image.jpg);
|
19
18
|
}
|
20
19
|
#data-uri {
|
21
20
|
background: url(data:image/png;charset=utf-8;base64,
|
@@ -29,21 +28,26 @@
|
|
29
28
|
background: transparent url('data:image/svg+xml, <svg version="1.1"><g></g></svg>');
|
30
29
|
}
|
31
30
|
.comma-delimited {
|
32
|
-
background: url(http://localhost:8081/browser/less/bg.jpg) no-repeat, url(http://localhost:8081/browser/less/bg.png) repeat-x top left, url(http://localhost:8081/browser/less/bg);
|
31
|
+
background: url(http://localhost:8081/test/browser/less/bg.jpg) no-repeat, url(http://localhost:8081/test/browser/less/bg.png) repeat-x top left, url(http://localhost:8081/test/browser/less/bg);
|
33
32
|
}
|
34
33
|
.values {
|
35
|
-
url: url('http://localhost:8081/browser/less/Trebuchet');
|
34
|
+
url: url('http://localhost:8081/test/browser/less/Trebuchet');
|
36
35
|
}
|
37
36
|
#data-uri {
|
38
|
-
uri: url('http://localhost:8081/
|
37
|
+
uri: url('http://localhost:8081/test/data/image.jpg');
|
39
38
|
}
|
40
39
|
#data-uri-guess {
|
41
|
-
uri: url('http://localhost:8081/
|
40
|
+
uri: url('http://localhost:8081/test/data/image.jpg');
|
42
41
|
}
|
43
42
|
#data-uri-ascii {
|
44
|
-
uri-1: url('http://localhost:8081/
|
45
|
-
uri-2: url('http://localhost:8081/
|
43
|
+
uri-1: url('http://localhost:8081/test/data/page.html');
|
44
|
+
uri-2: url('http://localhost:8081/test/data/page.html');
|
46
45
|
}
|
47
46
|
#data-uri-toobig {
|
48
|
-
uri: url('http://localhost:8081/
|
47
|
+
uri: url('http://localhost:8081/test/data/data-uri-fail.png');
|
48
|
+
}
|
49
|
+
#svg-functions {
|
50
|
+
background-image: url('data:image/svg+xml,<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none"><linearGradient id="gradient" gradientUnits="userSpaceOnUse" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" stop-color="#000000"/><stop offset="100%" stop-color="#ffffff"/></linearGradient><rect x="0" y="0" width="1" height="1" fill="url(#gradient)" /></svg>');
|
51
|
+
background-image: url('data:image/svg+xml,<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none"><linearGradient id="gradient" gradientUnits="userSpaceOnUse" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="0%" stop-color="#000000"/><stop offset="3%" stop-color="#ffa500"/><stop offset="100%" stop-color="#ffffff"/></linearGradient><rect x="0" y="0" width="1" height="1" fill="url(#gradient)" /></svg>');
|
52
|
+
background-image: url('data:image/svg+xml,<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none"><linearGradient id="gradient" gradientUnits="userSpaceOnUse" x1="0%" y1="0%" x2="0%" y2="100%"><stop offset="1%" stop-color="#c4c4c4"/><stop offset="3%" stop-color="#ffa500"/><stop offset="5%" stop-color="#008000"/><stop offset="95%" stop-color="#ffffff"/></linearGradient><rect x="0" y="0" width="1" height="1" fill="url(#gradient)" /></svg>');
|
49
53
|
}
|