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,518 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<title>CSSOM.js parse method</title>
|
6
|
-
<script>
|
7
|
-
var exports = {};
|
8
|
-
function require(){
|
9
|
-
return exports;
|
10
|
-
}
|
11
|
-
</script>
|
12
|
-
<script src="../lib/CSSStyleDeclaration.js"></script>
|
13
|
-
<script src="../lib/CSSRule.js"></script>
|
14
|
-
<script src="../lib/CSSStyleRule.js"></script>
|
15
|
-
<script src="../lib/CSSImportRule.js"></script>
|
16
|
-
<script src="../lib/MediaList.js"></script>
|
17
|
-
<script src="../lib/CSSMediaRule.js"></script>
|
18
|
-
<script src="../lib/StyleSheet.js"></script>
|
19
|
-
<script src="../lib/CSSStyleSheet.js"></script>
|
20
|
-
<script src="../lib/parse.js"></script>
|
21
|
-
<script>
|
22
|
-
window.CSSOM = exports;
|
23
|
-
</script>
|
24
|
-
<style>
|
25
|
-
.corner{
|
26
|
-
background: none;
|
27
|
-
border-radius:8px;
|
28
|
-
padding: 0 3px 3px;
|
29
|
-
border:none
|
30
|
-
}
|
31
|
-
</style>
|
32
|
-
<style>
|
33
|
-
/*@import url(foo.css);*/
|
34
|
-
/*@media all {*/
|
35
|
-
html {
|
36
|
-
background-position: 0;
|
37
|
-
border: red;
|
38
|
-
|
39
|
-
}
|
40
|
-
/*}*/
|
41
|
-
</style>
|
42
|
-
<style type="text/css">
|
43
|
-
html, body {
|
44
|
-
background: #333;
|
45
|
-
color: #EEE;
|
46
|
-
font: 12px sans-serif;
|
47
|
-
margin: 0;
|
48
|
-
height: 100%;
|
49
|
-
}
|
50
|
-
body {
|
51
|
-
padding-bottom: 1.7em;
|
52
|
-
-webkit-box-sizing: border-box;
|
53
|
-
-moz-box-sizing: border-box;
|
54
|
-
box-sizing: border-box;
|
55
|
-
}
|
56
|
-
table {
|
57
|
-
width: 100%;
|
58
|
-
table-layout: fixed;
|
59
|
-
margin: 0 auto;
|
60
|
-
}
|
61
|
-
td {
|
62
|
-
vertical-align: top;
|
63
|
-
}
|
64
|
-
h1 {
|
65
|
-
font: normal 1em sans-serif;
|
66
|
-
display: inline;
|
67
|
-
}
|
68
|
-
#labels {
|
69
|
-
color: #FFE992;
|
70
|
-
width: 66%;
|
71
|
-
}
|
72
|
-
#labels td {
|
73
|
-
width: 50%;
|
74
|
-
text-align: center;
|
75
|
-
}
|
76
|
-
#labels td::before {
|
77
|
-
content: '↱ ';
|
78
|
-
color: #998e62;
|
79
|
-
position: relative;
|
80
|
-
top: .4em;
|
81
|
-
}
|
82
|
-
#labels td::after {
|
83
|
-
content: ' ↴';
|
84
|
-
color: #998e62;
|
85
|
-
position: relative;
|
86
|
-
top: .4em;
|
87
|
-
}
|
88
|
-
#content {
|
89
|
-
width: 100%;
|
90
|
-
height: 100%;
|
91
|
-
}
|
92
|
-
#content td {
|
93
|
-
width: 33%;
|
94
|
-
}
|
95
|
-
#content td + td {
|
96
|
-
padding-left: 1%;
|
97
|
-
}
|
98
|
-
.style-cell textarea {
|
99
|
-
width: 99%;
|
100
|
-
height: 100%;
|
101
|
-
font: 12px monospace;
|
102
|
-
white-space: pre-wrap;
|
103
|
-
}
|
104
|
-
.serialized-cell {
|
105
|
-
border-left: 1px solid #363636;
|
106
|
-
}
|
107
|
-
#message {
|
108
|
-
visibility: hidden;
|
109
|
-
}
|
110
|
-
.error #message {
|
111
|
-
visibility: visible;
|
112
|
-
position: absolute;
|
113
|
-
top: 0;
|
114
|
-
left: 34%;
|
115
|
-
padding: 1em;
|
116
|
-
background: black;
|
117
|
-
color: #e34343;
|
118
|
-
font-size: 24px;
|
119
|
-
}
|
120
|
-
</style>
|
121
|
-
</head>
|
122
|
-
<body>
|
123
|
-
<table id="labels">
|
124
|
-
<tr><td><h1>CSSOM.parse</h1></td><td>.toString</td></tr>
|
125
|
-
</table>
|
126
|
-
<table id="content">
|
127
|
-
<tr>
|
128
|
-
<td class="style-cell">
|
129
|
-
<textarea id="style" spellcheck="false" rows="40">img {
|
130
|
-
border: none
|
131
|
-
}</textarea></td>
|
132
|
-
<td class="output-cell"><pre id="output"></pre></td>
|
133
|
-
<td class="serialized-cell"><pre id="serialized"></pre></td>
|
134
|
-
</tr>
|
135
|
-
</table>
|
136
|
-
<div id="message"></div>
|
137
|
-
<script defer>
|
138
|
-
//console.log(document.styleSheets[0].cssRules[0].style["table-layout"]);
|
139
|
-
var CSS = {
|
140
|
-
background: [
|
141
|
-
"background-image",
|
142
|
-
"background-repeat",
|
143
|
-
"background-attachment",
|
144
|
-
"background-position",
|
145
|
-
"background-origin",
|
146
|
-
"background-clip",
|
147
|
-
"background-color"
|
148
|
-
],
|
149
|
-
"background-repeat": [
|
150
|
-
"background-repeat-x",
|
151
|
-
"background-repeat-y"
|
152
|
-
],
|
153
|
-
"background-position": [
|
154
|
-
"background-position-x",
|
155
|
-
"background-position-y"
|
156
|
-
],
|
157
|
-
border: [
|
158
|
-
"border-top",
|
159
|
-
"border-right",
|
160
|
-
"border-bottom",
|
161
|
-
"border-left",
|
162
|
-
"border-width",
|
163
|
-
"border-style",
|
164
|
-
"border-color"
|
165
|
-
],
|
166
|
-
"border-top": [
|
167
|
-
"border-top-width",
|
168
|
-
"border-top-style",
|
169
|
-
"border-top-color"
|
170
|
-
],
|
171
|
-
"border-right": [
|
172
|
-
"border-right-width",
|
173
|
-
"border-right-style",
|
174
|
-
"border-right-color"
|
175
|
-
],
|
176
|
-
"border-bottom": [
|
177
|
-
"border-bottom-width",
|
178
|
-
"border-bottom-style",
|
179
|
-
"border-bottom-color"
|
180
|
-
],
|
181
|
-
"border-left": [
|
182
|
-
"border-left-width",
|
183
|
-
"border-left-style",
|
184
|
-
"border-left-color"
|
185
|
-
],
|
186
|
-
"border-style": [
|
187
|
-
"border-top-style",
|
188
|
-
"border-right-style",
|
189
|
-
"border-bottom-style",
|
190
|
-
"border-left-style"
|
191
|
-
],
|
192
|
-
"border-width": [
|
193
|
-
"border-top-width",
|
194
|
-
"border-right-width",
|
195
|
-
"border-bottom-width",
|
196
|
-
"border-left-width"
|
197
|
-
],
|
198
|
-
"border-color": [
|
199
|
-
"border-top-color",
|
200
|
-
"border-right-color",
|
201
|
-
"border-bottom-color",
|
202
|
-
"border-left-color"
|
203
|
-
],
|
204
|
-
"border-radius": [
|
205
|
-
"border-top-left-radius",
|
206
|
-
"border-top-right-radius",
|
207
|
-
"border-bottom-right-radius",
|
208
|
-
"border-bottom-left-radius"
|
209
|
-
],
|
210
|
-
font: [
|
211
|
-
"font-style",
|
212
|
-
"font-variant",
|
213
|
-
"font-weight",
|
214
|
-
"font-size",
|
215
|
-
"font-size-adjust",
|
216
|
-
"font-stretch",
|
217
|
-
"line-height",
|
218
|
-
"font-family"
|
219
|
-
],
|
220
|
-
"list-style": [
|
221
|
-
"list-style-type",
|
222
|
-
"list-style-position",
|
223
|
-
"list-style-image"
|
224
|
-
],
|
225
|
-
margin: [
|
226
|
-
"margin-top",
|
227
|
-
"margin-right",
|
228
|
-
"margin-bottom",
|
229
|
-
"margin-left"
|
230
|
-
],
|
231
|
-
padding: [
|
232
|
-
"padding-top",
|
233
|
-
"padding-right",
|
234
|
-
"padding-bottom",
|
235
|
-
"padding-left"
|
236
|
-
]
|
237
|
-
};
|
238
|
-
|
239
|
-
function camelize(string) {
|
240
|
-
return string.replace(/-+(.)?/g, function(match, chr) {
|
241
|
-
return chr ? chr.toUpperCase() : '';
|
242
|
-
});
|
243
|
-
}
|
244
|
-
|
245
|
-
CSS["background-repeat"].shorthand = function(style) {
|
246
|
-
if (style["background-repeat-x"] == style["background-repeat-y"]) {
|
247
|
-
return style["background-repeat-x"];
|
248
|
-
} else {
|
249
|
-
return style["background-repeat-x"] + " " + style["background-repeat-y"];
|
250
|
-
}
|
251
|
-
};
|
252
|
-
|
253
|
-
CSS["background-position"].shorthand = function(style) {
|
254
|
-
if (style["background-position-x"] == style["background-position-y"]) {
|
255
|
-
return style["background-position-x"];
|
256
|
-
} else {
|
257
|
-
return style["background-position-x"] + " " + style["background-position-y"];
|
258
|
-
}
|
259
|
-
};
|
260
|
-
|
261
|
-
CSS["border-radius"].shorthand = function(style) {
|
262
|
-
var radius = style["border-top-left-radius"];
|
263
|
-
if (style["border-top-right-radius"] == radius && style["border-bottom-right-radius"] == radius && style["border-bottom-left-radius"] == radius) {
|
264
|
-
var couple = radius.split(' ');
|
265
|
-
if (couple[0] == couple[1]) {
|
266
|
-
return couple[0];
|
267
|
-
} else {
|
268
|
-
return radius;
|
269
|
-
}
|
270
|
-
}
|
271
|
-
};
|
272
|
-
/*
|
273
|
-
CSS.background.shorthand = function(style) {
|
274
|
-
var values = [];
|
275
|
-
|
276
|
-
//FIXME
|
277
|
-
// Support CSS3 background shorthand
|
278
|
-
// http://www.w3.org/TR/css3-background/#the-background
|
279
|
-
|
280
|
-
var backgroundColor = style["background-color"];
|
281
|
-
if (backgroundColor != "initial" && backgroundColor != "transparent") {
|
282
|
-
values.push(backgroundColor);
|
283
|
-
}
|
284
|
-
|
285
|
-
var backgroundImage = style["background-image"];
|
286
|
-
if (backgroundImage != "initial" && backgroundImage != "none") {
|
287
|
-
values.push(backgroundImage);
|
288
|
-
}
|
289
|
-
|
290
|
-
var backgroundRepeat = style["background-repeat"];
|
291
|
-
if (backgroundRepeat != "initial" && backgroundRepeat != "repeat") {
|
292
|
-
values.push(backgroundRepeat);
|
293
|
-
}
|
294
|
-
|
295
|
-
var backgroundAttachment = style["background-attachment"];
|
296
|
-
if (backgroundAttachment != "initial" && backgroundAttachment != "scroll") {
|
297
|
-
values.push(backgroundAttachment);
|
298
|
-
}
|
299
|
-
|
300
|
-
var backgroundPosition = style["background-position"];
|
301
|
-
if (backgroundPosition != "initial" && parseInt(backgroundPosition) !== 0) {
|
302
|
-
values.push(backgroundPosition);
|
303
|
-
}
|
304
|
-
|
305
|
-
return values.join(" ") || "";
|
306
|
-
};
|
307
|
-
*/
|
308
|
-
|
309
|
-
(function(){
|
310
|
-
for (var key in CSS) {
|
311
|
-
var longhand = CSS[key];
|
312
|
-
if (!longhand.length) {
|
313
|
-
continue;
|
314
|
-
}
|
315
|
-
for (var i=0, ii=longhand.length; i<ii; i++) {
|
316
|
-
var siblings = longhand.slice(0);
|
317
|
-
siblings.splice(i, 1);
|
318
|
-
if (CSS[longhand[i]]) {
|
319
|
-
//console.log("array", CSS[longhand[i]]);
|
320
|
-
} else {
|
321
|
-
CSS[longhand[i]] = {}
|
322
|
-
}
|
323
|
-
CSS[longhand[i]].parent = key;
|
324
|
-
CSS[longhand[i]].siblings = siblings;
|
325
|
-
}
|
326
|
-
}
|
327
|
-
})();
|
328
|
-
|
329
|
-
|
330
|
-
function cloneMinimized(stylesheet) {
|
331
|
-
var cloned = new CSSOM.CSSStyleSheet;
|
332
|
-
|
333
|
-
var rules = stylesheet.cssRules;
|
334
|
-
if (!rules) {
|
335
|
-
return cloned;
|
336
|
-
}
|
337
|
-
|
338
|
-
var RULE_TYPES = {
|
339
|
-
1: CSSOM.CSSStyleRule,
|
340
|
-
4: CSSOM.CSSMediaRule
|
341
|
-
//FIXME
|
342
|
-
//3: CSSOM.CSSImportRule,
|
343
|
-
//5: CSSOM.CSSFontFaceRule,
|
344
|
-
//6: CSSOM.CSSPageRule,
|
345
|
-
};
|
346
|
-
|
347
|
-
for (var i=0, rulesLength=rules.length; i < rulesLength; i++) {
|
348
|
-
var rule = rules[i];
|
349
|
-
var ruleClone = cloned.cssRules[i] = new RULE_TYPES[rule.type];
|
350
|
-
|
351
|
-
var style = rule.style;
|
352
|
-
if (style) {
|
353
|
-
var styleClone = ruleClone.style = minimizeStyle(style);
|
354
|
-
}
|
355
|
-
|
356
|
-
if ("selectorText" in rule) {
|
357
|
-
ruleClone.selectorText = rule.selectorText;
|
358
|
-
}
|
359
|
-
|
360
|
-
if ("mediaText" in rule) {
|
361
|
-
ruleClone.mediaText = rule.mediaText;
|
362
|
-
}
|
363
|
-
|
364
|
-
if ("cssRules" in rule) {
|
365
|
-
rule.cssRules = clone(rule).cssRules;
|
366
|
-
}
|
367
|
-
}
|
368
|
-
|
369
|
-
return cloned;
|
370
|
-
|
371
|
-
}
|
372
|
-
|
373
|
-
function minimizeStyle(style) {
|
374
|
-
var result = new CSSOM.CSSStyleDeclaration;
|
375
|
-
for (var i=0; i<style.length; i++) {
|
376
|
-
var name = closestShorthand(style, style[i]);
|
377
|
-
if (!(name in result)) {
|
378
|
-
var value;
|
379
|
-
if (CSS[name].shorthand) {
|
380
|
-
value = CSS[name].shorthand(style);
|
381
|
-
} else {
|
382
|
-
value = style[camelize(name)];
|
383
|
-
}
|
384
|
-
if (value == 'initial') {
|
385
|
-
//console.warn(name +':'+ value);
|
386
|
-
} else {
|
387
|
-
result[name] = value;
|
388
|
-
result[result.length++] = name;
|
389
|
-
}
|
390
|
-
}
|
391
|
-
}
|
392
|
-
return result;
|
393
|
-
}
|
394
|
-
|
395
|
-
|
396
|
-
CSSStyleSheet.prototype.stringify = function() {
|
397
|
-
var result = '';
|
398
|
-
var rules = this.cssRules;
|
399
|
-
for (var i = 0; i < rules.length; i++) {
|
400
|
-
var rule = rules[i];
|
401
|
-
switch (rule.type) {
|
402
|
-
case CSSRule.STYLE_RULE:
|
403
|
-
case CSSRule.MEDIA_RULE:
|
404
|
-
result += rule.stringify();
|
405
|
-
break;
|
406
|
-
case CSSRule.IMPORT_RULE:
|
407
|
-
result += rule.cssText;
|
408
|
-
break;
|
409
|
-
}
|
410
|
-
}
|
411
|
-
return result;
|
412
|
-
};
|
413
|
-
|
414
|
-
|
415
|
-
onload = function(){
|
416
|
-
console.log(document.styleSheets[0].stringify());
|
417
|
-
};
|
418
|
-
|
419
|
-
CSSStyleRule.prototype.stringify = function() {
|
420
|
-
return this.selectorText + ' {' + minimizeStyle(this.style).cssText +'}\n';
|
421
|
-
};
|
422
|
-
|
423
|
-
|
424
|
-
function closestShorthand(style, name) {
|
425
|
-
if (!(name in CSS)) {
|
426
|
-
return name;
|
427
|
-
}
|
428
|
-
var siblings = CSS[name].siblings;
|
429
|
-
if (!siblings || !siblings.length) {
|
430
|
-
return name;
|
431
|
-
}
|
432
|
-
var properties = {};
|
433
|
-
var allPresent = true;
|
434
|
-
for (var j=0; j<siblings.length; j++) {
|
435
|
-
var sibling = siblings[j];
|
436
|
-
var aSibling = camelize(sibling);
|
437
|
-
if (style[aSibling] === "") {
|
438
|
-
// console.warn(sibling);
|
439
|
-
if (CSS[sibling].length) {
|
440
|
-
for (var i=0; i<CSS[sibling].length; i++) {
|
441
|
-
if (style[camelize(CSS[sibling][i])] === "") {
|
442
|
-
allPresent = false;
|
443
|
-
break;
|
444
|
-
}
|
445
|
-
}
|
446
|
-
} else {
|
447
|
-
allPresent = false;
|
448
|
-
break;
|
449
|
-
}
|
450
|
-
}
|
451
|
-
}
|
452
|
-
if (allPresent) {
|
453
|
-
return closestShorthand(style, CSS[name].parent);
|
454
|
-
} else {
|
455
|
-
return name;
|
456
|
-
}
|
457
|
-
|
458
|
-
}
|
459
|
-
|
460
|
-
//console.log(cloneMinimized(document.styleSheets[0]).toString());
|
461
|
-
//console.log(CSSOM.CSSStyleSheet.prototype.toString.call(minimize(document.styleSheets[0].cssRules[0].style)));
|
462
|
-
//console.log(document.styleSheets[0].cssRules[0].style["background-image"]);
|
463
|
-
|
464
|
-
//console.log(CSS);
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
var errors = [];
|
469
|
-
//if (!Object.defineProperty) {
|
470
|
-
// errors.push("Object.defineProperty isn’t supported");
|
471
|
-
//}
|
472
|
-
if (errors.length) {
|
473
|
-
document.getElementById("message").innerHTML = errors.join("<br>");
|
474
|
-
document.body.className = "error";
|
475
|
-
throw errors.join("\n\n");
|
476
|
-
}
|
477
|
-
|
478
|
-
var style = document.getElementById("style");
|
479
|
-
var output = document.getElementById("output");
|
480
|
-
var serialized = document.getElementById("serialized");
|
481
|
-
|
482
|
-
function outputUpdated() {
|
483
|
-
var value = style.value;
|
484
|
-
if (value != style.prevValue) {
|
485
|
-
var css = CSSOM.parse(value);
|
486
|
-
output.innerHTML = JSON.stringify(css, null, 2);
|
487
|
-
serialized.innerHTML = cloneMinimized(css).toString();
|
488
|
-
style.prevValue = value;
|
489
|
-
}
|
490
|
-
}
|
491
|
-
|
492
|
-
function hashChanged() {
|
493
|
-
var hash = location.hash;
|
494
|
-
var splitted = hash.split("=");
|
495
|
-
if (splitted.length < 2) {
|
496
|
-
return;
|
497
|
-
}
|
498
|
-
var name = splitted[0];
|
499
|
-
var value = splitted[1];
|
500
|
-
if (name == "#css") {
|
501
|
-
style.value = decodeURIComponent(value);
|
502
|
-
outputUpdated();
|
503
|
-
}
|
504
|
-
}
|
505
|
-
|
506
|
-
hashChanged();
|
507
|
-
outputUpdated();
|
508
|
-
|
509
|
-
window.onhashchange = hashChanged;
|
510
|
-
style.onkeyup = style.onpaste = function changed(){
|
511
|
-
outputUpdated();
|
512
|
-
};
|
513
|
-
style.onchange = function updateLocation(){
|
514
|
-
location.hash = "css=" + encodeURIComponent(style.value);
|
515
|
-
};
|
516
|
-
</script>
|
517
|
-
</body>
|
518
|
-
</html>
|
@@ -1,31 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title></title>
|
5
|
-
<script>
|
6
|
-
var exports = {};
|
7
|
-
function require(){
|
8
|
-
return exports;
|
9
|
-
}
|
10
|
-
</script>
|
11
|
-
<script src="../lib/CSSStyleDeclaration.js"></script>
|
12
|
-
<script src="../lib/CSSRule.js"></script>
|
13
|
-
<script src="../lib/CSSStyleRule.js"></script>
|
14
|
-
<script src="../lib/CSSImportRule.js"></script>
|
15
|
-
<script src="../lib/MediaList.js"></script>
|
16
|
-
<script src="../lib/CSSMediaRule.js"></script>
|
17
|
-
<script src="../lib/StyleSheet.js"></script>
|
18
|
-
<script src="../lib/CSSStyleSheet.js"></script>
|
19
|
-
<script src="../lib/Parser.js"></script>
|
20
|
-
<script>
|
21
|
-
window.CSSOM = exports;
|
22
|
-
</script>
|
23
|
-
</head>
|
24
|
-
<body>
|
25
|
-
<script>
|
26
|
-
var parser = new CSSOM.Parser;
|
27
|
-
console.log(parser.parse("a {color: red !important; font-size: 12px}"));
|
28
|
-
console.log(parser.compile());
|
29
|
-
</script>
|
30
|
-
</body>
|
31
|
-
</html>
|
@@ -1,100 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<style type="text/css">
|
3
|
-
html, body {
|
4
|
-
background: #CCC;
|
5
|
-
font-size: 14px;
|
6
|
-
margin: 0;
|
7
|
-
height: 100%;
|
8
|
-
}
|
9
|
-
table {
|
10
|
-
width: 100%;
|
11
|
-
border-collapse: collapse;
|
12
|
-
}
|
13
|
-
td {
|
14
|
-
width: 50%;
|
15
|
-
padding: 0;
|
16
|
-
vertical-align: top;
|
17
|
-
}
|
18
|
-
#output, #style {
|
19
|
-
width: 49%;
|
20
|
-
min-height: 99%;
|
21
|
-
display: inline-block;
|
22
|
-
vertical-align: top;
|
23
|
-
}
|
24
|
-
#style {
|
25
|
-
position: absolute;
|
26
|
-
top: 0;
|
27
|
-
height: 100%;
|
28
|
-
left: 4px;
|
29
|
-
width: 49%;
|
30
|
-
background: #FFF;
|
31
|
-
border: 1px solid #999;
|
32
|
-
font: 14px monospace;
|
33
|
-
white-space: pre-wrap;
|
34
|
-
}
|
35
|
-
#output {
|
36
|
-
position: absolute;
|
37
|
-
top: 0;
|
38
|
-
min-height: 100%;
|
39
|
-
right: 0;
|
40
|
-
width: 50%;
|
41
|
-
margin: 0;
|
42
|
-
padding: 4px;
|
43
|
-
box-sizing: border-box;
|
44
|
-
-webkit-box-sizing: border-box;
|
45
|
-
background: #333;
|
46
|
-
}
|
47
|
-
|
48
|
-
.rule {
|
49
|
-
color: #8CB7D1;
|
50
|
-
}
|
51
|
-
.name {
|
52
|
-
color: #D7AA69;
|
53
|
-
}
|
54
|
-
.value {
|
55
|
-
color: #D7AA69;
|
56
|
-
}
|
57
|
-
.brace-open, .brace-close, .colon, .semicolon {
|
58
|
-
color: #625035;
|
59
|
-
}
|
60
|
-
/*@import url("test/fixtures/dummy.css") screen, handheld;*/
|
61
|
-
@media screen, all {
|
62
|
-
body {
|
63
|
-
color: black;
|
64
|
-
}
|
65
|
-
}
|
66
|
-
</style>
|
67
|
-
|
68
|
-
<textarea id="style">.rule {
|
69
|
-
display: block;
|
70
|
-
}
|
71
|
-
.properties {
|
72
|
-
display: block;
|
73
|
-
}</textarea>
|
74
|
-
<pre id="output"></pre>
|
75
|
-
|
76
|
-
|
77
|
-
<script type="text/javascript" src="lib/StyleSheet.js"></script>
|
78
|
-
<script type="text/javascript" src="lib/CSSStyleSheet.js"></script>
|
79
|
-
<script type="text/javascript" src="lib/MediaList.js"></script>
|
80
|
-
<script type="text/javascript" src="lib/CSSRule.js"></script>
|
81
|
-
<script type="text/javascript" src="lib/CSSStyleRule.js"></script>
|
82
|
-
<script type="text/javascript" src="lib/CSSMediaRule.js"></script>
|
83
|
-
<script type="text/javascript" src="lib/CSSStyleDeclaration.js"></script>
|
84
|
-
<script type="text/javascript" src="lib/parse.js"></script>
|
85
|
-
<script type="text/javascript" src="lib/parse.js"></script>
|
86
|
-
<script type="text/javascript" src="plugins/toHTML.js"></script>
|
87
|
-
<script type="text/javascript">
|
88
|
-
CSSStyleSheet.prototype.toHTML = toHTML;
|
89
|
-
window.onload = function(){
|
90
|
-
var style = document.getElementById("style");
|
91
|
-
var output = document.getElementById("output")
|
92
|
-
|
93
|
-
function outputUpdated(){
|
94
|
-
output.innerHTML = parse(style.value).toHTML();
|
95
|
-
}
|
96
|
-
|
97
|
-
style.onkeyup = outputUpdated;
|
98
|
-
outputUpdated();
|
99
|
-
}
|
100
|
-
</script>
|