less 2.2.2 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Changelog.md +17 -0
- data/Gemfile +7 -3
- data/README.md +29 -13
- data/bin/lessc +3 -1
- data/less.gemspec +2 -6
- data/lib/less/defaults.rb +3 -3
- data/lib/less/java_script/rhino_context.rb +17 -27
- data/lib/less/java_script/v8_context.rb +11 -11
- data/lib/less/js/.gitattributes +10 -0
- data/lib/less/js/.gitignore +24 -0
- data/lib/less/js/.jshintrc +11 -0
- data/lib/less/js/.npmignore +1 -0
- data/lib/less/js/.travis.yml +8 -0
- data/lib/less/js/CHANGELOG.md +299 -0
- data/lib/less/js/CONTRIBUTING.md +50 -0
- data/lib/less/js/Gruntfile.js +298 -0
- data/lib/less/js/README.md +43 -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 +310 -37
- data/lib/less/js/bower.json +18 -0
- data/lib/less/js/build/README.md +51 -0
- data/lib/less/js/build/amd.js +1 -1
- data/lib/less/js/build/browser-header.js +4 -0
- data/lib/less/js/build/build.yml +162 -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/build.gradle +347 -0
- data/lib/less/js/dist/less-1.3.1.js +4011 -0
- data/lib/less/js/dist/less-1.3.1.min.js +9 -0
- data/lib/less/js/dist/less-1.3.2.js +4401 -0
- data/lib/less/js/dist/less-1.3.2.min.js +9 -0
- data/lib/less/js/dist/less-1.3.3.js +4413 -0
- data/lib/less/js/dist/less-1.3.3.min.js +9 -0
- data/lib/less/js/dist/less-1.4.0-beta.js +5830 -0
- data/lib/less/js/dist/less-1.4.0-beta.min.js +11 -0
- data/lib/less/js/dist/less-1.4.0.js +5830 -0
- data/lib/less/js/dist/less-1.4.0.min.js +11 -0
- data/lib/less/js/dist/less-1.4.1.js +5837 -0
- data/lib/less/js/dist/less-1.4.1.min.js +11 -0
- data/lib/less/js/dist/less-1.4.2.js +5837 -0
- data/lib/less/js/dist/less-1.4.2.min.js +11 -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-1.6.3.js +7627 -0
- data/lib/less/js/dist/less-1.6.3.min.js +16 -0
- data/lib/less/js/dist/less-1.7.0.js +7921 -0
- data/lib/less/js/dist/less-1.7.0.min.js +16 -0
- data/lib/less/js/dist/less-rhino-1.3.1.js +3725 -0
- data/lib/less/js/dist/less-rhino-1.3.2.js +3990 -0
- data/lib/less/js/dist/less-rhino-1.3.3.js +4002 -0
- data/lib/less/js/dist/less-rhino-1.4.0.js +4273 -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/less-rhino-1.6.3.js +9020 -0
- data/lib/less/js/dist/less-rhino-1.7.0.js +9301 -0
- data/lib/less/js/dist/lessc-rhino-1.6.2.js +449 -0
- data/lib/less/js/dist/lessc-rhino-1.6.3.js +449 -0
- data/lib/less/js/dist/lessc-rhino-1.7.0.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 +547 -250
- data/lib/less/js/lib/less/encoder.js +4 -0
- data/lib/less/js/lib/less/env.js +136 -0
- data/lib/less/js/lib/less/extend-visitor.js +416 -0
- data/lib/less/js/lib/less/functions.js +576 -36
- data/lib/less/js/lib/less/import-visitor.js +142 -0
- data/lib/less/js/lib/less/index.js +187 -83
- data/lib/less/js/lib/less/join-selector-visitor.js +44 -0
- data/lib/less/js/lib/less/lessc_helper.js +82 -0
- data/lib/less/js/lib/less/parser.js +1286 -523
- data/lib/less/js/lib/less/rhino.js +415 -29
- data/lib/less/js/lib/less/source-map-output.js +141 -0
- data/lib/less/js/lib/less/to-css-visitor.js +240 -0
- data/lib/less/js/lib/less/tree/alpha.js +17 -5
- data/lib/less/js/lib/less/tree/anonymous.js +25 -4
- data/lib/less/js/lib/less/tree/assignment.js +17 -5
- data/lib/less/js/lib/less/tree/call.js +36 -13
- data/lib/less/js/lib/less/tree/color.js +119 -31
- data/lib/less/js/lib/less/tree/comment.js +18 -4
- data/lib/less/js/lib/less/tree/condition.js +35 -28
- data/lib/less/js/lib/less/tree/detached-ruleset.js +20 -0
- data/lib/less/js/lib/less/tree/dimension.js +291 -16
- data/lib/less/js/lib/less/tree/directive.js +56 -22
- data/lib/less/js/lib/less/tree/element.js +78 -17
- data/lib/less/js/lib/less/tree/expression.js +39 -8
- data/lib/less/js/lib/less/tree/extend.js +53 -0
- data/lib/less/js/lib/less/tree/import.js +81 -36
- data/lib/less/js/lib/less/tree/javascript.js +17 -10
- data/lib/less/js/lib/less/tree/keyword.js +8 -3
- data/lib/less/js/lib/less/tree/media.js +70 -27
- data/lib/less/js/lib/less/tree/mixin.js +250 -70
- data/lib/less/js/lib/less/tree/negative.js +24 -0
- data/lib/less/js/lib/less/tree/operation.js +38 -13
- data/lib/less/js/lib/less/tree/paren.js +9 -2
- data/lib/less/js/lib/less/tree/quoted.js +29 -10
- data/lib/less/js/lib/less/tree/rule.js +77 -29
- data/lib/less/js/lib/less/tree/ruleset-call.js +16 -0
- data/lib/less/js/lib/less/tree/ruleset.js +445 -107
- data/lib/less/js/lib/less/tree/selector.js +117 -30
- data/lib/less/js/lib/less/tree/unicode-descriptor.js +15 -0
- data/lib/less/js/lib/less/tree/url.js +43 -15
- data/lib/less/js/lib/less/tree/value.js +16 -6
- data/lib/less/js/lib/less/tree/variable.js +26 -8
- data/lib/less/js/lib/less/tree.js +82 -2
- data/lib/less/js/lib/less/visitor.js +146 -0
- 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 +86 -11
- data/lib/less/js/test/browser/common.js +201 -0
- 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/postProcessor/postProcessor.css +4 -0
- data/lib/less/js/test/browser/css/relative-urls/urls.css +35 -0
- data/lib/less/js/test/browser/css/rootpath/urls.css +35 -0
- data/lib/less/js/test/browser/css/rootpath-relative/urls.css +35 -0
- data/lib/less/js/test/browser/css/urls.css +53 -0
- data/lib/less/js/test/browser/es5.js +27 -0
- data/lib/less/js/test/browser/jasmine-html.js +681 -0
- data/lib/less/js/test/browser/jasmine.css +82 -0
- data/lib/less/js/test/browser/jasmine.js +2600 -0
- data/lib/less/js/test/browser/less/console-errors/test-error.less +3 -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/imports/urls.less +4 -0
- data/lib/less/js/test/browser/less/imports/urls2.less +4 -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/postProcessor/postProcessor.less +4 -0
- data/lib/less/js/test/browser/less/relative-urls/urls.less +33 -0
- data/lib/less/js/test/browser/less/rootpath/urls.less +33 -0
- data/lib/less/js/test/browser/less/rootpath-relative/urls.less +33 -0
- data/lib/less/js/test/browser/less/urls.less +57 -0
- data/lib/less/js/test/browser/phantom-runner.js +150 -0
- data/lib/less/js/test/browser/runner-browser-options.js +42 -0
- data/lib/less/js/test/browser/runner-browser-spec.js +12 -0
- 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-spec.js +3 -0
- 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-postProcessor-options.js +4 -0
- data/lib/less/js/test/browser/runner-postProcessor.js +3 -0
- data/lib/less/js/test/browser/runner-production-options.js +3 -0
- data/lib/less/js/test/browser/runner-production-spec.js +5 -0
- data/lib/less/js/test/browser/runner-relative-urls-options.js +3 -0
- data/lib/less/js/test/browser/runner-relative-urls-spec.js +3 -0
- 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-spec.js +3 -0
- data/lib/less/js/test/browser/runner-rootpath-spec.js +3 -0
- data/lib/less/js/test/browser/test-runner-template.tmpl +47 -0
- data/lib/less/js/test/css/charsets.css +1 -0
- data/lib/less/js/test/css/colors.css +29 -0
- data/lib/less/js/test/css/comments.css +15 -2
- data/lib/less/js/test/css/compression/compression.css +3 -0
- data/lib/less/js/test/css/css-3.css +73 -2
- data/lib/less/js/test/css/css-escapes.css +4 -0
- data/lib/less/js/test/css/css-guards.css +37 -0
- data/lib/less/js/test/css/css.css +20 -14
- data/lib/less/js/test/css/debug/linenumbers-all.css +49 -0
- data/lib/less/js/test/css/debug/linenumbers-comments.css +40 -0
- data/lib/less/js/test/css/debug/linenumbers-mediaquery.css +40 -0
- data/lib/less/js/test/css/detached-rulesets.css +71 -0
- data/lib/less/js/test/css/empty.css +0 -0
- data/lib/less/js/test/css/extend-chaining.css +81 -0
- data/lib/less/js/test/css/extend-clearfix.css +19 -0
- data/lib/less/js/test/css/extend-exact.css +37 -0
- data/lib/less/js/test/css/extend-media.css +24 -0
- data/lib/less/js/test/css/extend-nest.css +57 -0
- data/lib/less/js/test/css/extend-selector.css +80 -0
- data/lib/less/js/test/css/extend.css +76 -0
- data/lib/less/js/test/css/extract-and-length.css +133 -0
- data/lib/less/js/test/css/functions.css +117 -2
- 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/ie-filters.css +7 -3
- data/lib/less/js/test/css/import-inline.css +5 -0
- data/lib/less/js/test/css/import-interpolation.css +6 -0
- data/lib/less/js/test/css/import-once.css +15 -0
- data/lib/less/js/test/css/import-reference.css +68 -0
- data/lib/less/js/test/css/import.css +23 -10
- data/lib/less/js/test/css/javascript.css +3 -2
- data/lib/less/js/test/css/legacy/legacy.css +7 -0
- data/lib/less/js/test/css/media.css +141 -1
- data/lib/less/js/test/css/merge.css +34 -0
- data/lib/less/js/test/css/mixins-args.css +41 -4
- data/lib/less/js/test/css/mixins-guards-default-func.css +129 -0
- data/lib/less/js/test/css/mixins-guards.css +24 -0
- data/lib/less/js/test/css/mixins-important.css +28 -0
- data/lib/less/js/test/css/mixins-interpolated.css +39 -0
- data/lib/less/js/test/css/mixins-named-args.css +27 -0
- data/lib/less/js/test/css/mixins-pattern.css +4 -0
- data/lib/less/js/test/css/mixins.css +70 -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 +21 -5
- data/lib/less/js/test/css/property-name-interp.css +20 -0
- data/lib/less/js/test/css/scope.css +23 -0
- data/lib/less/js/test/css/selectors.css +84 -0
- data/lib/less/js/test/css/static-urls/urls.css +45 -0
- data/lib/less/js/test/css/strings.css +5 -2
- data/lib/less/js/test/css/url-args/urls.css +56 -0
- data/lib/less/js/test/css/urls.css +71 -0
- data/lib/less/js/test/css/variables-in-at-rules.css +18 -0
- data/lib/less/js/test/css/variables.css +22 -4
- data/lib/less/js/test/css/whitespace.css +4 -0
- data/lib/less/js/test/data/data-uri-fail.png +0 -0
- data/lib/less/js/test/data/image.jpg +1 -0
- data/lib/less/js/test/data/page.html +1 -0
- data/lib/less/js/test/index.js +45 -0
- data/lib/less/js/test/less/charsets.less +3 -0
- data/lib/less/js/test/less/colors.less +37 -4
- data/lib/less/js/test/less/comments.less +21 -3
- data/lib/less/js/test/less/compression/compression.less +36 -0
- data/lib/less/js/test/less/css-3.less +70 -6
- data/lib/less/js/test/less/css-escapes.less +6 -1
- data/lib/less/js/test/less/css-guards.less +102 -0
- data/lib/less/js/test/less/css.less +23 -15
- data/lib/less/js/test/less/debug/import/test.less +25 -0
- data/lib/less/js/test/less/debug/linenumbers.less +33 -0
- data/lib/less/js/test/less/detached-rulesets.less +103 -0
- data/lib/less/js/test/less/empty.less +0 -0
- data/lib/less/js/test/less/errors/add-mixed-units.less +3 -0
- data/lib/less/js/test/less/errors/add-mixed-units.txt +4 -0
- data/lib/less/js/test/less/errors/add-mixed-units2.less +3 -0
- data/lib/less/js/test/less/errors/add-mixed-units2.txt +4 -0
- data/lib/less/js/test/less/errors/at-rules-undefined-var.less +4 -0
- data/lib/less/js/test/less/errors/at-rules-undefined-var.txt +4 -0
- data/lib/less/js/test/less/errors/bad-variable-declaration1.less +1 -0
- data/lib/less/js/test/less/errors/bad-variable-declaration1.txt +2 -0
- 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/comment-in-selector.less +1 -0
- data/lib/less/js/test/less/errors/comment-in-selector.txt +2 -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/detached-ruleset-1.less +6 -0
- data/lib/less/js/test/less/errors/detached-ruleset-1.txt +4 -0
- data/lib/less/js/test/less/errors/detached-ruleset-2.less +6 -0
- data/lib/less/js/test/less/errors/detached-ruleset-2.txt +4 -0
- data/lib/less/js/test/less/errors/detached-ruleset-3.less +4 -0
- data/lib/less/js/test/less/errors/detached-ruleset-3.txt +4 -0
- data/lib/less/js/test/less/errors/detached-ruleset-4.less +5 -0
- data/lib/less/js/test/less/errors/detached-ruleset-4.txt +3 -0
- data/lib/less/js/test/less/errors/detached-ruleset-5.less +4 -0
- data/lib/less/js/test/less/errors/detached-ruleset-5.txt +3 -0
- data/lib/less/js/test/less/errors/detached-ruleset-6.less +5 -0
- data/lib/less/js/test/less/errors/detached-ruleset-6.txt +4 -0
- data/lib/less/js/test/less/errors/divide-mixed-units.less +3 -0
- data/lib/less/js/test/less/errors/divide-mixed-units.txt +4 -0
- data/lib/less/js/test/less/errors/extend-no-selector.less +3 -0
- data/lib/less/js/test/less/errors/extend-no-selector.txt +3 -0
- data/lib/less/js/test/less/errors/extend-not-at-end.less +3 -0
- data/lib/less/js/test/less/errors/extend-not-at-end.txt +3 -0
- data/lib/less/js/test/less/errors/import-missing.less +6 -0
- data/lib/less/js/test/less/errors/import-missing.txt +3 -0
- data/lib/less/js/test/less/errors/import-no-semi.less +1 -0
- data/lib/less/js/test/less/errors/import-no-semi.txt +2 -0
- data/lib/less/js/test/less/errors/import-subfolder1.less +1 -0
- data/lib/less/js/test/less/errors/import-subfolder1.txt +3 -0
- data/lib/less/js/test/less/errors/import-subfolder2.less +1 -0
- data/lib/less/js/test/less/errors/import-subfolder2.txt +4 -0
- data/lib/less/js/test/less/errors/imports/import-subfolder1.less +1 -0
- data/lib/less/js/test/less/errors/imports/import-subfolder2.less +1 -0
- data/lib/less/js/test/less/errors/imports/import-test.less +4 -0
- data/lib/less/js/test/less/errors/imports/subfolder/mixin-not-defined.less +1 -0
- data/lib/less/js/test/less/errors/imports/subfolder/parse-error-curly-bracket.less +1 -0
- data/lib/less/js/test/less/errors/javascript-error.less +3 -0
- data/lib/less/js/test/less/errors/javascript-error.txt +4 -0
- 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/mixed-mixin-definition-args-1.less +6 -0
- data/lib/less/js/test/less/errors/mixed-mixin-definition-args-1.txt +4 -0
- data/lib/less/js/test/less/errors/mixed-mixin-definition-args-2.less +6 -0
- data/lib/less/js/test/less/errors/mixed-mixin-definition-args-2.txt +4 -0
- data/lib/less/js/test/less/errors/mixin-not-defined.less +11 -0
- data/lib/less/js/test/less/errors/mixin-not-defined.txt +3 -0
- data/lib/less/js/test/less/errors/mixin-not-matched.less +6 -0
- data/lib/less/js/test/less/errors/mixin-not-matched.txt +3 -0
- data/lib/less/js/test/less/errors/mixin-not-matched2.less +6 -0
- data/lib/less/js/test/less/errors/mixin-not-matched2.txt +3 -0
- data/lib/less/js/test/less/errors/mixin-not-visible-in-scope-1.less +9 -0
- data/lib/less/js/test/less/errors/mixin-not-visible-in-scope-1.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/multiply-mixed-units.less +7 -0
- data/lib/less/js/test/less/errors/multiply-mixed-units.txt +4 -0
- data/lib/less/js/test/less/errors/parens-error-1.less +3 -0
- data/lib/less/js/test/less/errors/parens-error-1.txt +4 -0
- data/lib/less/js/test/less/errors/parens-error-2.less +3 -0
- data/lib/less/js/test/less/errors/parens-error-2.txt +4 -0
- data/lib/less/js/test/less/errors/parens-error-3.less +3 -0
- data/lib/less/js/test/less/errors/parens-error-3.txt +4 -0
- data/lib/less/js/test/less/errors/parse-error-curly-bracket.less +4 -0
- data/lib/less/js/test/less/errors/parse-error-curly-bracket.txt +4 -0
- 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.less +2 -0
- data/lib/less/js/test/less/errors/parse-error-missing-bracket.txt +3 -0
- 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/parse-error-with-import.less +13 -0
- data/lib/less/js/test/less/errors/parse-error-with-import.txt +4 -0
- data/lib/less/js/test/less/errors/percentage-missing-space.less +3 -0
- data/lib/less/js/test/less/errors/percentage-missing-space.txt +4 -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-ie5-hack.less +3 -0
- data/lib/less/js/test/less/errors/property-ie5-hack.txt +4 -0
- data/lib/less/js/test/less/errors/property-in-root.less +4 -0
- data/lib/less/js/test/less/errors/property-in-root.txt +4 -0
- data/lib/less/js/test/less/errors/property-in-root2.less +1 -0
- data/lib/less/js/test/less/errors/property-in-root2.txt +4 -0
- data/lib/less/js/test/less/errors/property-in-root3.less +4 -0
- data/lib/less/js/test/less/errors/property-in-root3.txt +3 -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/recursive-variable.less +1 -0
- data/lib/less/js/test/less/errors/recursive-variable.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 +91 -0
- data/lib/less/js/test/less/extend-clearfix.less +19 -0
- data/lib/less/js/test/less/extend-exact.less +46 -0
- data/lib/less/js/test/less/extend-media.less +24 -0
- data/lib/less/js/test/less/extend-nest.less +65 -0
- data/lib/less/js/test/less/extend-selector.less +99 -0
- data/lib/less/js/test/less/extend.less +81 -0
- data/lib/less/js/test/less/extract-and-length.less +133 -0
- data/lib/less/js/test/less/functions.less +130 -6
- 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/ie-filters.less +7 -0
- data/lib/less/js/test/less/import/deeper/import-once-test-a.less +1 -0
- data/lib/less/js/test/less/import/import-and-relative-paths-test.less +17 -0
- data/lib/less/js/test/less/import/import-charset-test.less +1 -0
- data/lib/less/js/test/less/import/import-interpolation.less +1 -0
- data/lib/less/js/test/less/import/import-interpolation2.less +5 -0
- data/lib/less/js/test/less/import/import-once-test-c.less +6 -0
- data/lib/less/js/test/less/import/import-reference.less +51 -0
- data/lib/less/js/test/less/import/import-test-a.less +1 -0
- data/lib/less/js/test/less/import/import-test-c.less +0 -1
- data/lib/less/js/test/less/import/import-test-f.less +5 -0
- data/lib/less/js/test/less/import/imports/font.less +8 -0
- data/lib/less/js/test/less/import/imports/logo.less +5 -0
- data/lib/less/js/test/less/import/invalid-css.less +1 -0
- data/lib/less/js/test/less/import/urls.less +1 -0
- data/lib/less/js/test/less/import-inline.less +2 -0
- data/lib/less/js/test/less/import-interpolation.less +8 -0
- data/lib/less/js/test/less/import-once.less +6 -0
- data/lib/less/js/test/less/import-reference.less +21 -0
- data/lib/less/js/test/less/import.less +13 -3
- data/lib/less/js/test/less/javascript.less +5 -3
- data/lib/less/js/test/less/legacy/legacy.less +7 -0
- data/lib/less/js/test/less/media.less +158 -3
- data/lib/less/js/test/less/merge.less +78 -0
- data/lib/less/js/test/less/mixins-args.less +93 -15
- data/lib/less/js/test/less/mixins-guards-default-func.less +195 -0
- data/lib/less/js/test/less/mixins-guards.less +65 -0
- data/lib/less/js/test/less/mixins-important.less +8 -1
- data/lib/less/js/test/less/mixins-interpolated.less +69 -0
- data/lib/less/js/test/less/mixins-named-args.less +36 -0
- data/lib/less/js/test/less/mixins-nested.less +2 -2
- data/lib/less/js/test/less/mixins-pattern.less +4 -1
- data/lib/less/js/test/less/mixins.less +74 -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/operations.less +27 -27
- data/lib/less/js/test/less/parens.less +24 -5
- data/lib/less/js/test/less/property-name-interp.less +53 -0
- data/lib/less/js/test/less/scope.less +73 -1
- data/lib/less/js/test/less/selectors.less +101 -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/static-urls/urls.less +33 -0
- data/lib/less/js/test/less/strings.less +7 -1
- data/lib/less/js/test/less/url-args/urls.less +63 -0
- data/lib/less/js/test/less/urls.less +72 -0
- data/lib/less/js/test/less/variables-in-at-rules.less +20 -0
- data/lib/less/js/test/less/variables.less +42 -13
- data/lib/less/js/test/less/whitespace.less +7 -0
- data/lib/less/js/test/less-test.js +251 -65
- 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 +191 -27
- data/lib/less/parser.rb +47 -8
- data/lib/less/version.rb +2 -2
- data/spec/less/loader_spec.rb +45 -0
- data/spec/less/parser_spec.rb +43 -17
- data/spec/less/some/some.css +0 -0
- data/spec/less/some/some.less +4 -0
- metadata +352 -57
- data/lib/less/js/CHANGELOG +0 -41
- data/lib/less/js/Makefile +0 -75
- data/lib/less/js/build/ecma-5.js +0 -120
- data/lib/less/js/build/header.js +0 -7
- data/lib/less/js/lib/less/cssmin.js +0 -355
@@ -0,0 +1,33 @@
|
|
1
|
+
@import ".././imports/urls.less";
|
2
|
+
@import "http://localhost:8081/test/browser/less/imports/urls2.less";
|
3
|
+
@font-face {
|
4
|
+
src: url("/fonts/garamond-pro.ttf");
|
5
|
+
src: local(Futura-Medium),
|
6
|
+
url(fonts.svg#MyGeometricModern) format("svg");
|
7
|
+
}
|
8
|
+
#shorthands {
|
9
|
+
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
|
10
|
+
}
|
11
|
+
#misc {
|
12
|
+
background-image: url(images/image.jpg);
|
13
|
+
}
|
14
|
+
#data-uri {
|
15
|
+
background: url(data:image/png;charset=utf-8;base64,
|
16
|
+
kiVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/
|
17
|
+
k//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U
|
18
|
+
kg9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC);
|
19
|
+
background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
|
20
|
+
background-image: url(http://fonts.googleapis.com/css?family=\"Rokkitt\":\(400\),700);
|
21
|
+
}
|
22
|
+
|
23
|
+
#svg-data-uri {
|
24
|
+
background: transparent url('data:image/svg+xml, <svg version="1.1"><g></g></svg>');
|
25
|
+
}
|
26
|
+
|
27
|
+
.comma-delimited {
|
28
|
+
background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg);
|
29
|
+
}
|
30
|
+
.values {
|
31
|
+
@a: 'Trebuchet';
|
32
|
+
url: url(@a);
|
33
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
@import "../imports/urls.less";
|
2
|
+
@import "http://localhost:8081/test/browser/less/imports/urls2.less";
|
3
|
+
@font-face {
|
4
|
+
src: url("/fonts/garamond-pro.ttf");
|
5
|
+
src: local(Futura-Medium),
|
6
|
+
url(fonts.svg#MyGeometricModern) format("svg");
|
7
|
+
}
|
8
|
+
#shorthands {
|
9
|
+
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
|
10
|
+
}
|
11
|
+
#misc {
|
12
|
+
background-image: url(images/image.jpg);
|
13
|
+
}
|
14
|
+
#data-uri {
|
15
|
+
background: url(data:image/png;charset=utf-8;base64,
|
16
|
+
kiVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/
|
17
|
+
k//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U
|
18
|
+
kg9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC);
|
19
|
+
background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
|
20
|
+
background-image: url(http://fonts.googleapis.com/css?family=\"Rokkitt\":\(400\),700);
|
21
|
+
}
|
22
|
+
|
23
|
+
#svg-data-uri {
|
24
|
+
background: transparent url('data:image/svg+xml, <svg version="1.1"><g></g></svg>');
|
25
|
+
}
|
26
|
+
|
27
|
+
.comma-delimited {
|
28
|
+
background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg);
|
29
|
+
}
|
30
|
+
.values {
|
31
|
+
@a: 'Trebuchet';
|
32
|
+
url: url(@a);
|
33
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
@import "../imports/urls.less";
|
2
|
+
@import "http://localhost:8081/test/browser/less/imports/urls2.less";
|
3
|
+
@font-face {
|
4
|
+
src: url("/fonts/garamond-pro.ttf");
|
5
|
+
src: local(Futura-Medium),
|
6
|
+
url(fonts.svg#MyGeometricModern) format("svg");
|
7
|
+
}
|
8
|
+
#shorthands {
|
9
|
+
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
|
10
|
+
}
|
11
|
+
#misc {
|
12
|
+
background-image: url(images/image.jpg);
|
13
|
+
}
|
14
|
+
#data-uri {
|
15
|
+
background: url(data:image/png;charset=utf-8;base64,
|
16
|
+
kiVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/
|
17
|
+
k//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U
|
18
|
+
kg9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC);
|
19
|
+
background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
|
20
|
+
background-image: url(http://fonts.googleapis.com/css?family=\"Rokkitt\":\(400\),700);
|
21
|
+
}
|
22
|
+
|
23
|
+
#svg-data-uri {
|
24
|
+
background: transparent url('data:image/svg+xml, <svg version="1.1"><g></g></svg>');
|
25
|
+
}
|
26
|
+
|
27
|
+
.comma-delimited {
|
28
|
+
background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg);
|
29
|
+
}
|
30
|
+
.values {
|
31
|
+
@a: 'Trebuchet';
|
32
|
+
url: url(@a);
|
33
|
+
}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
@import "imports/urls.less";
|
2
|
+
@import "http://localhost:8081/test/browser/less/imports/urls2.less";
|
3
|
+
@font-face {
|
4
|
+
src: url("/fonts/garamond-pro.ttf");
|
5
|
+
src: local(Futura-Medium),
|
6
|
+
url(fonts.svg#MyGeometricModern) format("svg");
|
7
|
+
}
|
8
|
+
#shorthands {
|
9
|
+
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
|
10
|
+
}
|
11
|
+
#misc {
|
12
|
+
background-image: url(images/image.jpg);
|
13
|
+
}
|
14
|
+
#data-uri {
|
15
|
+
background: url(data:image/png;charset=utf-8;base64,
|
16
|
+
kiVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/
|
17
|
+
k//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U
|
18
|
+
kg9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC);
|
19
|
+
background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
|
20
|
+
background-image: url(http://fonts.googleapis.com/css?family=\"Rokkitt\":\(400\),700);
|
21
|
+
}
|
22
|
+
|
23
|
+
#svg-data-uri {
|
24
|
+
background: transparent url('data:image/svg+xml, <svg version="1.1"><g></g></svg>');
|
25
|
+
}
|
26
|
+
|
27
|
+
.comma-delimited {
|
28
|
+
background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg);
|
29
|
+
}
|
30
|
+
.values {
|
31
|
+
@a: 'Trebuchet';
|
32
|
+
url: url(@a);
|
33
|
+
}
|
34
|
+
#data-uri {
|
35
|
+
uri: data-uri('image/jpeg;base64', '../../data/image.jpg');
|
36
|
+
}
|
37
|
+
|
38
|
+
#data-uri-guess {
|
39
|
+
uri: data-uri('../../data/image.jpg');
|
40
|
+
}
|
41
|
+
|
42
|
+
#data-uri-ascii {
|
43
|
+
uri-1: data-uri('text/html', '../../data/page.html');
|
44
|
+
uri-2: data-uri('../../data/page.html');
|
45
|
+
}
|
46
|
+
|
47
|
+
#data-uri-toobig {
|
48
|
+
uri: data-uri('../../data/data-uri-fail.png');
|
49
|
+
}
|
50
|
+
#svg-functions {
|
51
|
+
background-image: svg-gradient(to bottom, black, white);
|
52
|
+
background-image: svg-gradient(to bottom, black, orange 3%, white);
|
53
|
+
@green_5: green 5%;
|
54
|
+
@orange_percentage: 3%;
|
55
|
+
@orange_color: orange;
|
56
|
+
background-image: svg-gradient(to bottom, (mix(black, white) + #444) 1%, @orange_color @orange_percentage, ((@green_5)), white 95%);
|
57
|
+
}
|
@@ -0,0 +1,150 @@
|
|
1
|
+
var webpage = require('webpage');
|
2
|
+
var server = require('webserver').create();
|
3
|
+
var system = require('system');
|
4
|
+
var fs = require('fs');
|
5
|
+
var host;
|
6
|
+
var port = 8081;
|
7
|
+
|
8
|
+
var listening = server.listen(port, function(request, response) {
|
9
|
+
//console.log("Requested " + request.url);
|
10
|
+
|
11
|
+
var filename = ("test/" + request.url.slice(1)).replace(/[\\\/]/g, fs.separator);
|
12
|
+
|
13
|
+
if (!fs.exists(filename) || !fs.isFile(filename)) {
|
14
|
+
response.statusCode = 404;
|
15
|
+
response.write("<html><head></head><body><h1>File Not Found</h1><h2>File:" + filename + "</h2></body></html>");
|
16
|
+
response.close();
|
17
|
+
return;
|
18
|
+
}
|
19
|
+
|
20
|
+
// we set the headers here
|
21
|
+
response.statusCode = 200;
|
22
|
+
response.headers = {
|
23
|
+
"Cache": "no-cache",
|
24
|
+
"Content-Type": "text/html"
|
25
|
+
};
|
26
|
+
|
27
|
+
response.write(fs.read(filename));
|
28
|
+
|
29
|
+
response.close();
|
30
|
+
});
|
31
|
+
if (!listening) {
|
32
|
+
console.log("could not create web server listening on port " + port);
|
33
|
+
phantom.exit();
|
34
|
+
}
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Wait until the test condition is true or a timeout occurs. Useful for waiting
|
38
|
+
* on a server response or for a ui change (fadeIn, etc.) to occur.
|
39
|
+
*
|
40
|
+
* @param testFx javascript condition that evaluates to a boolean,
|
41
|
+
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or
|
42
|
+
* as a callback function.
|
43
|
+
* @param onReady what to do when testFx condition is fulfilled,
|
44
|
+
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or
|
45
|
+
* as a callback function.
|
46
|
+
* @param timeOutMillis the max amount of time to wait. If not specified, 3 sec is used.
|
47
|
+
* @param timeOutErrorMessage the error message if time out occurs
|
48
|
+
*/
|
49
|
+
|
50
|
+
function waitFor(testFx, onReady, timeOutMillis, timeOutErrorMessage) {
|
51
|
+
var maxtimeOutMillis = timeOutMillis ? timeOutMillis : 10001, //< Default Max Timeout is 10s
|
52
|
+
start = new Date().getTime(),
|
53
|
+
condition = false,
|
54
|
+
interval = setInterval(function() {
|
55
|
+
if ((new Date().getTime() - start < maxtimeOutMillis) && !condition) {
|
56
|
+
// If not time-out yet and condition not yet fulfilled
|
57
|
+
condition = (typeof(testFx) === "string" ? eval(testFx) : testFx()); //< defensive code
|
58
|
+
} else {
|
59
|
+
if (!condition) {
|
60
|
+
// If condition still not fulfilled (timeout but condition is 'false')
|
61
|
+
console.log(timeOutErrorMessage || "'waitFor()' timeout");
|
62
|
+
phantom.exit(1);
|
63
|
+
} else {
|
64
|
+
// Condition fulfilled (timeout and/or condition is 'true')
|
65
|
+
typeof(onReady) === "string" ? eval(onReady) : onReady(); //< Do what it's supposed to do once the condition is fulfilled
|
66
|
+
clearInterval(interval); //< Stop this interval
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}, 100); //< repeat check every 100ms
|
70
|
+
}
|
71
|
+
|
72
|
+
function testPage(url) {
|
73
|
+
var page = webpage.create();
|
74
|
+
page.open(url, function(status) {
|
75
|
+
if (status !== "success") {
|
76
|
+
console.log("Unable to access network - " + status);
|
77
|
+
phantom.exit();
|
78
|
+
} else {
|
79
|
+
waitFor(function() {
|
80
|
+
return page.evaluate(function() {
|
81
|
+
return document.body && document.body.querySelector &&
|
82
|
+
document.body.querySelector('.symbolSummary .pending') === null &&
|
83
|
+
document.body.querySelector('.results') !== null;
|
84
|
+
});
|
85
|
+
}, function() {
|
86
|
+
page.onConsoleMessage = function(msg) {
|
87
|
+
console.log(msg);
|
88
|
+
};
|
89
|
+
var exitCode = page.evaluate(function() {
|
90
|
+
console.log('');
|
91
|
+
console.log(document.body.querySelector('.description').innerText);
|
92
|
+
var list = document.body.querySelectorAll('.results > #details > .specDetail.failed');
|
93
|
+
if (list && list.length > 0) {
|
94
|
+
console.log('');
|
95
|
+
console.log(list.length + ' test(s) FAILED:');
|
96
|
+
for (var i = 0; i < list.length; ++i) {
|
97
|
+
var el = list[i],
|
98
|
+
desc = el.querySelector('.description'),
|
99
|
+
msg = el.querySelector('.resultMessage.fail');
|
100
|
+
console.log('');
|
101
|
+
console.log(desc.innerText);
|
102
|
+
console.log(msg.innerText);
|
103
|
+
console.log('');
|
104
|
+
}
|
105
|
+
return 1;
|
106
|
+
} else {
|
107
|
+
console.log(document.body.querySelector('.alert > .passingAlert.bar').innerText);
|
108
|
+
return 0;
|
109
|
+
}
|
110
|
+
});
|
111
|
+
testFinished(exitCode);
|
112
|
+
},
|
113
|
+
10000, // 10 second timeout
|
114
|
+
"Test failed waiting for jasmine results on page: " + url);
|
115
|
+
}
|
116
|
+
});
|
117
|
+
}
|
118
|
+
|
119
|
+
function scanDirectory(path, regex) {
|
120
|
+
var files = [];
|
121
|
+
fs.list(path).forEach(function(file) {
|
122
|
+
if (file.match(regex)) {
|
123
|
+
files.push(file);
|
124
|
+
}
|
125
|
+
});
|
126
|
+
return files;
|
127
|
+
}
|
128
|
+
|
129
|
+
var totalTests = 0,
|
130
|
+
totalFailed = 0,
|
131
|
+
totalDone = 0;
|
132
|
+
|
133
|
+
function testFinished(failed) {
|
134
|
+
if (failed) {
|
135
|
+
totalFailed++;
|
136
|
+
}
|
137
|
+
totalDone++;
|
138
|
+
if (totalDone === totalTests) {
|
139
|
+
phantom.exit(totalFailed > 0 ? 1 : 0);
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
if (system.args.length != 2 && system.args[1] != "--no-tests") {
|
144
|
+
var files = scanDirectory("test/browser/", /^test-runner-.+\.htm$/);
|
145
|
+
totalTests = files.length;
|
146
|
+
console.log("found " + files.length + " tests");
|
147
|
+
files.forEach(function(file) {
|
148
|
+
testPage("http://localhost:8081/browser/" + file);
|
149
|
+
});
|
150
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
var less = {};
|
2
|
+
|
3
|
+
// There originally run inside describe method. However, since they have not
|
4
|
+
// been inside it, they run at jasmine compile time (not runtime). It all
|
5
|
+
// worked cause less.js was in async mode and custom phantom runner had
|
6
|
+
// different setup then grunt-contrib-jasmine. They have been created before
|
7
|
+
// less.js run, even as they have been defined in spec.
|
8
|
+
|
9
|
+
// test inline less in style tags by grabbing an assortment of less files and doing `@import`s
|
10
|
+
var testFiles = ['charsets', 'colors', 'comments', 'css-3', 'strings', 'media', 'mixins'],
|
11
|
+
testSheets = [];
|
12
|
+
|
13
|
+
// setup style tags with less and link tags pointing to expected css output
|
14
|
+
for (var i = 0; i < testFiles.length; i++) {
|
15
|
+
var file = testFiles[i],
|
16
|
+
lessPath = '/test/less/' + file + '.less',
|
17
|
+
cssPath = '/test/css/' + file + '.css',
|
18
|
+
lessStyle = document.createElement('style'),
|
19
|
+
cssLink = document.createElement('link'),
|
20
|
+
lessText = '@import "' + lessPath + '";';
|
21
|
+
|
22
|
+
lessStyle.type = 'text/less';
|
23
|
+
lessStyle.id = file;
|
24
|
+
lessStyle.href = file;
|
25
|
+
|
26
|
+
if (lessStyle.styleSheet) {
|
27
|
+
lessStyle.styleSheet.cssText = lessText;
|
28
|
+
} else {
|
29
|
+
lessStyle.innerHTML = lessText;
|
30
|
+
}
|
31
|
+
|
32
|
+
cssLink.rel = 'stylesheet';
|
33
|
+
cssLink.type = 'text/css';
|
34
|
+
cssLink.href = cssPath;
|
35
|
+
cssLink.id = 'expected-' + file;
|
36
|
+
|
37
|
+
var head = document.getElementsByTagName('head')[0];
|
38
|
+
|
39
|
+
head.appendChild(lessStyle);
|
40
|
+
head.appendChild(cssLink);
|
41
|
+
testSheets[i] = lessStyle;
|
42
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
describe("less.js browser behaviour", function() {
|
2
|
+
testLessEqualsInDocument();
|
3
|
+
|
4
|
+
it("has some log messages", function() {
|
5
|
+
expect(logMessages.length).toBeGreaterThan(0);
|
6
|
+
});
|
7
|
+
|
8
|
+
for (var i = 0; i < testFiles.length; i++) {
|
9
|
+
var sheet = testSheets[i];
|
10
|
+
testSheet(sheet);
|
11
|
+
}
|
12
|
+
});
|
@@ -0,0 +1,15 @@
|
|
1
|
+
var less = {};
|
2
|
+
less.strictMath = true;
|
3
|
+
less.functions = {
|
4
|
+
add: function(a, b) {
|
5
|
+
return new(less.tree.Dimension)(a.value + b.value);
|
6
|
+
},
|
7
|
+
increment: function(a) {
|
8
|
+
return new(less.tree.Dimension)(a.value + 1);
|
9
|
+
},
|
10
|
+
_color: function(str) {
|
11
|
+
if (str.value === "evil red") {
|
12
|
+
return new(less.tree.Color)("600");
|
13
|
+
}
|
14
|
+
}
|
15
|
+
};
|
@@ -0,0 +1,43 @@
|
|
1
|
+
var alreadyRun = false;
|
2
|
+
|
3
|
+
describe("less.js modify vars", function() {
|
4
|
+
beforeEach(function() {
|
5
|
+
// simulating "setUp" or "beforeAll" method
|
6
|
+
var lessOutputObj;
|
7
|
+
if (alreadyRun)
|
8
|
+
return;
|
9
|
+
|
10
|
+
alreadyRun = true;
|
11
|
+
|
12
|
+
// wait until the sheet is compiled first time
|
13
|
+
waitsFor(function() {
|
14
|
+
lessOutputObj = document.getElementById("less:test-less-simple");
|
15
|
+
return lessOutputObj !== null;
|
16
|
+
}, "first generation of less:test-less-simple", 7000);
|
17
|
+
|
18
|
+
// modify variables
|
19
|
+
runs(function() {
|
20
|
+
lessOutputObj.type = "not compiled yet";
|
21
|
+
less.modifyVars({
|
22
|
+
var1: "green",
|
23
|
+
var2: "purple",
|
24
|
+
scale: 20
|
25
|
+
});
|
26
|
+
});
|
27
|
+
|
28
|
+
// wait until variables are modified
|
29
|
+
waitsFor(function() {
|
30
|
+
lessOutputObj = document.getElementById("less:test-less-simple");
|
31
|
+
return lessOutputObj !== null && lessOutputObj.type === "text/css";
|
32
|
+
}, "second generation of less:test-less-simple", 7000);
|
33
|
+
|
34
|
+
});
|
35
|
+
|
36
|
+
testLessEqualsInDocument();
|
37
|
+
it("Should log only 2 XHR requests", function() {
|
38
|
+
var xhrLogMessages = logMessages.filter(function(item) {
|
39
|
+
return (/XHR: Getting '/).test(item);
|
40
|
+
});
|
41
|
+
expect(xhrLogMessages.length).toEqual(2);
|
42
|
+
});
|
43
|
+
});
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title>Jasmine Spec Runner</title>
|
6
|
+
|
7
|
+
<!-- generate script tags for tests -->
|
8
|
+
<% var generateScriptTags = function(allScripts) { allScripts.forEach(function(script){ %>
|
9
|
+
<script src="<%= script %>"></script>
|
10
|
+
<% }); }; %>
|
11
|
+
|
12
|
+
<!-- for each test, generate CSS/LESS link tags -->
|
13
|
+
<% scripts.src.forEach(function(fullLessName) {
|
14
|
+
var pathParts = fullLessName.split('/');
|
15
|
+
var fullCssName = fullLessName.replace(/less/g, 'css');
|
16
|
+
var lessName = pathParts[pathParts.length - 1];
|
17
|
+
var name = lessName.split('.')[0]; %>
|
18
|
+
<!-- the tags to be generated -->
|
19
|
+
<link id="original-less:test-less-<%= name %>" title="test-less-<%= name %>" rel="stylesheet/less" type="text/css" href="<%= fullLessName %>">
|
20
|
+
<link id="expected-less:test-less-<%= name %>" rel="stylesheet" type="text/css" href="<%= fullCssName %>">
|
21
|
+
<% }); %>
|
22
|
+
|
23
|
+
<!-- generate grunt-contrib-jasmine link tags -->
|
24
|
+
<% css.forEach(function(style){ %>
|
25
|
+
<link rel="stylesheet" type="text/css" href="<%= style %>">
|
26
|
+
<% }) %>
|
27
|
+
|
28
|
+
<!-- inital grunt-contrib-jasmine scripts -->
|
29
|
+
<% generateScriptTags([].concat(scripts.polyfills, scripts.jasmine)); %>
|
30
|
+
|
31
|
+
<!-- Helpers - The less options -->
|
32
|
+
<% generateScriptTags(scripts.helpers); %>
|
33
|
+
|
34
|
+
<!-- Vendor - less.js and common code -->
|
35
|
+
<% generateScriptTags(scripts.vendor); %>
|
36
|
+
|
37
|
+
<!-- Spec -->
|
38
|
+
<% generateScriptTags(scripts.specs); %>
|
39
|
+
|
40
|
+
<!-- final grunt-contrib-jasmine scripts -->
|
41
|
+
<% generateScriptTags([].concat(scripts.reporters, scripts.start)); %>
|
42
|
+
</head>
|
43
|
+
|
44
|
+
<body>
|
45
|
+
<!-- content -->
|
46
|
+
</body>
|
47
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
@charset "UTF-8";
|