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,681 @@
|
|
1
|
+
jasmine.HtmlReporterHelpers = {};
|
2
|
+
|
3
|
+
jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
|
4
|
+
var el = document.createElement(type);
|
5
|
+
|
6
|
+
for (var i = 2; i < arguments.length; i++) {
|
7
|
+
var child = arguments[i];
|
8
|
+
|
9
|
+
if (typeof child === 'string') {
|
10
|
+
el.appendChild(document.createTextNode(child));
|
11
|
+
} else {
|
12
|
+
if (child) {
|
13
|
+
el.appendChild(child);
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
for (var attr in attrs) {
|
19
|
+
if (attr == "className") {
|
20
|
+
el[attr] = attrs[attr];
|
21
|
+
} else {
|
22
|
+
el.setAttribute(attr, attrs[attr]);
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
return el;
|
27
|
+
};
|
28
|
+
|
29
|
+
jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
|
30
|
+
var results = child.results();
|
31
|
+
var status = results.passed() ? 'passed' : 'failed';
|
32
|
+
if (results.skipped) {
|
33
|
+
status = 'skipped';
|
34
|
+
}
|
35
|
+
|
36
|
+
return status;
|
37
|
+
};
|
38
|
+
|
39
|
+
jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
|
40
|
+
var parentDiv = this.dom.summary;
|
41
|
+
var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
|
42
|
+
var parent = child[parentSuite];
|
43
|
+
|
44
|
+
if (parent) {
|
45
|
+
if (typeof this.views.suites[parent.id] == 'undefined') {
|
46
|
+
this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
|
47
|
+
}
|
48
|
+
parentDiv = this.views.suites[parent.id].element;
|
49
|
+
}
|
50
|
+
|
51
|
+
parentDiv.appendChild(childElement);
|
52
|
+
};
|
53
|
+
|
54
|
+
|
55
|
+
jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
|
56
|
+
for(var fn in jasmine.HtmlReporterHelpers) {
|
57
|
+
ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
|
58
|
+
}
|
59
|
+
};
|
60
|
+
|
61
|
+
jasmine.HtmlReporter = function(_doc) {
|
62
|
+
var self = this;
|
63
|
+
var doc = _doc || window.document;
|
64
|
+
|
65
|
+
var reporterView;
|
66
|
+
|
67
|
+
var dom = {};
|
68
|
+
|
69
|
+
// Jasmine Reporter Public Interface
|
70
|
+
self.logRunningSpecs = false;
|
71
|
+
|
72
|
+
self.reportRunnerStarting = function(runner) {
|
73
|
+
var specs = runner.specs() || [];
|
74
|
+
|
75
|
+
if (specs.length == 0) {
|
76
|
+
return;
|
77
|
+
}
|
78
|
+
|
79
|
+
createReporterDom(runner.env.versionString());
|
80
|
+
doc.body.appendChild(dom.reporter);
|
81
|
+
setExceptionHandling();
|
82
|
+
|
83
|
+
reporterView = new jasmine.HtmlReporter.ReporterView(dom);
|
84
|
+
reporterView.addSpecs(specs, self.specFilter);
|
85
|
+
};
|
86
|
+
|
87
|
+
self.reportRunnerResults = function(runner) {
|
88
|
+
reporterView && reporterView.complete();
|
89
|
+
};
|
90
|
+
|
91
|
+
self.reportSuiteResults = function(suite) {
|
92
|
+
reporterView.suiteComplete(suite);
|
93
|
+
};
|
94
|
+
|
95
|
+
self.reportSpecStarting = function(spec) {
|
96
|
+
if (self.logRunningSpecs) {
|
97
|
+
self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
|
98
|
+
}
|
99
|
+
};
|
100
|
+
|
101
|
+
self.reportSpecResults = function(spec) {
|
102
|
+
reporterView.specComplete(spec);
|
103
|
+
};
|
104
|
+
|
105
|
+
self.log = function() {
|
106
|
+
var console = jasmine.getGlobal().console;
|
107
|
+
if (console && console.log) {
|
108
|
+
if (console.log.apply) {
|
109
|
+
console.log.apply(console, arguments);
|
110
|
+
} else {
|
111
|
+
console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
|
112
|
+
}
|
113
|
+
}
|
114
|
+
};
|
115
|
+
|
116
|
+
self.specFilter = function(spec) {
|
117
|
+
if (!focusedSpecName()) {
|
118
|
+
return true;
|
119
|
+
}
|
120
|
+
|
121
|
+
return spec.getFullName().indexOf(focusedSpecName()) === 0;
|
122
|
+
};
|
123
|
+
|
124
|
+
return self;
|
125
|
+
|
126
|
+
function focusedSpecName() {
|
127
|
+
var specName;
|
128
|
+
|
129
|
+
(function memoizeFocusedSpec() {
|
130
|
+
if (specName) {
|
131
|
+
return;
|
132
|
+
}
|
133
|
+
|
134
|
+
var paramMap = [];
|
135
|
+
var params = jasmine.HtmlReporter.parameters(doc);
|
136
|
+
|
137
|
+
for (var i = 0; i < params.length; i++) {
|
138
|
+
var p = params[i].split('=');
|
139
|
+
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
|
140
|
+
}
|
141
|
+
|
142
|
+
specName = paramMap.spec;
|
143
|
+
})();
|
144
|
+
|
145
|
+
return specName;
|
146
|
+
}
|
147
|
+
|
148
|
+
function createReporterDom(version) {
|
149
|
+
dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },
|
150
|
+
dom.banner = self.createDom('div', { className: 'banner' },
|
151
|
+
self.createDom('span', { className: 'title' }, "Jasmine "),
|
152
|
+
self.createDom('span', { className: 'version' }, version)),
|
153
|
+
|
154
|
+
dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),
|
155
|
+
dom.alert = self.createDom('div', {className: 'alert'},
|
156
|
+
self.createDom('span', { className: 'exceptions' },
|
157
|
+
self.createDom('label', { className: 'label', 'for': 'no_try_catch' }, 'No try/catch'),
|
158
|
+
self.createDom('input', { id: 'no_try_catch', type: 'checkbox' }))),
|
159
|
+
dom.results = self.createDom('div', {className: 'results'},
|
160
|
+
dom.summary = self.createDom('div', { className: 'summary' }),
|
161
|
+
dom.details = self.createDom('div', { id: 'details' }))
|
162
|
+
);
|
163
|
+
}
|
164
|
+
|
165
|
+
function noTryCatch() {
|
166
|
+
return window.location.search.match(/catch=false/);
|
167
|
+
}
|
168
|
+
|
169
|
+
function searchWithCatch() {
|
170
|
+
var params = jasmine.HtmlReporter.parameters(window.document);
|
171
|
+
var removed = false;
|
172
|
+
var i = 0;
|
173
|
+
|
174
|
+
while (!removed && i < params.length) {
|
175
|
+
if (params[i].match(/catch=/)) {
|
176
|
+
params.splice(i, 1);
|
177
|
+
removed = true;
|
178
|
+
}
|
179
|
+
i++;
|
180
|
+
}
|
181
|
+
if (jasmine.CATCH_EXCEPTIONS) {
|
182
|
+
params.push("catch=false");
|
183
|
+
}
|
184
|
+
|
185
|
+
return params.join("&");
|
186
|
+
}
|
187
|
+
|
188
|
+
function setExceptionHandling() {
|
189
|
+
var chxCatch = document.getElementById('no_try_catch');
|
190
|
+
|
191
|
+
if (noTryCatch()) {
|
192
|
+
chxCatch.setAttribute('checked', true);
|
193
|
+
jasmine.CATCH_EXCEPTIONS = false;
|
194
|
+
}
|
195
|
+
chxCatch.onclick = function() {
|
196
|
+
window.location.search = searchWithCatch();
|
197
|
+
};
|
198
|
+
}
|
199
|
+
};
|
200
|
+
jasmine.HtmlReporter.parameters = function(doc) {
|
201
|
+
var paramStr = doc.location.search.substring(1);
|
202
|
+
var params = [];
|
203
|
+
|
204
|
+
if (paramStr.length > 0) {
|
205
|
+
params = paramStr.split('&');
|
206
|
+
}
|
207
|
+
return params;
|
208
|
+
}
|
209
|
+
jasmine.HtmlReporter.sectionLink = function(sectionName) {
|
210
|
+
var link = '?';
|
211
|
+
var params = [];
|
212
|
+
|
213
|
+
if (sectionName) {
|
214
|
+
params.push('spec=' + encodeURIComponent(sectionName));
|
215
|
+
}
|
216
|
+
if (!jasmine.CATCH_EXCEPTIONS) {
|
217
|
+
params.push("catch=false");
|
218
|
+
}
|
219
|
+
if (params.length > 0) {
|
220
|
+
link += params.join("&");
|
221
|
+
}
|
222
|
+
|
223
|
+
return link;
|
224
|
+
};
|
225
|
+
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);
|
226
|
+
jasmine.HtmlReporter.ReporterView = function(dom) {
|
227
|
+
this.startedAt = new Date();
|
228
|
+
this.runningSpecCount = 0;
|
229
|
+
this.completeSpecCount = 0;
|
230
|
+
this.passedCount = 0;
|
231
|
+
this.failedCount = 0;
|
232
|
+
this.skippedCount = 0;
|
233
|
+
|
234
|
+
this.createResultsMenu = function() {
|
235
|
+
this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},
|
236
|
+
this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'),
|
237
|
+
' | ',
|
238
|
+
this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing'));
|
239
|
+
|
240
|
+
this.summaryMenuItem.onclick = function() {
|
241
|
+
dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');
|
242
|
+
};
|
243
|
+
|
244
|
+
this.detailsMenuItem.onclick = function() {
|
245
|
+
showDetails();
|
246
|
+
};
|
247
|
+
};
|
248
|
+
|
249
|
+
this.addSpecs = function(specs, specFilter) {
|
250
|
+
this.totalSpecCount = specs.length;
|
251
|
+
|
252
|
+
this.views = {
|
253
|
+
specs: {},
|
254
|
+
suites: {}
|
255
|
+
};
|
256
|
+
|
257
|
+
for (var i = 0; i < specs.length; i++) {
|
258
|
+
var spec = specs[i];
|
259
|
+
this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);
|
260
|
+
if (specFilter(spec)) {
|
261
|
+
this.runningSpecCount++;
|
262
|
+
}
|
263
|
+
}
|
264
|
+
};
|
265
|
+
|
266
|
+
this.specComplete = function(spec) {
|
267
|
+
this.completeSpecCount++;
|
268
|
+
|
269
|
+
if (isUndefined(this.views.specs[spec.id])) {
|
270
|
+
this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);
|
271
|
+
}
|
272
|
+
|
273
|
+
var specView = this.views.specs[spec.id];
|
274
|
+
|
275
|
+
switch (specView.status()) {
|
276
|
+
case 'passed':
|
277
|
+
this.passedCount++;
|
278
|
+
break;
|
279
|
+
|
280
|
+
case 'failed':
|
281
|
+
this.failedCount++;
|
282
|
+
break;
|
283
|
+
|
284
|
+
case 'skipped':
|
285
|
+
this.skippedCount++;
|
286
|
+
break;
|
287
|
+
}
|
288
|
+
|
289
|
+
specView.refresh();
|
290
|
+
this.refresh();
|
291
|
+
};
|
292
|
+
|
293
|
+
this.suiteComplete = function(suite) {
|
294
|
+
var suiteView = this.views.suites[suite.id];
|
295
|
+
if (isUndefined(suiteView)) {
|
296
|
+
return;
|
297
|
+
}
|
298
|
+
suiteView.refresh();
|
299
|
+
};
|
300
|
+
|
301
|
+
this.refresh = function() {
|
302
|
+
|
303
|
+
if (isUndefined(this.resultsMenu)) {
|
304
|
+
this.createResultsMenu();
|
305
|
+
}
|
306
|
+
|
307
|
+
// currently running UI
|
308
|
+
if (isUndefined(this.runningAlert)) {
|
309
|
+
this.runningAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: "runningAlert bar" });
|
310
|
+
dom.alert.appendChild(this.runningAlert);
|
311
|
+
}
|
312
|
+
this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount);
|
313
|
+
|
314
|
+
// skipped specs UI
|
315
|
+
if (isUndefined(this.skippedAlert)) {
|
316
|
+
this.skippedAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: "skippedAlert bar" });
|
317
|
+
}
|
318
|
+
|
319
|
+
this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
|
320
|
+
|
321
|
+
if (this.skippedCount === 1 && isDefined(dom.alert)) {
|
322
|
+
dom.alert.appendChild(this.skippedAlert);
|
323
|
+
}
|
324
|
+
|
325
|
+
// passing specs UI
|
326
|
+
if (isUndefined(this.passedAlert)) {
|
327
|
+
this.passedAlert = this.createDom('span', { href: jasmine.HtmlReporter.sectionLink(), className: "passingAlert bar" });
|
328
|
+
}
|
329
|
+
this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount);
|
330
|
+
|
331
|
+
// failing specs UI
|
332
|
+
if (isUndefined(this.failedAlert)) {
|
333
|
+
this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"});
|
334
|
+
}
|
335
|
+
this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount);
|
336
|
+
|
337
|
+
if (this.failedCount === 1 && isDefined(dom.alert)) {
|
338
|
+
dom.alert.appendChild(this.failedAlert);
|
339
|
+
dom.alert.appendChild(this.resultsMenu);
|
340
|
+
}
|
341
|
+
|
342
|
+
// summary info
|
343
|
+
this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount);
|
344
|
+
this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing";
|
345
|
+
};
|
346
|
+
|
347
|
+
this.complete = function() {
|
348
|
+
dom.alert.removeChild(this.runningAlert);
|
349
|
+
|
350
|
+
this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
|
351
|
+
|
352
|
+
if (this.failedCount === 0) {
|
353
|
+
dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount)));
|
354
|
+
} else {
|
355
|
+
showDetails();
|
356
|
+
}
|
357
|
+
|
358
|
+
dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"));
|
359
|
+
};
|
360
|
+
|
361
|
+
return this;
|
362
|
+
|
363
|
+
function showDetails() {
|
364
|
+
if (dom.reporter.className.search(/showDetails/) === -1) {
|
365
|
+
dom.reporter.className += " showDetails";
|
366
|
+
}
|
367
|
+
}
|
368
|
+
|
369
|
+
function isUndefined(obj) {
|
370
|
+
return typeof obj === 'undefined';
|
371
|
+
}
|
372
|
+
|
373
|
+
function isDefined(obj) {
|
374
|
+
return !isUndefined(obj);
|
375
|
+
}
|
376
|
+
|
377
|
+
function specPluralizedFor(count) {
|
378
|
+
var str = count + " spec";
|
379
|
+
if (count > 1) {
|
380
|
+
str += "s"
|
381
|
+
}
|
382
|
+
return str;
|
383
|
+
}
|
384
|
+
|
385
|
+
};
|
386
|
+
|
387
|
+
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView);
|
388
|
+
|
389
|
+
|
390
|
+
jasmine.HtmlReporter.SpecView = function(spec, dom, views) {
|
391
|
+
this.spec = spec;
|
392
|
+
this.dom = dom;
|
393
|
+
this.views = views;
|
394
|
+
|
395
|
+
this.symbol = this.createDom('li', { className: 'pending' });
|
396
|
+
this.dom.symbolSummary.appendChild(this.symbol);
|
397
|
+
|
398
|
+
this.summary = this.createDom('div', { className: 'specSummary' },
|
399
|
+
this.createDom('a', {
|
400
|
+
className: 'description',
|
401
|
+
href: jasmine.HtmlReporter.sectionLink(this.spec.getFullName()),
|
402
|
+
title: this.spec.getFullName()
|
403
|
+
}, this.spec.description)
|
404
|
+
);
|
405
|
+
|
406
|
+
this.detail = this.createDom('div', { className: 'specDetail' },
|
407
|
+
this.createDom('a', {
|
408
|
+
className: 'description',
|
409
|
+
href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
|
410
|
+
title: this.spec.getFullName()
|
411
|
+
}, this.spec.getFullName())
|
412
|
+
);
|
413
|
+
};
|
414
|
+
|
415
|
+
jasmine.HtmlReporter.SpecView.prototype.status = function() {
|
416
|
+
return this.getSpecStatus(this.spec);
|
417
|
+
};
|
418
|
+
|
419
|
+
jasmine.HtmlReporter.SpecView.prototype.refresh = function() {
|
420
|
+
this.symbol.className = this.status();
|
421
|
+
|
422
|
+
switch (this.status()) {
|
423
|
+
case 'skipped':
|
424
|
+
break;
|
425
|
+
|
426
|
+
case 'passed':
|
427
|
+
this.appendSummaryToSuiteDiv();
|
428
|
+
break;
|
429
|
+
|
430
|
+
case 'failed':
|
431
|
+
this.appendSummaryToSuiteDiv();
|
432
|
+
this.appendFailureDetail();
|
433
|
+
break;
|
434
|
+
}
|
435
|
+
};
|
436
|
+
|
437
|
+
jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
|
438
|
+
this.summary.className += ' ' + this.status();
|
439
|
+
this.appendToSummary(this.spec, this.summary);
|
440
|
+
};
|
441
|
+
|
442
|
+
jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {
|
443
|
+
this.detail.className += ' ' + this.status();
|
444
|
+
|
445
|
+
var resultItems = this.spec.results().getItems();
|
446
|
+
var messagesDiv = this.createDom('div', { className: 'messages' });
|
447
|
+
|
448
|
+
for (var i = 0; i < resultItems.length; i++) {
|
449
|
+
var result = resultItems[i];
|
450
|
+
|
451
|
+
if (result.type == 'log') {
|
452
|
+
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
|
453
|
+
} else if (result.type == 'expect' && result.passed && !result.passed()) {
|
454
|
+
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
|
455
|
+
|
456
|
+
if (result.trace.stack) {
|
457
|
+
messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
|
458
|
+
}
|
459
|
+
}
|
460
|
+
}
|
461
|
+
|
462
|
+
if (messagesDiv.childNodes.length > 0) {
|
463
|
+
this.detail.appendChild(messagesDiv);
|
464
|
+
this.dom.details.appendChild(this.detail);
|
465
|
+
}
|
466
|
+
};
|
467
|
+
|
468
|
+
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);jasmine.HtmlReporter.SuiteView = function(suite, dom, views) {
|
469
|
+
this.suite = suite;
|
470
|
+
this.dom = dom;
|
471
|
+
this.views = views;
|
472
|
+
|
473
|
+
this.element = this.createDom('div', { className: 'suite' },
|
474
|
+
this.createDom('a', { className: 'description', href: jasmine.HtmlReporter.sectionLink(this.suite.getFullName()) }, this.suite.description)
|
475
|
+
);
|
476
|
+
|
477
|
+
this.appendToSummary(this.suite, this.element);
|
478
|
+
};
|
479
|
+
|
480
|
+
jasmine.HtmlReporter.SuiteView.prototype.status = function() {
|
481
|
+
return this.getSpecStatus(this.suite);
|
482
|
+
};
|
483
|
+
|
484
|
+
jasmine.HtmlReporter.SuiteView.prototype.refresh = function() {
|
485
|
+
this.element.className += " " + this.status();
|
486
|
+
};
|
487
|
+
|
488
|
+
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);
|
489
|
+
|
490
|
+
/* @deprecated Use jasmine.HtmlReporter instead
|
491
|
+
*/
|
492
|
+
jasmine.TrivialReporter = function(doc) {
|
493
|
+
this.document = doc || document;
|
494
|
+
this.suiteDivs = {};
|
495
|
+
this.logRunningSpecs = false;
|
496
|
+
};
|
497
|
+
|
498
|
+
jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
|
499
|
+
var el = document.createElement(type);
|
500
|
+
|
501
|
+
for (var i = 2; i < arguments.length; i++) {
|
502
|
+
var child = arguments[i];
|
503
|
+
|
504
|
+
if (typeof child === 'string') {
|
505
|
+
el.appendChild(document.createTextNode(child));
|
506
|
+
} else {
|
507
|
+
if (child) { el.appendChild(child); }
|
508
|
+
}
|
509
|
+
}
|
510
|
+
|
511
|
+
for (var attr in attrs) {
|
512
|
+
if (attr == "className") {
|
513
|
+
el[attr] = attrs[attr];
|
514
|
+
} else {
|
515
|
+
el.setAttribute(attr, attrs[attr]);
|
516
|
+
}
|
517
|
+
}
|
518
|
+
|
519
|
+
return el;
|
520
|
+
};
|
521
|
+
|
522
|
+
jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
|
523
|
+
var showPassed, showSkipped;
|
524
|
+
|
525
|
+
this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' },
|
526
|
+
this.createDom('div', { className: 'banner' },
|
527
|
+
this.createDom('div', { className: 'logo' },
|
528
|
+
this.createDom('span', { className: 'title' }, "Jasmine"),
|
529
|
+
this.createDom('span', { className: 'version' }, runner.env.versionString())),
|
530
|
+
this.createDom('div', { className: 'options' },
|
531
|
+
"Show ",
|
532
|
+
showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
|
533
|
+
this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
|
534
|
+
showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
|
535
|
+
this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
|
536
|
+
)
|
537
|
+
),
|
538
|
+
|
539
|
+
this.runnerDiv = this.createDom('div', { className: 'runner running' },
|
540
|
+
this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
|
541
|
+
this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
|
542
|
+
this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
|
543
|
+
);
|
544
|
+
|
545
|
+
this.document.body.appendChild(this.outerDiv);
|
546
|
+
|
547
|
+
var suites = runner.suites();
|
548
|
+
for (var i = 0; i < suites.length; i++) {
|
549
|
+
var suite = suites[i];
|
550
|
+
var suiteDiv = this.createDom('div', { className: 'suite' },
|
551
|
+
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
|
552
|
+
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
|
553
|
+
this.suiteDivs[suite.id] = suiteDiv;
|
554
|
+
var parentDiv = this.outerDiv;
|
555
|
+
if (suite.parentSuite) {
|
556
|
+
parentDiv = this.suiteDivs[suite.parentSuite.id];
|
557
|
+
}
|
558
|
+
parentDiv.appendChild(suiteDiv);
|
559
|
+
}
|
560
|
+
|
561
|
+
this.startedAt = new Date();
|
562
|
+
|
563
|
+
var self = this;
|
564
|
+
showPassed.onclick = function(evt) {
|
565
|
+
if (showPassed.checked) {
|
566
|
+
self.outerDiv.className += ' show-passed';
|
567
|
+
} else {
|
568
|
+
self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
|
569
|
+
}
|
570
|
+
};
|
571
|
+
|
572
|
+
showSkipped.onclick = function(evt) {
|
573
|
+
if (showSkipped.checked) {
|
574
|
+
self.outerDiv.className += ' show-skipped';
|
575
|
+
} else {
|
576
|
+
self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
|
577
|
+
}
|
578
|
+
};
|
579
|
+
};
|
580
|
+
|
581
|
+
jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
|
582
|
+
var results = runner.results();
|
583
|
+
var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
|
584
|
+
this.runnerDiv.setAttribute("class", className);
|
585
|
+
//do it twice for IE
|
586
|
+
this.runnerDiv.setAttribute("className", className);
|
587
|
+
var specs = runner.specs();
|
588
|
+
var specCount = 0;
|
589
|
+
for (var i = 0; i < specs.length; i++) {
|
590
|
+
if (this.specFilter(specs[i])) {
|
591
|
+
specCount++;
|
592
|
+
}
|
593
|
+
}
|
594
|
+
var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
|
595
|
+
message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
|
596
|
+
this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
|
597
|
+
|
598
|
+
this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
|
599
|
+
};
|
600
|
+
|
601
|
+
jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
|
602
|
+
var results = suite.results();
|
603
|
+
var status = results.passed() ? 'passed' : 'failed';
|
604
|
+
if (results.totalCount === 0) { // todo: change this to check results.skipped
|
605
|
+
status = 'skipped';
|
606
|
+
}
|
607
|
+
this.suiteDivs[suite.id].className += " " + status;
|
608
|
+
};
|
609
|
+
|
610
|
+
jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
|
611
|
+
if (this.logRunningSpecs) {
|
612
|
+
this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
|
613
|
+
}
|
614
|
+
};
|
615
|
+
|
616
|
+
jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
|
617
|
+
var results = spec.results();
|
618
|
+
var status = results.passed() ? 'passed' : 'failed';
|
619
|
+
if (results.skipped) {
|
620
|
+
status = 'skipped';
|
621
|
+
}
|
622
|
+
var specDiv = this.createDom('div', { className: 'spec ' + status },
|
623
|
+
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
|
624
|
+
this.createDom('a', {
|
625
|
+
className: 'description',
|
626
|
+
href: '?spec=' + encodeURIComponent(spec.getFullName()),
|
627
|
+
title: spec.getFullName()
|
628
|
+
}, spec.description));
|
629
|
+
|
630
|
+
|
631
|
+
var resultItems = results.getItems();
|
632
|
+
var messagesDiv = this.createDom('div', { className: 'messages' });
|
633
|
+
for (var i = 0; i < resultItems.length; i++) {
|
634
|
+
var result = resultItems[i];
|
635
|
+
|
636
|
+
if (result.type == 'log') {
|
637
|
+
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
|
638
|
+
} else if (result.type == 'expect' && result.passed && !result.passed()) {
|
639
|
+
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
|
640
|
+
|
641
|
+
if (result.trace.stack) {
|
642
|
+
messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
|
643
|
+
}
|
644
|
+
}
|
645
|
+
}
|
646
|
+
|
647
|
+
if (messagesDiv.childNodes.length > 0) {
|
648
|
+
specDiv.appendChild(messagesDiv);
|
649
|
+
}
|
650
|
+
|
651
|
+
this.suiteDivs[spec.suite.id].appendChild(specDiv);
|
652
|
+
};
|
653
|
+
|
654
|
+
jasmine.TrivialReporter.prototype.log = function() {
|
655
|
+
var console = jasmine.getGlobal().console;
|
656
|
+
if (console && console.log) {
|
657
|
+
if (console.log.apply) {
|
658
|
+
console.log.apply(console, arguments);
|
659
|
+
} else {
|
660
|
+
console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
|
661
|
+
}
|
662
|
+
}
|
663
|
+
};
|
664
|
+
|
665
|
+
jasmine.TrivialReporter.prototype.getLocation = function() {
|
666
|
+
return this.document.location;
|
667
|
+
};
|
668
|
+
|
669
|
+
jasmine.TrivialReporter.prototype.specFilter = function(spec) {
|
670
|
+
var paramMap = {};
|
671
|
+
var params = this.getLocation().search.substring(1).split('&');
|
672
|
+
for (var i = 0; i < params.length; i++) {
|
673
|
+
var p = params[i].split('=');
|
674
|
+
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
|
675
|
+
}
|
676
|
+
|
677
|
+
if (!paramMap.spec) {
|
678
|
+
return true;
|
679
|
+
}
|
680
|
+
return spec.getFullName().indexOf(paramMap.spec) === 0;
|
681
|
+
};
|