stylus-source 0.23.0 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +5 -5
- data/VERSION +1 -1
- data/vendor/lib/functions/index.js +11 -12
- data/vendor/lib/functions/index.styl +45 -0
- data/vendor/lib/parser.js +13 -0
- data/vendor/lib/stylus.js +1 -1
- data/vendor/lib/visitor/evaluator.js +8 -0
- data/vendor/node_modules/cssom/Jakefile.js +35 -0
- data/vendor/node_modules/cssom/lib/CSSImportRule.js +10 -9
- data/vendor/node_modules/cssom/lib/CSSKeyframeRule.js +2 -0
- data/vendor/node_modules/cssom/lib/CSSKeyframesRule.js +2 -1
- data/vendor/node_modules/cssom/lib/CSSMediaRule.js +2 -1
- data/vendor/node_modules/cssom/lib/CSSRule.js +1 -0
- data/vendor/node_modules/cssom/lib/CSSStyleDeclaration.js +7 -5
- data/vendor/node_modules/cssom/lib/CSSStyleRule.js +11 -9
- data/vendor/node_modules/cssom/lib/CSSStyleSheet.js +4 -4
- data/vendor/node_modules/cssom/lib/MediaList.js +3 -3
- data/vendor/node_modules/cssom/lib/StyleSheet.js +3 -1
- data/vendor/node_modules/cssom/lib/clone.js +5 -5
- data/vendor/node_modules/cssom/lib/index.js +14 -12
- data/vendor/node_modules/cssom/lib/parse.js +48 -43
- data/vendor/node_modules/cssom/package.json +5 -4
- data/vendor/node_modules/debug/History.md +35 -0
- data/vendor/node_modules/debug/Makefile +5 -0
- data/vendor/node_modules/debug/Readme.md +128 -0
- data/vendor/node_modules/debug/debug.js +111 -0
- data/vendor/node_modules/debug/example/app.js +19 -0
- data/vendor/node_modules/debug/example/browser.html +24 -0
- data/vendor/node_modules/debug/example/wildcards.js +10 -0
- data/vendor/node_modules/debug/example/worker.js +22 -0
- data/vendor/node_modules/debug/index.js +2 -0
- data/vendor/node_modules/debug/lib/debug.js +129 -0
- data/vendor/node_modules/debug/package.json +11 -0
- data/vendor/node_modules/growl/History.md +21 -0
- data/vendor/node_modules/growl/Readme.md +29 -20
- data/vendor/node_modules/growl/lib/growl.js +113 -36
- data/vendor/node_modules/growl/package.json +1 -1
- data/vendor/node_modules/growl/test.js +12 -13
- data/vendor/node_modules/mkdirp/README.markdown +35 -2
- data/vendor/node_modules/mkdirp/examples/pow.js +1 -1
- data/vendor/node_modules/mkdirp/index.js +72 -13
- data/vendor/node_modules/mkdirp/package.json +2 -2
- data/vendor/node_modules/mkdirp/test/chmod.js +38 -0
- data/vendor/node_modules/mkdirp/test/clobber.js +37 -0
- data/vendor/node_modules/mkdirp/test/perm.js +32 -0
- data/vendor/node_modules/mkdirp/test/perm_sync.js +39 -0
- data/vendor/node_modules/mkdirp/test/sync.js +27 -0
- data/vendor/node_modules/mkdirp/test/umask.js +28 -0
- data/vendor/node_modules/mkdirp/test/umask_sync.js +27 -0
- data/vendor/package.json +6 -5
- data/vendor/testing/test.css +39 -0
- data/vendor/testing/test.html +21 -0
- data/vendor/testing/test.js +5 -3
- data/vendor/testing/test.styl +42 -2
- metadata +23 -542
- data/vendor/History.md +0 -672
- data/vendor/Makefile +0 -20
- data/vendor/Readme.md +0 -155
- data/vendor/docs/bifs.md +0 -598
- data/vendor/docs/comments.md +0 -35
- data/vendor/docs/compare.md +0 -81
- data/vendor/docs/conditionals.md +0 -107
- data/vendor/docs/css-style.md +0 -77
- data/vendor/docs/error-reporting.md +0 -50
- data/vendor/docs/escape.md +0 -28
- data/vendor/docs/executable.md +0 -163
- data/vendor/docs/extend.md +0 -123
- data/vendor/docs/firebug.md +0 -59
- data/vendor/docs/font-face.md +0 -26
- data/vendor/docs/functions.md +0 -197
- data/vendor/docs/functions.url.md +0 -32
- data/vendor/docs/gedit.md +0 -24
- data/vendor/docs/import.md +0 -75
- data/vendor/docs/interpolation.md +0 -55
- data/vendor/docs/introspection.md +0 -38
- data/vendor/docs/iteration.md +0 -102
- data/vendor/docs/js.md +0 -157
- data/vendor/docs/keyframes.md +0 -122
- data/vendor/docs/kwargs.md +0 -34
- data/vendor/docs/literal.md +0 -16
- data/vendor/docs/media.md +0 -18
- data/vendor/docs/middleware.md +0 -72
- data/vendor/docs/mixins.md +0 -138
- data/vendor/docs/operators.md +0 -470
- data/vendor/docs/selectors.md +0 -133
- data/vendor/docs/textmate.md +0 -4
- data/vendor/docs/vargs.md +0 -84
- data/vendor/docs/variables.md +0 -85
- data/vendor/editors/Stylus.tmbundle/Commands/Compile and Display CSS.tmCommand +0 -33
- data/vendor/editors/Stylus.tmbundle/Preferences/Comments.tmPreferences +0 -36
- data/vendor/editors/Stylus.tmbundle/Syntaxes/Stylus.tmLanguage +0 -228
- data/vendor/editors/Stylus.tmbundle/info.plist +0 -10
- data/vendor/editors/gedit/styl.lang +0 -475
- data/vendor/examples/arithmetic.js +0 -12
- data/vendor/examples/arithmetic.styl +0 -29
- data/vendor/examples/basic.js +0 -12
- data/vendor/examples/basic.styl +0 -8
- data/vendor/examples/builtins.js +0 -12
- data/vendor/examples/builtins.styl +0 -56
- data/vendor/examples/comments.js +0 -11
- data/vendor/examples/comments.styl +0 -15
- data/vendor/examples/compress.js +0 -12
- data/vendor/examples/conversions.js +0 -12
- data/vendor/examples/conversions.styl +0 -34
- data/vendor/examples/functions.js +0 -12
- data/vendor/examples/functions.styl +0 -30
- data/vendor/examples/gradients.js +0 -13
- data/vendor/examples/gradients.styl +0 -8
- data/vendor/examples/images/gopher.jpg +0 -0
- data/vendor/examples/images/gradient.svg +0 -9
- data/vendor/examples/images/jesus.gif +0 -0
- data/vendor/examples/images/sprite.gif +0 -0
- data/vendor/examples/images.js +0 -20
- data/vendor/examples/images.styl +0 -15
- data/vendor/examples/implicit-functions.js +0 -12
- data/vendor/examples/implicit-functions.styl +0 -23
- data/vendor/examples/import.js +0 -12
- data/vendor/examples/import.styl +0 -11
- data/vendor/examples/js-functions.js +0 -55
- data/vendor/examples/js-functions.styl +0 -23
- data/vendor/examples/literal.js +0 -12
- data/vendor/examples/literal.styl +0 -8
- data/vendor/examples/middleware.js +0 -23
- data/vendor/examples/mixins/box.styl +0 -14
- data/vendor/examples/mixins/gradients.styl +0 -92
- data/vendor/examples/nesting.js +0 -12
- data/vendor/examples/nesting.styl +0 -14
- data/vendor/examples/variables.js +0 -12
- data/vendor/examples/variables.styl +0 -24
- data/vendor/node_modules/cssom/Jakefile +0 -37
- data/vendor/node_modules/cssom/MIT-LICENSE.txt +0 -20
- data/vendor/node_modules/cssom/README.mdown +0 -34
- data/vendor/node_modules/cssom/Rakefile +0 -23
- data/vendor/node_modules/cssom/animation.html +0 -27
- data/vendor/node_modules/cssom/bench.html +0 -47
- data/vendor/node_modules/cssom/comments.js +0 -63
- data/vendor/node_modules/cssom/docs/bar.css +0 -3
- data/vendor/node_modules/cssom/docs/col_table.html +0 -15
- data/vendor/node_modules/cssom/docs/cols.html +0 -14
- data/vendor/node_modules/cssom/docs/cols_inline-blocks.html +0 -33
- data/vendor/node_modules/cssom/docs/demo.css +0 -0
- data/vendor/node_modules/cssom/docs/diff.html +0 -132
- data/vendor/node_modules/cssom/docs/foo.css +0 -4
- data/vendor/node_modules/cssom/docs/parse.html +0 -282
- data/vendor/node_modules/cssom/docs/parse.html_ +0 -268
- data/vendor/node_modules/cssom/docs/parse2.html +0 -518
- data/vendor/node_modules/cssom/docs/parser.html +0 -31
- data/vendor/node_modules/cssom/index.html +0 -100
- data/vendor/node_modules/cssom/lib/CSSOM.js +0 -3
- data/vendor/node_modules/cssom/lib/Parser.js +0 -362
- data/vendor/node_modules/cssom/media.html +0 -17
- data/vendor/node_modules/cssom/plugins/toHTML.js +0 -32
- data/vendor/node_modules/cssom/server/index.html +0 -22
- data/vendor/node_modules/cssom/server/index.js +0 -21
- data/vendor/node_modules/cssom/shorthands.html +0 -21
- data/vendor/node_modules/cssom/strings.html +0 -10
- data/vendor/node_modules/cssom/test/CSSImportRule.test.js +0 -52
- data/vendor/node_modules/cssom/test/CSSStyleDeclaration.test.js +0 -42
- data/vendor/node_modules/cssom/test/CSSStyleRule.test.js +0 -12
- data/vendor/node_modules/cssom/test/CSSStyleSheet.test.js +0 -16
- data/vendor/node_modules/cssom/test/MediaList.test.js +0 -21
- data/vendor/node_modules/cssom/test/_helper.js +0 -122
- data/vendor/node_modules/cssom/test/clone.test.js +0 -38
- data/vendor/node_modules/cssom/test/fixtures/dummy.css +0 -3
- data/vendor/node_modules/cssom/test/helper.js +0 -122
- data/vendor/node_modules/cssom/test/index.html +0 -45
- data/vendor/node_modules/cssom/test/parse.test.js +0 -718
- data/vendor/node_modules/cssom/test/vendor/qunit.css +0 -189
- data/vendor/node_modules/cssom/test/vendor/qunit.js +0 -1415
- data/vendor/test/cases/arithmetic.color.css +0 -44
- data/vendor/test/cases/arithmetic.color.styl +0 -48
- data/vendor/test/cases/arithmetic.css +0 -23
- data/vendor/test/cases/arithmetic.styl +0 -30
- data/vendor/test/cases/arithmetic.unary.css +0 -16
- data/vendor/test/cases/arithmetic.unary.styl +0 -16
- data/vendor/test/cases/atscope.css +0 -21
- data/vendor/test/cases/atscope.styl +0 -23
- data/vendor/test/cases/bifs.add-property.css +0 -21
- data/vendor/test/cases/bifs.add-property.styl +0 -48
- data/vendor/test/cases/bifs.components.css +0 -9
- data/vendor/test/cases/bifs.components.styl +0 -9
- data/vendor/test/cases/bifs.dark.css +0 -5
- data/vendor/test/cases/bifs.dark.styl +0 -4
- data/vendor/test/cases/bifs.darken.css +0 -8
- data/vendor/test/cases/bifs.darken.styl +0 -9
- data/vendor/test/cases/bifs.fade.css +0 -6
- data/vendor/test/cases/bifs.fade.styl +0 -6
- data/vendor/test/cases/bifs.image-size.css +0 -9
- data/vendor/test/cases/bifs.image-size.styl +0 -16
- data/vendor/test/cases/bifs.join.css +0 -18
- data/vendor/test/cases/bifs.join.styl +0 -21
- data/vendor/test/cases/bifs.keys.css +0 -4
- data/vendor/test/cases/bifs.keys.styl +0 -6
- data/vendor/test/cases/bifs.last.css +0 -5
- data/vendor/test/cases/bifs.last.styl +0 -6
- data/vendor/test/cases/bifs.length.css +0 -10
- data/vendor/test/cases/bifs.length.styl +0 -18
- data/vendor/test/cases/bifs.light.css +0 -5
- data/vendor/test/cases/bifs.light.styl +0 -4
- data/vendor/test/cases/bifs.lighten.css +0 -14
- data/vendor/test/cases/bifs.lighten.styl +0 -14
- data/vendor/test/cases/bifs.lookup.css +0 -3
- data/vendor/test/cases/bifs.lookup.styl +0 -8
- data/vendor/test/cases/bifs.match.css +0 -4
- data/vendor/test/cases/bifs.match.styl +0 -9
- data/vendor/test/cases/bifs.opposite-position.css +0 -8
- data/vendor/test/cases/bifs.opposite-position.styl +0 -9
- data/vendor/test/cases/bifs.push.css +0 -25
- data/vendor/test/cases/bifs.push.styl +0 -48
- data/vendor/test/cases/bifs.rgba.css +0 -5
- data/vendor/test/cases/bifs.rgba.styl +0 -4
- data/vendor/test/cases/bifs.s.css +0 -11
- data/vendor/test/cases/bifs.s.styl +0 -12
- data/vendor/test/cases/bifs.type.css +0 -11
- data/vendor/test/cases/bifs.type.styl +0 -12
- data/vendor/test/cases/bifs.unit.css +0 -6
- data/vendor/test/cases/bifs.unit.styl +0 -5
- data/vendor/test/cases/bifs.unquote.css +0 -5
- data/vendor/test/cases/bifs.unquote.styl +0 -8
- data/vendor/test/cases/bifs.url.css +0 -11
- data/vendor/test/cases/bifs.url.styl +0 -15
- data/vendor/test/cases/bifs.values.css +0 -5
- data/vendor/test/cases/bifs.values.styl +0 -6
- data/vendor/test/cases/casting.css +0 -12
- data/vendor/test/cases/casting.styl +0 -14
- data/vendor/test/cases/coercion.css +0 -6
- data/vendor/test/cases/coercion.styl +0 -5
- data/vendor/test/cases/comments.css +0 -18
- data/vendor/test/cases/comments.styl +0 -28
- data/vendor/test/cases/compress.comments.css +0 -2
- data/vendor/test/cases/compress.comments.styl +0 -5
- data/vendor/test/cases/compress.units.css +0 -2
- data/vendor/test/cases/compress.units.styl +0 -18
- data/vendor/test/cases/conditional-assignment.css +0 -4
- data/vendor/test/cases/conditional-assignment.styl +0 -9
- data/vendor/test/cases/control.blueprint.ie.css +0 -126
- data/vendor/test/cases/control.blueprint.ie.styl +0 -36
- data/vendor/test/cases/control.blueprint.screen.css +0 -1103
- data/vendor/test/cases/control.blueprint.screen.styl +0 -265
- data/vendor/test/cases/control.boilerplate.css +0 -473
- data/vendor/test/cases/control.boilerplate.styl +0 -265
- data/vendor/test/cases/css.extend.css +0 -13
- data/vendor/test/cases/css.extend.styl +0 -15
- data/vendor/test/cases/css.functions.single-line.css +0 -9
- data/vendor/test/cases/css.functions.single-line.styl +0 -13
- data/vendor/test/cases/css.if.css +0 -8
- data/vendor/test/cases/css.if.styl +0 -21
- data/vendor/test/cases/css.keyframes.css +0 -57
- data/vendor/test/cases/css.keyframes.styl +0 -48
- data/vendor/test/cases/css.large.css +0 -172
- data/vendor/test/cases/css.large.styl +0 -172
- data/vendor/test/cases/css.media.css +0 -15
- data/vendor/test/cases/css.media.styl +0 -17
- data/vendor/test/cases/css.mixins.braces.css +0 -38
- data/vendor/test/cases/css.mixins.braces.styl +0 -53
- data/vendor/test/cases/css.mixins.css +0 -38
- data/vendor/test/cases/css.mixins.root.css +0 -26
- data/vendor/test/cases/css.mixins.root.styl +0 -25
- data/vendor/test/cases/css.mixins.root.wonky.css +0 -26
- data/vendor/test/cases/css.mixins.root.wonky.styl +0 -17
- data/vendor/test/cases/css.mixins.styl +0 -47
- data/vendor/test/cases/css.selector.interpolation.css +0 -91
- data/vendor/test/cases/css.selector.interpolation.styl +0 -90
- data/vendor/test/cases/css.selectors.css +0 -38
- data/vendor/test/cases/css.selectors.styl +0 -53
- data/vendor/test/cases/css.whitespace.css +0 -37
- data/vendor/test/cases/css.whitespace.styl +0 -38
- data/vendor/test/cases/dumb.css +0 -10
- data/vendor/test/cases/dumb.styl +0 -11
- data/vendor/test/cases/eol-escape.css +0 -11
- data/vendor/test/cases/eol-escape.styl +0 -27
- data/vendor/test/cases/escape.css +0 -4
- data/vendor/test/cases/escape.styl +0 -4
- data/vendor/test/cases/extend.complex.css +0 -16
- data/vendor/test/cases/extend.complex.styl +0 -15
- data/vendor/test/cases/extend.css +0 -22
- data/vendor/test/cases/extend.multiple-definitions.css +0 -11
- data/vendor/test/cases/extend.multiple-definitions.styl +0 -9
- data/vendor/test/cases/extend.styl +0 -22
- data/vendor/test/cases/fontface.css +0 -4
- data/vendor/test/cases/fontface.styl +0 -5
- data/vendor/test/cases/for.complex.css +0 -44
- data/vendor/test/cases/for.complex.styl +0 -28
- data/vendor/test/cases/for.css +0 -52
- data/vendor/test/cases/for.function.css +0 -20
- data/vendor/test/cases/for.function.styl +0 -51
- data/vendor/test/cases/for.styl +0 -44
- data/vendor/test/cases/function.arguments.css +0 -4
- data/vendor/test/cases/function.arguments.styl +0 -14
- data/vendor/test/cases/function.literals.css +0 -6
- data/vendor/test/cases/function.literals.styl +0 -12
- data/vendor/test/cases/functions.arg-calls.css +0 -3
- data/vendor/test/cases/functions.arg-calls.styl +0 -9
- data/vendor/test/cases/functions.call.css +0 -4
- data/vendor/test/cases/functions.call.styl +0 -7
- data/vendor/test/cases/functions.css +0 -11
- data/vendor/test/cases/functions.defaults.css +0 -15
- data/vendor/test/cases/functions.defaults.styl +0 -30
- data/vendor/test/cases/functions.multi-line.css +0 -9
- data/vendor/test/cases/functions.multi-line.styl +0 -25
- data/vendor/test/cases/functions.multiple-calls.css +0 -13
- data/vendor/test/cases/functions.multiple-calls.styl +0 -26
- data/vendor/test/cases/functions.nested-calls.css +0 -3
- data/vendor/test/cases/functions.nested-calls.styl +0 -9
- data/vendor/test/cases/functions.nested.css +0 -10
- data/vendor/test/cases/functions.nested.styl +0 -37
- data/vendor/test/cases/functions.property.css +0 -10
- data/vendor/test/cases/functions.property.styl +0 -11
- data/vendor/test/cases/functions.return.css +0 -15
- data/vendor/test/cases/functions.return.each.css +0 -10
- data/vendor/test/cases/functions.return.each.styl +0 -23
- data/vendor/test/cases/functions.return.styl +0 -86
- data/vendor/test/cases/functions.styl +0 -34
- data/vendor/test/cases/functions.variable.css +0 -9
- data/vendor/test/cases/functions.variable.ident.css +0 -3
- data/vendor/test/cases/functions.variable.ident.styl +0 -11
- data/vendor/test/cases/functions.variable.styl +0 -27
- data/vendor/test/cases/hack.star.css +0 -27
- data/vendor/test/cases/hack.star.styl +0 -37
- data/vendor/test/cases/if.css +0 -43
- data/vendor/test/cases/if.else.css +0 -6
- data/vendor/test/cases/if.else.styl +0 -16
- data/vendor/test/cases/if.mixin.css +0 -7
- data/vendor/test/cases/if.mixin.styl +0 -24
- data/vendor/test/cases/if.postfix.css +0 -61
- data/vendor/test/cases/if.postfix.styl +0 -110
- data/vendor/test/cases/if.selectors.css +0 -16
- data/vendor/test/cases/if.selectors.styl +0 -22
- data/vendor/test/cases/if.styl +0 -99
- data/vendor/test/cases/import.basic/a.styl +0 -5
- data/vendor/test/cases/import.basic/b.styl +0 -5
- data/vendor/test/cases/import.basic/c.styl +0 -3
- data/vendor/test/cases/import.basic.css +0 -11
- data/vendor/test/cases/import.basic.styl +0 -4
- data/vendor/test/cases/import.complex/a.styl +0 -4
- data/vendor/test/cases/import.complex/c.styl +0 -2
- data/vendor/test/cases/import.complex/nested/b.styl +0 -4
- data/vendor/test/cases/import.complex.css +0 -9
- data/vendor/test/cases/import.complex.styl +0 -1
- data/vendor/test/cases/import.index/vendor/a.styl +0 -2
- data/vendor/test/cases/import.index/vendor/b.styl +0 -2
- data/vendor/test/cases/import.index/vendor/c.styl +0 -2
- data/vendor/test/cases/import.index/vendor/index.styl +0 -4
- data/vendor/test/cases/import.index.css +0 -9
- data/vendor/test/cases/import.index.styl +0 -2
- data/vendor/test/cases/import.literal.css +0 -2
- data/vendor/test/cases/import.literal.styl +0 -3
- data/vendor/test/cases/import.mixins.css +0 -7
- data/vendor/test/cases/import.mixins.styl +0 -9
- data/vendor/test/cases/import.ordering/five.styl +0 -2
- data/vendor/test/cases/import.ordering/four.styl +0 -4
- data/vendor/test/cases/import.ordering/two.styl +0 -2
- data/vendor/test/cases/import.ordering.css +0 -15
- data/vendor/test/cases/import.ordering.styl +0 -12
- data/vendor/test/cases/important.css +0 -6
- data/vendor/test/cases/important.styl +0 -6
- data/vendor/test/cases/interpolation.properties.css +0 -40
- data/vendor/test/cases/interpolation.properties.styl +0 -56
- data/vendor/test/cases/introspection.css +0 -7
- data/vendor/test/cases/introspection.styl +0 -14
- data/vendor/test/cases/jquery.css +0 -3
- data/vendor/test/cases/jquery.styl +0 -5
- data/vendor/test/cases/keyframes.css +0 -9
- data/vendor/test/cases/keyframes.fabrication.css +0 -18
- data/vendor/test/cases/keyframes.fabrication.defaults.css +0 -45
- data/vendor/test/cases/keyframes.fabrication.defaults.styl +0 -9
- data/vendor/test/cases/keyframes.fabrication.styl +0 -11
- data/vendor/test/cases/keyframes.newlines.css +0 -45
- data/vendor/test/cases/keyframes.newlines.styl +0 -7
- data/vendor/test/cases/keyframes.styl +0 -6
- data/vendor/test/cases/kwargs.css +0 -63
- data/vendor/test/cases/kwargs.styl +0 -74
- data/vendor/test/cases/list.css +0 -3
- data/vendor/test/cases/list.styl +0 -3
- data/vendor/test/cases/literal.color.css +0 -10
- data/vendor/test/cases/literal.color.styl +0 -9
- data/vendor/test/cases/literal.css +0 -10
- data/vendor/test/cases/literal.styl +0 -18
- data/vendor/test/cases/media.css +0 -14
- data/vendor/test/cases/media.styl +0 -11
- data/vendor/test/cases/mixin.conditional.css +0 -19
- data/vendor/test/cases/mixin.conditional.styl +0 -36
- data/vendor/test/cases/mixin.order.conditional.css +0 -11
- data/vendor/test/cases/mixin.order.conditional.styl +0 -20
- data/vendor/test/cases/mixin.order.css +0 -9
- data/vendor/test/cases/mixin.order.nested.css +0 -9
- data/vendor/test/cases/mixin.order.nested.styl +0 -21
- data/vendor/test/cases/mixin.order.styl +0 -20
- data/vendor/test/cases/mixins/box.styl +0 -11
- data/vendor/test/cases/mixins.complex.css +0 -30
- data/vendor/test/cases/mixins.complex.fix-to.css +0 -15
- data/vendor/test/cases/mixins.complex.fix-to.styl +0 -28
- data/vendor/test/cases/mixins.complex.styl +0 -41
- data/vendor/test/cases/mixins.conditional.css +0 -3
- data/vendor/test/cases/mixins.conditional.styl +0 -8
- data/vendor/test/cases/mixins.nested.css +0 -7
- data/vendor/test/cases/mixins.nested.selectors.css +0 -21
- data/vendor/test/cases/mixins.nested.selectors.styl +0 -31
- data/vendor/test/cases/mixins.nested.styl +0 -14
- data/vendor/test/cases/mixins.order.2.css +0 -11
- data/vendor/test/cases/mixins.order.2.styl +0 -16
- data/vendor/test/cases/mixins.reset.css +0 -75
- data/vendor/test/cases/mixins.reset.styl +0 -27
- data/vendor/test/cases/mixins.return.css +0 -4
- data/vendor/test/cases/mixins.return.styl +0 -8
- data/vendor/test/cases/mixins.root.css +0 -3
- data/vendor/test/cases/mixins.root.styl +0 -5
- data/vendor/test/cases/operator.range.css +0 -15
- data/vendor/test/cases/operator.range.styl +0 -23
- data/vendor/test/cases/operators.assignment.function.css +0 -15
- data/vendor/test/cases/operators.assignment.function.styl +0 -34
- data/vendor/test/cases/operators.assignment.mixin.css +0 -15
- data/vendor/test/cases/operators.assignment.mixin.styl +0 -39
- data/vendor/test/cases/operators.assignment.root.css +0 -25
- data/vendor/test/cases/operators.assignment.root.styl +0 -55
- data/vendor/test/cases/operators.complex.css +0 -9
- data/vendor/test/cases/operators.complex.styl +0 -32
- data/vendor/test/cases/operators.css +0 -40
- data/vendor/test/cases/operators.equality.css +0 -55
- data/vendor/test/cases/operators.equality.styl +0 -55
- data/vendor/test/cases/operators.in.css +0 -37
- data/vendor/test/cases/operators.in.styl +0 -51
- data/vendor/test/cases/operators.mixins.css +0 -10
- data/vendor/test/cases/operators.mixins.styl +0 -25
- data/vendor/test/cases/operators.precedence.css +0 -51
- data/vendor/test/cases/operators.precedence.styl +0 -82
- data/vendor/test/cases/operators.styl +0 -96
- data/vendor/test/cases/operators.subscript.assign.css +0 -21
- data/vendor/test/cases/operators.subscript.assign.styl +0 -45
- data/vendor/test/cases/operators.subscript.css +0 -59
- data/vendor/test/cases/operators.subscript.range.css +0 -14
- data/vendor/test/cases/operators.subscript.range.styl +0 -15
- data/vendor/test/cases/operators.subscript.styl +0 -81
- data/vendor/test/cases/page.css +0 -16
- data/vendor/test/cases/page.styl +0 -17
- data/vendor/test/cases/parent.css +0 -32
- data/vendor/test/cases/parent.styl +0 -33
- data/vendor/test/cases/properties.colons.css +0 -8
- data/vendor/test/cases/properties.colons.styl +0 -10
- data/vendor/test/cases/properties.css +0 -4
- data/vendor/test/cases/properties.one-line.css +0 -10
- data/vendor/test/cases/properties.one-line.styl +0 -11
- data/vendor/test/cases/properties.styl +0 -4
- data/vendor/test/cases/property-access.bubble.css +0 -38
- data/vendor/test/cases/property-access.bubble.styl +0 -46
- data/vendor/test/cases/property-access.css +0 -48
- data/vendor/test/cases/property-access.siblings.css +0 -19
- data/vendor/test/cases/property-access.siblings.styl +0 -20
- data/vendor/test/cases/property-access.styl +0 -62
- data/vendor/test/cases/regression.107.lookup-failure.css +0 -12
- data/vendor/test/cases/regression.107.lookup-failure.styl +0 -13
- data/vendor/test/cases/regression.127.css +0 -3
- data/vendor/test/cases/regression.127.styl +0 -2
- data/vendor/test/cases/regression.130.css +0 -16
- data/vendor/test/cases/regression.130.styl +0 -6
- data/vendor/test/cases/regression.131.css +0 -7
- data/vendor/test/cases/regression.131.styl +0 -2
- data/vendor/test/cases/regression.137.css +0 -7
- data/vendor/test/cases/regression.137.styl +0 -7
- data/vendor/test/cases/regression.139.css +0 -5
- data/vendor/test/cases/regression.139.styl +0 -21
- data/vendor/test/cases/regression.142.css +0 -39
- data/vendor/test/cases/regression.142.styl +0 -54
- data/vendor/test/cases/regression.146.css +0 -30
- data/vendor/test/cases/regression.146.styl +0 -31
- data/vendor/test/cases/regression.153.css +0 -8
- data/vendor/test/cases/regression.153.styl +0 -9
- data/vendor/test/cases/regression.154.css +0 -8
- data/vendor/test/cases/regression.154.styl +0 -14
- data/vendor/test/cases/regression.156.css +0 -4
- data/vendor/test/cases/regression.156.styl +0 -6
- data/vendor/test/cases/regression.212.css +0 -15
- data/vendor/test/cases/regression.212.styl +0 -14
- data/vendor/test/cases/regression.216.css +0 -10
- data/vendor/test/cases/regression.216.styl +0 -8
- data/vendor/test/cases/regression.220.css +0 -5
- data/vendor/test/cases/regression.220.styl +0 -5
- data/vendor/test/cases/regression.229.css +0 -12
- data/vendor/test/cases/regression.229.styl +0 -9
- data/vendor/test/cases/regression.233.css +0 -6
- data/vendor/test/cases/regression.233.styl +0 -7
- data/vendor/test/cases/regression.235.css +0 -11
- data/vendor/test/cases/regression.235.styl +0 -13
- data/vendor/test/cases/regression.243.css +0 -3
- data/vendor/test/cases/regression.243.styl +0 -4
- data/vendor/test/cases/regression.244.css +0 -3
- data/vendor/test/cases/regression.244.styl +0 -3
- data/vendor/test/cases/regression.247.css +0 -6
- data/vendor/test/cases/regression.247.styl +0 -6
- data/vendor/test/cases/regression.248.compressed.css +0 -4
- data/vendor/test/cases/regression.248.compressed.styl +0 -10
- data/vendor/test/cases/regression.252.css +0 -13
- data/vendor/test/cases/regression.252.styl +0 -13
- data/vendor/test/cases/regression.260.css +0 -6
- data/vendor/test/cases/regression.260.styl +0 -6
- data/vendor/test/cases/regression.267.css +0 -3
- data/vendor/test/cases/regression.267.styl +0 -3
- data/vendor/test/cases/regression.270.css +0 -5
- data/vendor/test/cases/regression.270.styl +0 -7
- data/vendor/test/cases/regression.272.css +0 -11
- data/vendor/test/cases/regression.272.styl +0 -17
- data/vendor/test/cases/regression.274.css +0 -14
- data/vendor/test/cases/regression.274.styl +0 -16
- data/vendor/test/cases/regression.292.css +0 -3
- data/vendor/test/cases/regression.292.styl +0 -3
- data/vendor/test/cases/regression.360.css +0 -19
- data/vendor/test/cases/regression.360.styl +0 -1
- data/vendor/test/cases/regression.368.css +0 -4
- data/vendor/test/cases/regression.368.styl +0 -3
- data/vendor/test/cases/regression.379.css +0 -6
- data/vendor/test/cases/regression.379.styl +0 -10
- data/vendor/test/cases/regression.380.css +0 -8
- data/vendor/test/cases/regression.380.styl +0 -14
- data/vendor/test/cases/regression.388.css +0 -2
- data/vendor/test/cases/regression.388.styl +0 -6
- data/vendor/test/cases/regression.415.css +0 -5
- data/vendor/test/cases/regression.415.styl +0 -3
- data/vendor/test/cases/regression.420.css +0 -21
- data/vendor/test/cases/regression.420.styl +0 -29
- data/vendor/test/cases/regression.432.css +0 -5
- data/vendor/test/cases/regression.432.styl +0 -4
- data/vendor/test/cases/regression.440.css +0 -5
- data/vendor/test/cases/regression.440.styl +0 -7
- data/vendor/test/cases/regression.449.css +0 -9
- data/vendor/test/cases/regression.449.styl +0 -10
- data/vendor/test/cases/regression.458.css +0 -3
- data/vendor/test/cases/regression.458.styl +0 -3
- data/vendor/test/cases/regression.460.css +0 -13
- data/vendor/test/cases/regression.460.styl +0 -18
- data/vendor/test/cases/regression.469.css +0 -4
- data/vendor/test/cases/regression.469.styl +0 -6
- data/vendor/test/cases/regression.472.css +0 -10
- data/vendor/test/cases/regression.472.styl +0 -23
- data/vendor/test/cases/regression.475.css +0 -6
- data/vendor/test/cases/regression.475.styl +0 -7
- data/vendor/test/cases/regression.480.css +0 -9
- data/vendor/test/cases/regression.480.styl +0 -12
- data/vendor/test/cases/regression.484.css +0 -9
- data/vendor/test/cases/regression.484.styl +0 -8
- data/vendor/test/cases/regression.498.css +0 -8
- data/vendor/test/cases/regression.498.styl +0 -11
- data/vendor/test/cases/regression.499.css +0 -14
- data/vendor/test/cases/regression.499.styl +0 -20
- data/vendor/test/cases/regression.503.css +0 -65
- data/vendor/test/cases/regression.503.styl +0 -7
- data/vendor/test/cases/regression.504.css +0 -65
- data/vendor/test/cases/regression.504.styl +0 -12
- data/vendor/test/cases/regression.524.css +0 -4
- data/vendor/test/cases/regression.524.styl +0 -7
- data/vendor/test/cases/regression.535.css +0 -3
- data/vendor/test/cases/regression.535.styl +0 -9
- data/vendor/test/cases/regression.536.css +0 -3
- data/vendor/test/cases/regression.536.styl +0 -5
- data/vendor/test/cases/reset.css +0 -70
- data/vendor/test/cases/reset.styl +0 -16
- data/vendor/test/cases/rule.charset.css +0 -1
- data/vendor/test/cases/rule.charset.styl +0 -2
- data/vendor/test/cases/rulset.css +0 -4
- data/vendor/test/cases/rulset.newline.css +0 -5
- data/vendor/test/cases/rulset.newline.styl +0 -5
- data/vendor/test/cases/rulset.styl +0 -3
- data/vendor/test/cases/scope.complex.css +0 -10
- data/vendor/test/cases/scope.complex.styl +0 -16
- data/vendor/test/cases/scope.css +0 -5
- data/vendor/test/cases/scope.nested.css +0 -9
- data/vendor/test/cases/scope.nested.styl +0 -10
- data/vendor/test/cases/scope.styl +0 -12
- data/vendor/test/cases/selector.interpolation.css +0 -57
- data/vendor/test/cases/selector.interpolation.styl +0 -45
- data/vendor/test/cases/selectors.complex.css +0 -28
- data/vendor/test/cases/selectors.complex.styl +0 -27
- data/vendor/test/cases/selectors.css +0 -50
- data/vendor/test/cases/selectors.nested.comma.css +0 -9
- data/vendor/test/cases/selectors.nested.comma.styl +0 -8
- data/vendor/test/cases/selectors.nested.css +0 -34
- data/vendor/test/cases/selectors.nested.styl +0 -33
- data/vendor/test/cases/selectors.pseudo.css +0 -27
- data/vendor/test/cases/selectors.pseudo.elements.css +0 -26
- data/vendor/test/cases/selectors.pseudo.elements.styl +0 -29
- data/vendor/test/cases/selectors.pseudo.styl +0 -24
- data/vendor/test/cases/selectors.styl +0 -46
- data/vendor/test/cases/self-assignment.css +0 -3
- data/vendor/test/cases/self-assignment.styl +0 -4
- data/vendor/test/cases/vargs.call.css +0 -24
- data/vendor/test/cases/vargs.call.styl +0 -40
- data/vendor/test/cases/vargs.css +0 -30
- data/vendor/test/cases/vargs.styl +0 -49
- data/vendor/test/cases/variable.css +0 -3
- data/vendor/test/cases/variable.styl +0 -4
- data/vendor/test/cases/variables.css +0 -12
- data/vendor/test/cases/variables.styl +0 -17
- data/vendor/test/images/gif +0 -0
- data/vendor/test/images/squirrel.jpeg +0 -0
- data/vendor/test/images/tux.png +0 -0
- data/vendor/test/run.js +0 -169
@@ -1,12 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
exports.
|
4
|
-
exports.
|
5
|
-
exports.
|
6
|
-
exports.
|
7
|
-
exports.
|
8
|
-
exports.
|
9
|
-
exports.StyleSheet = require(
|
10
|
-
exports.CSSStyleSheet = require(
|
11
|
-
exports.
|
12
|
-
exports.
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
exports.CSSStyleDeclaration = require('./CSSStyleDeclaration').CSSStyleDeclaration;
|
4
|
+
exports.CSSRule = require('./CSSRule').CSSRule;
|
5
|
+
exports.CSSStyleRule = require('./CSSStyleRule').CSSStyleRule;
|
6
|
+
exports.MediaList = require('./MediaList').MediaList;
|
7
|
+
exports.CSSMediaRule = require('./CSSMediaRule').CSSMediaRule;
|
8
|
+
exports.CSSImportRule = require('./CSSImportRule').CSSImportRule;
|
9
|
+
exports.StyleSheet = require('./StyleSheet').StyleSheet;
|
10
|
+
exports.CSSStyleSheet = require('./CSSStyleSheet').CSSStyleSheet;
|
11
|
+
exports.CSSKeyframesRule = require('./CSSKeyframesRule').CSSKeyframesRule;
|
12
|
+
exports.CSSKeyframeRule = require('./CSSKeyframeRule').CSSKeyframeRule;
|
13
|
+
exports.parse = require('./parse').parse;
|
14
|
+
exports.clone = require('./clone').clone;
|
@@ -13,12 +13,10 @@ var CSSOM = {
|
|
13
13
|
|
14
14
|
/**
|
15
15
|
* @param {string} token
|
16
|
-
* @param {Object} [options]
|
17
16
|
*/
|
18
|
-
CSSOM.parse = function parse(token
|
17
|
+
CSSOM.parse = function parse(token) {
|
19
18
|
|
20
|
-
|
21
|
-
var i = options.startIndex || 0;
|
19
|
+
var i = 0;
|
22
20
|
|
23
21
|
/**
|
24
22
|
"before-selector" or
|
@@ -30,10 +28,9 @@ CSSOM.parse = function parse(token, options) {
|
|
30
28
|
"before-value" or
|
31
29
|
"value"
|
32
30
|
*/
|
33
|
-
var state =
|
31
|
+
var state = "before-selector";
|
34
32
|
|
35
33
|
var index;
|
36
|
-
var j = i;
|
37
34
|
var buffer = "";
|
38
35
|
|
39
36
|
var SIGNIFICANT_WHITESPACE = {
|
@@ -47,9 +44,12 @@ CSSOM.parse = function parse(token, options) {
|
|
47
44
|
|
48
45
|
var styleSheet = new CSSOM.CSSStyleSheet;
|
49
46
|
|
50
|
-
// @type CSSStyleSheet|CSSMediaRule
|
47
|
+
// @type CSSStyleSheet|CSSMediaRule|CSSKeyframesRule
|
51
48
|
var currentScope = styleSheet;
|
52
|
-
|
49
|
+
|
50
|
+
// @type CSSMediaRule|CSSKeyframesRule
|
51
|
+
var parentRule;
|
52
|
+
|
53
53
|
var selector, name, value, priority="", styleRule, mediaRule, importRule, keyframesRule, keyframeRule;
|
54
54
|
|
55
55
|
for (var character; character = token.charAt(i); i++) {
|
@@ -68,8 +68,7 @@ CSSOM.parse = function parse(token, options) {
|
|
68
68
|
|
69
69
|
// String
|
70
70
|
case '"':
|
71
|
-
|
72
|
-
index = token.indexOf('"', j) + 1;
|
71
|
+
index = token.indexOf('"', i + 1) + 1;
|
73
72
|
if (!index) {
|
74
73
|
throw '" is missing';
|
75
74
|
}
|
@@ -86,8 +85,7 @@ CSSOM.parse = function parse(token, options) {
|
|
86
85
|
break;
|
87
86
|
|
88
87
|
case "'":
|
89
|
-
|
90
|
-
index = token.indexOf("'", j) + 1;
|
88
|
+
index = token.indexOf("'", i + 1) + 1;
|
91
89
|
if (!index) {
|
92
90
|
throw "' is missing";
|
93
91
|
}
|
@@ -105,18 +103,18 @@ CSSOM.parse = function parse(token, options) {
|
|
105
103
|
|
106
104
|
// Comment
|
107
105
|
case "/":
|
108
|
-
if (token.charAt(i + 1)
|
106
|
+
if (token.charAt(i + 1) === "*") {
|
109
107
|
i += 2;
|
110
108
|
index = token.indexOf("*/", i);
|
111
|
-
if (index
|
112
|
-
throw SyntaxError("Missing */");
|
109
|
+
if (index === -1) {
|
110
|
+
throw new SyntaxError("Missing */");
|
113
111
|
} else {
|
114
112
|
i = index + 1;
|
115
113
|
}
|
116
114
|
} else {
|
117
115
|
buffer += character;
|
118
116
|
}
|
119
|
-
if (state
|
117
|
+
if (state === "importRule-begin") {
|
120
118
|
buffer += " ";
|
121
119
|
state = "importRule";
|
122
120
|
}
|
@@ -124,52 +122,55 @@ CSSOM.parse = function parse(token, options) {
|
|
124
122
|
|
125
123
|
// At-rule
|
126
124
|
case "@":
|
127
|
-
if (token.indexOf("@media", i)
|
125
|
+
if (token.indexOf("@media", i) === i) {
|
128
126
|
state = "atBlock";
|
129
127
|
mediaRule = new CSSOM.CSSMediaRule;
|
130
128
|
mediaRule.__starts = i;
|
131
129
|
i += "media".length;
|
132
130
|
buffer = "";
|
133
131
|
break;
|
134
|
-
} else if (token.indexOf("@import", i)
|
132
|
+
} else if (token.indexOf("@import", i) === i) {
|
135
133
|
state = "importRule-begin";
|
136
134
|
i += "import".length;
|
137
135
|
buffer += "@import";
|
138
136
|
break;
|
139
|
-
} else if (token.indexOf("@-webkit-keyframes", i)
|
137
|
+
} else if (token.indexOf("@-webkit-keyframes", i) === i) {
|
140
138
|
state = "keyframesRule-begin";
|
141
139
|
keyframesRule = new CSSOM.CSSKeyframesRule;
|
142
140
|
keyframesRule.__starts = i;
|
143
141
|
i += "-webkit-keyframes".length;
|
144
142
|
buffer = "";
|
145
143
|
break;
|
146
|
-
} else if (state
|
144
|
+
} else if (state === "selector") {
|
147
145
|
state = "atRule";
|
148
146
|
}
|
149
147
|
buffer += character;
|
150
148
|
break;
|
151
149
|
|
152
150
|
case "{":
|
153
|
-
if (state
|
154
|
-
styleRule.selectorText = buffer.
|
151
|
+
if (state === "selector" || state === "atRule") {
|
152
|
+
styleRule.selectorText = buffer.trim();
|
155
153
|
styleRule.style.__starts = i;
|
156
154
|
buffer = "";
|
157
155
|
state = "before-name";
|
158
|
-
} else if (state
|
156
|
+
} else if (state === "atBlock") {
|
159
157
|
mediaRule.media.mediaText = buffer.trim();
|
160
|
-
|
161
|
-
|
158
|
+
currentScope = parentRule = mediaRule;
|
159
|
+
mediaRule.parentStyleSheet = styleSheet;
|
162
160
|
buffer = "";
|
163
161
|
state = "before-selector";
|
164
|
-
} else if (state
|
165
|
-
keyframesRule.name = buffer.
|
166
|
-
|
167
|
-
|
162
|
+
} else if (state === "keyframesRule-begin") {
|
163
|
+
keyframesRule.name = buffer.trim();
|
164
|
+
if (parentRule) {
|
165
|
+
keyframesRule.parentRule = parentRule;
|
166
|
+
}
|
167
|
+
keyframesRule.parentStyleSheet = styleSheet;
|
168
|
+
currentScope = parentRule = keyframesRule;
|
168
169
|
buffer = "";
|
169
170
|
state = "keyframeRule-begin";
|
170
|
-
} else if (state
|
171
|
+
} else if (state === "keyframeRule-begin") {
|
171
172
|
styleRule = new CSSOM.CSSKeyframeRule;
|
172
|
-
styleRule.keyText = buffer.
|
173
|
+
styleRule.keyText = buffer.trim();
|
173
174
|
styleRule.__starts = i;
|
174
175
|
buffer = "";
|
175
176
|
state = "before-name";
|
@@ -177,7 +178,7 @@ CSSOM.parse = function parse(token, options) {
|
|
177
178
|
break;
|
178
179
|
|
179
180
|
case ":":
|
180
|
-
if (state
|
181
|
+
if (state === "name") {
|
181
182
|
name = buffer.trim();
|
182
183
|
buffer = "";
|
183
184
|
state = "before-value";
|
@@ -187,9 +188,9 @@ CSSOM.parse = function parse(token, options) {
|
|
187
188
|
break;
|
188
189
|
|
189
190
|
case '(':
|
190
|
-
if (state
|
191
|
+
if (state === 'value') {
|
191
192
|
index = token.indexOf(')', i + 1);
|
192
|
-
if (index
|
193
|
+
if (index === -1) {
|
193
194
|
throw i + ': unclosed "("';
|
194
195
|
}
|
195
196
|
buffer += token.slice(i, index + 1);
|
@@ -200,7 +201,7 @@ CSSOM.parse = function parse(token, options) {
|
|
200
201
|
break;
|
201
202
|
|
202
203
|
case "!":
|
203
|
-
if (state
|
204
|
+
if (state === "value" && token.indexOf("!important", i) === i) {
|
204
205
|
priority = "important";
|
205
206
|
i += "important".length;
|
206
207
|
} else {
|
@@ -222,9 +223,9 @@ CSSOM.parse = function parse(token, options) {
|
|
222
223
|
break;
|
223
224
|
case "importRule":
|
224
225
|
importRule = new CSSOM.CSSImportRule;
|
225
|
-
importRule.
|
226
|
+
importRule.parentStyleSheet = importRule.styleSheet.parentStyleSheet = styleSheet;
|
226
227
|
importRule.cssText = buffer + character;
|
227
|
-
|
228
|
+
styleSheet.cssRules.push(importRule);
|
228
229
|
buffer = "";
|
229
230
|
state = "before-selector";
|
230
231
|
break;
|
@@ -242,10 +243,13 @@ CSSOM.parse = function parse(token, options) {
|
|
242
243
|
case "before-name":
|
243
244
|
case "name":
|
244
245
|
styleRule.__ends = i + 1;
|
245
|
-
|
246
|
+
if (parentRule) {
|
247
|
+
styleRule.parentRule = parentRule;
|
248
|
+
}
|
249
|
+
styleRule.parentStyleSheet = styleSheet;
|
246
250
|
currentScope.cssRules.push(styleRule);
|
247
251
|
buffer = "";
|
248
|
-
if (currentScope.constructor
|
252
|
+
if (currentScope.constructor === CSSOM.CSSKeyframesRule) {
|
249
253
|
state = "keyframeRule-begin";
|
250
254
|
} else {
|
251
255
|
state = "before-selector";
|
@@ -255,13 +259,14 @@ CSSOM.parse = function parse(token, options) {
|
|
255
259
|
case "before-selector":
|
256
260
|
case "selector":
|
257
261
|
// End of media rule.
|
258
|
-
|
259
|
-
if (!currentScope.parentRule) {
|
262
|
+
if (!parentRule) {
|
260
263
|
throw "unexpected }";
|
261
264
|
}
|
262
265
|
currentScope.__ends = i + 1;
|
263
|
-
|
264
|
-
currentScope
|
266
|
+
// Nesting rules aren’t supported yet
|
267
|
+
styleSheet.cssRules.push(currentScope);
|
268
|
+
currentScope = styleSheet;
|
269
|
+
parentRule = null;
|
265
270
|
buffer = "";
|
266
271
|
state = "before-selector";
|
267
272
|
break;
|
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "cssom",
|
3
3
|
"description": "CSS Object Model implementation and CSS parser",
|
4
4
|
"keywords": ["CSS", "CSSOM", "parser", "styleSheet"],
|
5
|
-
"version": "0.2.
|
5
|
+
"version": "0.2.2",
|
6
6
|
"homepage": "https://github.com/NV/CSSOM",
|
7
7
|
"author": "Nikita Vasilyev <me@elv1s.ru>",
|
8
8
|
"repository": {
|
@@ -13,14 +13,15 @@
|
|
13
13
|
"url": "https://github.com/NV/CSSOM/issues"
|
14
14
|
},
|
15
15
|
"directories": {
|
16
|
-
"
|
17
|
-
"lib": "./lib",
|
18
|
-
"test": "./test"
|
16
|
+
"lib": "./lib"
|
19
17
|
},
|
20
18
|
"main": "./lib/index.js",
|
21
19
|
"engines": {
|
22
20
|
"node": ">=0.2.0"
|
23
21
|
},
|
22
|
+
"devDependencies": {
|
23
|
+
"jake": "0.2.x"
|
24
|
+
},
|
24
25
|
"licenses": [
|
25
26
|
{
|
26
27
|
"type": "MIT",
|
@@ -0,0 +1,35 @@
|
|
1
|
+
|
2
|
+
0.5.0 / 2012-02-02
|
3
|
+
==================
|
4
|
+
|
5
|
+
* Added: humanize diffs. Closes #8
|
6
|
+
* Added `debug.disable()` to the CS variant
|
7
|
+
* Removed padding. Closes #10
|
8
|
+
* Fixed: persist client-side variant again. Closes #9
|
9
|
+
|
10
|
+
0.4.0 / 2012-02-01
|
11
|
+
==================
|
12
|
+
|
13
|
+
* Added browser variant support for older browsers [TooTallNate]
|
14
|
+
* Added `debug.enable('project:*')` to browser variant [TooTallNate]
|
15
|
+
* Added padding to diff (moved it to the right)
|
16
|
+
|
17
|
+
0.3.0 / 2012-01-26
|
18
|
+
==================
|
19
|
+
|
20
|
+
* Added millisecond diff when isatty, otherwise UTC string
|
21
|
+
|
22
|
+
0.2.0 / 2012-01-22
|
23
|
+
==================
|
24
|
+
|
25
|
+
* Added wildcard support
|
26
|
+
|
27
|
+
0.1.0 / 2011-12-02
|
28
|
+
==================
|
29
|
+
|
30
|
+
* Added: remove colors unless stderr isatty [TooTallNate]
|
31
|
+
|
32
|
+
0.0.1 / 2010-01-03
|
33
|
+
==================
|
34
|
+
|
35
|
+
* Initial release
|
@@ -0,0 +1,128 @@
|
|
1
|
+
|
2
|
+
# debug
|
3
|
+
|
4
|
+
tiny node.js debugging utility.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
```
|
9
|
+
$ npm install debug
|
10
|
+
```
|
11
|
+
|
12
|
+
## Example
|
13
|
+
|
14
|
+
This module is modelled after node core's debugging technique, allowing you to enable one or more topic-specific debugging functions, for example core does the following within many modules:
|
15
|
+
|
16
|
+
```js
|
17
|
+
var debug;
|
18
|
+
if (process.env.NODE_DEBUG && /cluster/.test(process.env.NODE_DEBUG)) {
|
19
|
+
debug = function(x) {
|
20
|
+
var prefix = process.pid + ',' +
|
21
|
+
(process.env.NODE_WORKER_ID ? 'Worker' : 'Master');
|
22
|
+
console.error(prefix, x);
|
23
|
+
};
|
24
|
+
} else {
|
25
|
+
debug = function() { };
|
26
|
+
}
|
27
|
+
```
|
28
|
+
|
29
|
+
This concept is extremely simple but it works well. With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.
|
30
|
+
|
31
|
+
Example _app.js_:
|
32
|
+
|
33
|
+
```js
|
34
|
+
var debug = require('debug')('http')
|
35
|
+
, http = require('http')
|
36
|
+
, name = 'My App';
|
37
|
+
|
38
|
+
// fake app
|
39
|
+
|
40
|
+
debug('booting %s', name);
|
41
|
+
|
42
|
+
http.createServer(function(req, res){
|
43
|
+
debug(req.method + ' ' + req.url);
|
44
|
+
res.end('hello\n');
|
45
|
+
}).listen(3000, function(){
|
46
|
+
debug('listening');
|
47
|
+
});
|
48
|
+
|
49
|
+
// fake worker of some kind
|
50
|
+
|
51
|
+
require('./worker');
|
52
|
+
```
|
53
|
+
|
54
|
+
Example _worker.js_:
|
55
|
+
|
56
|
+
```js
|
57
|
+
var debug = require('debug')('worker');
|
58
|
+
|
59
|
+
setInterval(function(){
|
60
|
+
debug('doing some work');
|
61
|
+
}, 1000);
|
62
|
+
```
|
63
|
+
|
64
|
+
The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
|
65
|
+
|
66
|
+
![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)
|
67
|
+
|
68
|
+
![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)
|
69
|
+
|
70
|
+
## Millisecond diff
|
71
|
+
|
72
|
+
When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
|
73
|
+
|
74
|
+
![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)
|
75
|
+
|
76
|
+
When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
|
77
|
+
|
78
|
+
![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)
|
79
|
+
|
80
|
+
## Conventions
|
81
|
+
|
82
|
+
If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".
|
83
|
+
|
84
|
+
## Wildcards
|
85
|
+
|
86
|
+
The "*" character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
|
87
|
+
|
88
|
+
## Browser support
|
89
|
+
|
90
|
+
Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`.
|
91
|
+
|
92
|
+
```js
|
93
|
+
a = debug('worker:a');
|
94
|
+
b = debug('worker:b');
|
95
|
+
|
96
|
+
setInterval(function(){
|
97
|
+
a('doing some work');
|
98
|
+
}, 1000);
|
99
|
+
|
100
|
+
setInterval(function(){
|
101
|
+
a('doing some work');
|
102
|
+
}, 1200);
|
103
|
+
```
|
104
|
+
|
105
|
+
## License
|
106
|
+
|
107
|
+
(The MIT License)
|
108
|
+
|
109
|
+
Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
|
110
|
+
|
111
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
112
|
+
a copy of this software and associated documentation files (the
|
113
|
+
'Software'), to deal in the Software without restriction, including
|
114
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
115
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
116
|
+
permit persons to whom the Software is furnished to do so, subject to
|
117
|
+
the following conditions:
|
118
|
+
|
119
|
+
The above copyright notice and this permission notice shall be
|
120
|
+
included in all copies or substantial portions of the Software.
|
121
|
+
|
122
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
123
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
124
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
125
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
126
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
127
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
128
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,111 @@
|
|
1
|
+
|
2
|
+
/*!
|
3
|
+
* debug
|
4
|
+
* Copyright(c) 2012 TJ Holowaychuk <tj@vision-media.ca>
|
5
|
+
* MIT Licensed
|
6
|
+
*/
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Create a debugger with the given `name`.
|
10
|
+
*
|
11
|
+
* @param {String} name
|
12
|
+
* @return {Type}
|
13
|
+
* @api public
|
14
|
+
*/
|
15
|
+
|
16
|
+
function debug(name) {
|
17
|
+
if (!debug.enabled(name)) return function(){};
|
18
|
+
|
19
|
+
return function(fmt){
|
20
|
+
var curr = new Date;
|
21
|
+
var ms = curr - (debug[name] || curr);
|
22
|
+
debug[name] = curr;
|
23
|
+
|
24
|
+
fmt = name
|
25
|
+
+ ' '
|
26
|
+
+ fmt
|
27
|
+
+ ' +' + debug.humanize(ms);
|
28
|
+
|
29
|
+
// This hackery is required for IE8
|
30
|
+
// where `console.log` doesn't have 'apply'
|
31
|
+
window.console
|
32
|
+
&& console.log
|
33
|
+
&& Function.prototype.apply.call(console.log, console, arguments);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
/**
|
38
|
+
* The currently active debug mode names.
|
39
|
+
*/
|
40
|
+
|
41
|
+
debug.names = [];
|
42
|
+
|
43
|
+
/**
|
44
|
+
* Enables a debug mode by name. This can include modes
|
45
|
+
* separated by a colon and wildcards.
|
46
|
+
*
|
47
|
+
* @param {String} name
|
48
|
+
* @api public
|
49
|
+
*/
|
50
|
+
|
51
|
+
debug.enable = function(name) {
|
52
|
+
localStorage.debug = name;
|
53
|
+
|
54
|
+
var split = (name || '').split(/[\s,]+/)
|
55
|
+
, len = split.length;
|
56
|
+
|
57
|
+
for (var i = 0; i < len; i++) {
|
58
|
+
name = split[i].replace('*', '.*?');
|
59
|
+
debug.names.push(new RegExp('^' + name + '$'));
|
60
|
+
}
|
61
|
+
};
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Disable debug output.
|
65
|
+
*
|
66
|
+
* @api public
|
67
|
+
*/
|
68
|
+
|
69
|
+
debug.disable = function(){
|
70
|
+
debug.enable('');
|
71
|
+
};
|
72
|
+
|
73
|
+
/**
|
74
|
+
* Humanize the given `ms`.
|
75
|
+
*
|
76
|
+
* @param {Number} m
|
77
|
+
* @return {String}
|
78
|
+
* @api private
|
79
|
+
*/
|
80
|
+
|
81
|
+
debug.humanize = function(ms) {
|
82
|
+
var sec = 1000
|
83
|
+
, min = 60 * 1000
|
84
|
+
, hour = 60 * min;
|
85
|
+
|
86
|
+
if (ms >= hour) return (ms / hour).toFixed(1) + 'h';
|
87
|
+
if (ms >= min) return (ms / min).toFixed(1) + 'm';
|
88
|
+
if (ms >= sec) return (ms / sec | 0) + 's';
|
89
|
+
return ms + 'ms';
|
90
|
+
};
|
91
|
+
|
92
|
+
/**
|
93
|
+
* Returns true if the given mode name is enabled, false otherwise.
|
94
|
+
*
|
95
|
+
* @param {String} name
|
96
|
+
* @return {Boolean}
|
97
|
+
* @api public
|
98
|
+
*/
|
99
|
+
|
100
|
+
debug.enabled = function(name) {
|
101
|
+
for (var i = 0, len = debug.names.length; i < len; i++) {
|
102
|
+
if (debug.names[i].test(name)) {
|
103
|
+
return true;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
return false;
|
107
|
+
};
|
108
|
+
|
109
|
+
// persist
|
110
|
+
|
111
|
+
if (window.localStorage) debug.enable(localStorage.debug);
|
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
var debug = require('../')('http')
|
3
|
+
, http = require('http')
|
4
|
+
, name = 'My App';
|
5
|
+
|
6
|
+
// fake app
|
7
|
+
|
8
|
+
debug('booting %s', name);
|
9
|
+
|
10
|
+
http.createServer(function(req, res){
|
11
|
+
debug(req.method + ' ' + req.url);
|
12
|
+
res.end('hello\n');
|
13
|
+
}).listen(3000, function(){
|
14
|
+
debug('listening');
|
15
|
+
});
|
16
|
+
|
17
|
+
// fake worker of some kind
|
18
|
+
|
19
|
+
require('./worker');
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<html>
|
2
|
+
<head>
|
3
|
+
<title>debug()</title>
|
4
|
+
<script src="../debug.js"></script>
|
5
|
+
<script>
|
6
|
+
// type debug.enable('*') in
|
7
|
+
// the console and refresh :)
|
8
|
+
|
9
|
+
a = debug('worker:a');
|
10
|
+
b = debug('worker:b');
|
11
|
+
|
12
|
+
setInterval(function(){
|
13
|
+
a('doing some work');
|
14
|
+
}, 1000);
|
15
|
+
|
16
|
+
setInterval(function(){
|
17
|
+
a('doing some work');
|
18
|
+
}, 1200);
|
19
|
+
</script>
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
|
23
|
+
</body>
|
24
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
// DEBUG=* node example/worker
|
3
|
+
// DEBUG=worker:* node example/worker
|
4
|
+
// DEBUG=worker:a node example/worker
|
5
|
+
// DEBUG=worker:b node example/worker
|
6
|
+
|
7
|
+
var a = require('../')('worker:a')
|
8
|
+
, b = require('../')('worker:b');
|
9
|
+
|
10
|
+
function work() {
|
11
|
+
a('doing lots of uninteresting work');
|
12
|
+
setTimeout(work, Math.random() * 1000);
|
13
|
+
}
|
14
|
+
|
15
|
+
work();
|
16
|
+
|
17
|
+
function workb() {
|
18
|
+
b('doing some work');
|
19
|
+
setTimeout(workb, Math.random() * 2000);
|
20
|
+
}
|
21
|
+
|
22
|
+
workb();
|