node-css-parse-1.7.0+dfsg.orig/0000775000000000000000000000000012255746762014740 5ustar rootrootnode-css-parse-1.7.0+dfsg.orig/test/0000775000000000000000000000000012255746762015717 5ustar rootrootnode-css-parse-1.7.0+dfsg.orig/test/css-parse.js0000664000000000000000000000125012255746762020153 0ustar rootroot /** * Module dependencies. */ var parse = require('..') , fs = require('fs') , path = require('path') , read = fs.readFileSync , readdir = fs.readdirSync; describe('parse(str)', function(){ readdir('test/cases').forEach(function(file){ if (~file.indexOf('json')) return; file = path.basename(file, '.css'); it('should parse ' + file, function(){ var css = read(path.join('test', 'cases', file + '.css'), 'utf8'); var json = read(path.join('test', 'cases', file + '.json'), 'utf8'); var ret = parse(css, { position: true, source: file + '.css' }); ret = JSON.stringify(ret, null, 2); ret.should.equal(json); }) }); }) node-css-parse-1.7.0+dfsg.orig/test/cases/0000775000000000000000000000000012255746762017015 5ustar rootrootnode-css-parse-1.7.0+dfsg.orig/test/cases/wtf.json0000664000000000000000000000310412255746762020506 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "rule", "selectors": [ ".wtf" ], "declarations": [ { "type": "declaration", "property": "*overflow-x", "value": "hidden", "position": { "start": { "line": 2, "column": 3 }, "end": { "line": 2, "column": 22 }, "source": "wtf.css" } }, { "type": "declaration", "property": "//max-height", "value": "110px", "position": { "start": { "line": 3, "column": 3 }, "end": { "line": 3, "column": 22 }, "source": "wtf.css" } }, { "type": "declaration", "property": "#height", "value": "18px", "position": { "start": { "line": 4, "column": 3 }, "end": { "line": 4, "column": 16 }, "source": "wtf.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 5, "column": 2 }, "source": "wtf.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/wtf.css0000664000000000000000000000010712255746762020325 0ustar rootroot.wtf { *overflow-x: hidden; //max-height: 110px; #height: 18px; }node-css-parse-1.7.0+dfsg.orig/test/cases/supports.json0000664000000000000000000000501512255746762021610 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "supports", "supports": "(display: flex) or (display: box)", "rules": [ { "type": "comment", "comment": " flex above ", "position": { "start": { "line": 2, "column": 3 }, "end": { "line": 2, "column": 19 }, "source": "supports.css" } }, { "type": "rule", "selectors": [ ".flex" ], "declarations": [ { "type": "comment", "comment": " flex inside ", "position": { "start": { "line": 4, "column": 5 }, "end": { "line": 4, "column": 22 }, "source": "supports.css" } }, { "type": "declaration", "property": "display", "value": "box", "position": { "start": { "line": 5, "column": 5 }, "end": { "line": 5, "column": 17 }, "source": "supports.css" } }, { "type": "declaration", "property": "display", "value": "flex", "position": { "start": { "line": 6, "column": 5 }, "end": { "line": 6, "column": 18 }, "source": "supports.css" } } ], "position": { "start": { "line": 3, "column": 3 }, "end": { "line": 7, "column": 4 }, "source": "supports.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 8, "column": 2 }, "source": "supports.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/supports.css0000664000000000000000000000021312255746762021422 0ustar rootroot@supports (display: flex) or (display: box) { /* flex above */ .flex { /* flex inside */ display: box; display: flex; } }node-css-parse-1.7.0+dfsg.orig/test/cases/rules.json0000664000000000000000000000302512255746762021042 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "rule", "selectors": [ "tobi" ], "declarations": [ { "type": "declaration", "property": "name", "value": "'tobi'", "position": { "start": { "line": 2, "column": 3 }, "end": { "line": 2, "column": 15 }, "source": "rules.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 3, "column": 2 }, "source": "rules.css" } }, { "type": "rule", "selectors": [ "loki" ], "declarations": [ { "type": "declaration", "property": "name", "value": "'loki'", "position": { "start": { "line": 5, "column": 3 }, "end": { "line": 5, "column": 15 }, "source": "rules.css" } } ], "position": { "start": { "line": 4, "column": 1 }, "end": { "line": 6, "column": 2 }, "source": "rules.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/rules.css0000664000000000000000000000006112255746762020656 0ustar rootroottobi { name: 'tobi'; } loki { name: 'loki'; }node-css-parse-1.7.0+dfsg.orig/test/cases/rule.json0000664000000000000000000000145012255746762020657 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "rule", "selectors": [ "foo" ], "declarations": [ { "type": "declaration", "property": "bar", "value": "'baz'", "position": { "start": { "line": 2, "column": 3 }, "end": { "line": 2, "column": 13 }, "source": "rule.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 3, "column": 2 }, "source": "rule.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/rule.css0000664000000000000000000000002512255746762020473 0ustar rootrootfoo { bar: 'baz'; }node-css-parse-1.7.0+dfsg.orig/test/cases/quoted.json0000664000000000000000000000152712255746762021216 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "rule", "selectors": [ "body" ], "declarations": [ { "type": "declaration", "property": "background", "value": "url('some;stuff;here') 50% 50% no-repeat", "position": { "start": { "line": 2, "column": 3 }, "end": { "line": 2, "column": 55 }, "source": "quoted.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 3, "column": 2 }, "source": "quoted.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/quoted.css0000664000000000000000000000010012255746762021017 0ustar rootrootbody { background: url('some;stuff;here') 50% 50% no-repeat; }node-css-parse-1.7.0+dfsg.orig/test/cases/props.json0000664000000000000000000000313412255746762021054 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "rule", "selectors": [ "tobi loki jane" ], "declarations": [ { "type": "declaration", "property": "are", "value": "'all'", "position": { "start": { "line": 3, "column": 3 }, "end": { "line": 3, "column": 13 }, "source": "props.css" } }, { "type": "declaration", "property": "the-species", "value": "called \"ferrets\"", "position": { "start": { "line": 4, "column": 3 }, "end": { "line": 4, "column": 32 }, "source": "props.css" } }, { "type": "declaration", "property": "*even", "value": "'ie crap'", "position": { "start": { "line": 5, "column": 3 }, "end": { "line": 5, "column": 19 }, "source": "props.css" } } ], "position": { "start": { "line": 2, "column": 1 }, "end": { "line": 6, "column": 2 }, "source": "props.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/props.css0000664000000000000000000000012712255746762020672 0ustar rootroot tobi loki jane { are: 'all'; the-species: called "ferrets"; *even: 'ie crap'; } node-css-parse-1.7.0+dfsg.orig/test/cases/paged-media.json0000664000000000000000000000432512255746762022051 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "comment", "comment": " toc above ", "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 16 }, "source": "paged-media.css" } }, { "type": "page", "selectors": [ "toc", "index:blank" ], "declarations": [ { "type": "comment", "comment": " toc inside ", "position": { "start": { "line": 3, "column": 3 }, "end": { "line": 3, "column": 19 }, "source": "paged-media.css" } }, { "type": "declaration", "property": "color", "value": "green", "position": { "start": { "line": 4, "column": 3 }, "end": { "line": 4, "column": 15 }, "source": "paged-media.css" } } ], "position": { "start": { "line": 2, "column": 1 }, "end": { "line": 5, "column": 2 }, "source": "paged-media.css" } }, { "type": "page", "selectors": [], "declarations": [ { "type": "declaration", "property": "font-size", "value": "16pt", "position": { "start": { "line": 8, "column": 3 }, "end": { "line": 8, "column": 18 }, "source": "paged-media.css" } } ], "position": { "start": { "line": 7, "column": 1 }, "end": { "line": 9, "column": 2 }, "source": "paged-media.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/paged-media.css0000664000000000000000000000015412255746762021664 0ustar rootroot/* toc above */ @page toc, index:blank { /* toc inside */ color: green; } @page { font-size: 16pt; } node-css-parse-1.7.0+dfsg.orig/test/cases/no-semi.json0000664000000000000000000000232512255746762021261 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "rule", "selectors": [ "tobi loki jane" ], "declarations": [ { "type": "declaration", "property": "are", "value": "'all'", "position": { "start": { "line": 3, "column": 3 }, "end": { "line": 3, "column": 13 }, "source": "no-semi.css" } }, { "type": "declaration", "property": "the-species", "value": "called \"ferrets\"", "position": { "start": { "line": 4, "column": 3 }, "end": { "line": 5, "column": 1 }, "source": "no-semi.css" } } ], "position": { "start": { "line": 2, "column": 1 }, "end": { "line": 5, "column": 2 }, "source": "no-semi.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/no-semi.css0000664000000000000000000000010212255746762021067 0ustar rootroot tobi loki jane { are: 'all'; the-species: called "ferrets" } node-css-parse-1.7.0+dfsg.orig/test/cases/namespace.json0000664000000000000000000000133712255746762021650 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "namespace", "namespace": "\"http://www.w3.org/1999/xhtml\"", "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 43 }, "source": "namespace.css" } }, { "type": "namespace", "namespace": "svg \"http://www.w3.org/2000/svg\"", "position": { "start": { "line": 2, "column": 1 }, "end": { "line": 2, "column": 45 }, "source": "namespace.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/namespace.css0000664000000000000000000000012712255746762021463 0ustar rootroot@namespace "http://www.w3.org/1999/xhtml"; @namespace svg "http://www.w3.org/2000/svg";node-css-parse-1.7.0+dfsg.orig/test/cases/messed-up.json0000664000000000000000000000603712255746762021620 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "rule", "selectors": [ "body" ], "declarations": [ { "type": "declaration", "property": "foo", "value": "'bar'", "position": { "start": { "line": 1, "column": 8 }, "end": { "line": 3, "column": 9 }, "source": "messed-up.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 3, "column": 10 }, "source": "messed-up.css" } }, { "type": "rule", "selectors": [ "body" ], "declarations": [ { "type": "declaration", "property": "foo", "value": "bar", "position": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 16 }, "source": "messed-up.css" } }, { "type": "declaration", "property": "bar", "value": "baz", "position": { "start": { "line": 5, "column": 17 }, "end": { "line": 5, "column": 24 }, "source": "messed-up.css" } } ], "position": { "start": { "line": 5, "column": 4 }, "end": { "line": 5, "column": 25 }, "source": "messed-up.css" } }, { "type": "rule", "selectors": [ "body" ], "declarations": [ { "type": "declaration", "property": "foo", "value": "bar", "position": { "start": { "line": 8, "column": 6 }, "end": { "line": 11, "column": 6 }, "source": "messed-up.css" } }, { "type": "declaration", "property": "bar", "value": "baz", "position": { "start": { "line": 12, "column": 6 }, "end": { "line": 15, "column": 6 }, "source": "messed-up.css" } } ], "position": { "start": { "line": 6, "column": 4 }, "end": { "line": 15, "column": 7 }, "source": "messed-up.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/messed-up.css0000664000000000000000000000017712255746762021436 0ustar rootrootbody { foo : 'bar' } body{foo:bar;bar:baz} body { foo : bar ; bar : baz }node-css-parse-1.7.0+dfsg.orig/test/cases/media.messed.json0000664000000000000000000001413512255746762022252 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "media", "media": "screen, projection", "rules": [ { "type": "rule", "selectors": [ "html" ], "declarations": [ { "type": "declaration", "property": "background", "value": "#fffef0", "position": { "start": { "line": 4, "column": 1 }, "end": { "line": 4, "column": 20 }, "source": "media.messed.css" } }, { "type": "declaration", "property": "color", "value": "#300", "position": { "start": { "line": 5, "column": 5 }, "end": { "line": 5, "column": 15 }, "source": "media.messed.css" } } ], "position": { "start": { "line": 1, "column": 28 }, "end": { "line": 6, "column": 4 }, "source": "media.messed.css" } }, { "type": "rule", "selectors": [ "body" ], "declarations": [ { "type": "declaration", "property": "max-width", "value": "35em", "position": { "start": { "line": 10, "column": 5 }, "end": { "line": 10, "column": 20 }, "source": "media.messed.css" } }, { "type": "declaration", "property": "margin", "value": "0 auto", "position": { "start": { "line": 11, "column": 5 }, "end": { "line": 11, "column": 19 }, "source": "media.messed.css" } } ], "position": { "start": { "line": 7, "column": 3 }, "end": { "line": 14, "column": 2 }, "source": "media.messed.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 15, "column": 4 }, "source": "media.messed.css" } }, { "type": "media", "media": "print", "rules": [ { "type": "rule", "selectors": [ "html" ], "declarations": [ { "type": "declaration", "property": "background", "value": "#fff", "position": { "start": { "line": 20, "column": 15 }, "end": { "line": 20, "column": 31 }, "source": "media.messed.css" } }, { "type": "declaration", "property": "color", "value": "#000", "position": { "start": { "line": 21, "column": 15 }, "end": { "line": 21, "column": 26 }, "source": "media.messed.css" } } ], "position": { "start": { "line": 19, "column": 15 }, "end": { "line": 22, "column": 16 }, "source": "media.messed.css" } }, { "type": "rule", "selectors": [ "body" ], "declarations": [ { "type": "declaration", "property": "padding", "value": "1in", "position": { "start": { "line": 24, "column": 15 }, "end": { "line": 24, "column": 27 }, "source": "media.messed.css" } }, { "type": "declaration", "property": "border", "value": "0.5pt solid #666", "position": { "start": { "line": 25, "column": 15 }, "end": { "line": 25, "column": 39 }, "source": "media.messed.css" } } ], "position": { "start": { "line": 23, "column": 15 }, "end": { "line": 26, "column": 16 }, "source": "media.messed.css" } } ], "position": { "start": { "line": 17, "column": 1 }, "end": { "line": 27, "column": 2 }, "source": "media.messed.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/media.messed.css0000664000000000000000000000054512255746762022071 0ustar rootroot@media screen, projection{ html { background: #fffef0; color:#300; } body { max-width: 35em; margin: 0 auto; } } @media print { html { background: #fff; color: #000; } body { padding: 1in; border: 0.5pt solid #666; } }node-css-parse-1.7.0+dfsg.orig/test/cases/media.json0000664000000000000000000001703712255746762020777 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "media", "media": "screen, projection", "rules": [ { "type": "comment", "comment": " html above ", "position": { "start": { "line": 2, "column": 3 }, "end": { "line": 2, "column": 19 }, "source": "media.css" } }, { "type": "rule", "selectors": [ "html" ], "declarations": [ { "type": "comment", "comment": " html inside ", "position": { "start": { "line": 4, "column": 5 }, "end": { "line": 4, "column": 22 }, "source": "media.css" } }, { "type": "declaration", "property": "background", "value": "#fffef0", "position": { "start": { "line": 5, "column": 5 }, "end": { "line": 5, "column": 24 }, "source": "media.css" } }, { "type": "declaration", "property": "color", "value": "#300", "position": { "start": { "line": 6, "column": 5 }, "end": { "line": 6, "column": 16 }, "source": "media.css" } } ], "position": { "start": { "line": 3, "column": 3 }, "end": { "line": 7, "column": 4 }, "source": "media.css" } }, { "type": "comment", "comment": " body above ", "position": { "start": { "line": 9, "column": 3 }, "end": { "line": 9, "column": 19 }, "source": "media.css" } }, { "type": "rule", "selectors": [ "body" ], "declarations": [ { "type": "comment", "comment": " body inside ", "position": { "start": { "line": 11, "column": 5 }, "end": { "line": 11, "column": 22 }, "source": "media.css" } }, { "type": "declaration", "property": "max-width", "value": "35em", "position": { "start": { "line": 12, "column": 5 }, "end": { "line": 12, "column": 20 }, "source": "media.css" } }, { "type": "declaration", "property": "margin", "value": "0 auto", "position": { "start": { "line": 13, "column": 5 }, "end": { "line": 13, "column": 19 }, "source": "media.css" } } ], "position": { "start": { "line": 10, "column": 3 }, "end": { "line": 14, "column": 4 }, "source": "media.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 15, "column": 2 }, "source": "media.css" } }, { "type": "media", "media": "print", "rules": [ { "type": "rule", "selectors": [ "html" ], "declarations": [ { "type": "declaration", "property": "background", "value": "#fff", "position": { "start": { "line": 19, "column": 5 }, "end": { "line": 19, "column": 21 }, "source": "media.css" } }, { "type": "declaration", "property": "color", "value": "#000", "position": { "start": { "line": 20, "column": 5 }, "end": { "line": 20, "column": 16 }, "source": "media.css" } } ], "position": { "start": { "line": 18, "column": 3 }, "end": { "line": 21, "column": 4 }, "source": "media.css" } }, { "type": "rule", "selectors": [ "body" ], "declarations": [ { "type": "declaration", "property": "padding", "value": "1in", "position": { "start": { "line": 23, "column": 5 }, "end": { "line": 23, "column": 17 }, "source": "media.css" } }, { "type": "declaration", "property": "border", "value": "0.5pt solid #666", "position": { "start": { "line": 24, "column": 5 }, "end": { "line": 24, "column": 29 }, "source": "media.css" } } ], "position": { "start": { "line": 22, "column": 3 }, "end": { "line": 25, "column": 4 }, "source": "media.css" } } ], "position": { "start": { "line": 17, "column": 1 }, "end": { "line": 26, "column": 2 }, "source": "media.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/media.css0000664000000000000000000000054012255746762020605 0ustar rootroot@media screen, projection { /* html above */ html { /* html inside */ background: #fffef0; color: #300; } /* body above */ body { /* body inside */ max-width: 35em; margin: 0 auto; } } @media print { html { background: #fff; color: #000; } body { padding: 1in; border: 0.5pt solid #666; } }node-css-parse-1.7.0+dfsg.orig/test/cases/keyframes.vendor.json0000664000000000000000000000431012255746762023170 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "keyframes", "name": "fade", "vendor": "-webkit-", "keyframes": [ { "type": "keyframe", "values": [ "from" ], "declarations": [ { "type": "declaration", "property": "opacity", "value": "0", "position": { "start": { "line": 2, "column": 10 }, "end": { "line": 2, "column": 21 }, "source": "keyframes.vendor.css" } } ], "position": { "start": { "line": 2, "column": 3 }, "end": { "line": 2, "column": 22 }, "source": "keyframes.vendor.css" } }, { "type": "keyframe", "values": [ "to" ], "declarations": [ { "type": "declaration", "property": "opacity", "value": "1", "position": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 19 }, "source": "keyframes.vendor.css" } } ], "position": { "start": { "line": 3, "column": 3 }, "end": { "line": 3, "column": 20 }, "source": "keyframes.vendor.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 4, "column": 2 }, "source": "keyframes.vendor.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/keyframes.vendor.css0000664000000000000000000000010512255746762023005 0ustar rootroot@-webkit-keyframes fade { from { opacity: 0 } to { opacity: 1 } }node-css-parse-1.7.0+dfsg.orig/test/cases/keyframes.messed.json0000664000000000000000000000425212255746762023160 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "keyframes", "name": "fade", "keyframes": [ { "type": "keyframe", "values": [ "from" ], "declarations": [ { "type": "declaration", "property": "opacity", "value": "0", "position": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 14 }, "source": "keyframes.messed.css" } } ], "position": { "start": { "line": 1, "column": 18 }, "end": { "line": 3, "column": 7 }, "source": "keyframes.messed.css" } }, { "type": "keyframe", "values": [ "to" ], "declarations": [ { "type": "declaration", "property": "opacity", "value": "1", "position": { "start": { "line": 6, "column": 6 }, "end": { "line": 6, "column": 16 }, "source": "keyframes.messed.css" } } ], "position": { "start": { "line": 4, "column": 1 }, "end": { "line": 6, "column": 18 }, "source": "keyframes.messed.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 6, "column": 19 }, "source": "keyframes.messed.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/keyframes.messed.css0000664000000000000000000000010512255746762022770 0ustar rootroot@keyframes fade {from {opacity: 0; } to { opacity: 1;}}node-css-parse-1.7.0+dfsg.orig/test/cases/keyframes.json0000664000000000000000000000730012255746762021676 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "keyframes", "name": "fade", "keyframes": [ { "type": "comment", "comment": " from above ", "position": { "start": { "line": 2, "column": 3 }, "end": { "line": 2, "column": 19 }, "source": "keyframes.css" } }, { "type": "keyframe", "values": [ "from" ], "declarations": [ { "type": "comment", "comment": " from inside ", "position": { "start": { "line": 4, "column": 5 }, "end": { "line": 4, "column": 22 }, "source": "keyframes.css" } }, { "type": "declaration", "property": "opacity", "value": "0", "position": { "start": { "line": 5, "column": 5 }, "end": { "line": 5, "column": 15 }, "source": "keyframes.css" } } ], "position": { "start": { "line": 3, "column": 3 }, "end": { "line": 6, "column": 4 }, "source": "keyframes.css" } }, { "type": "comment", "comment": " to above ", "position": { "start": { "line": 8, "column": 3 }, "end": { "line": 8, "column": 17 }, "source": "keyframes.css" } }, { "type": "keyframe", "values": [ "to" ], "declarations": [ { "type": "comment", "comment": " to inside ", "position": { "start": { "line": 10, "column": 5 }, "end": { "line": 10, "column": 20 }, "source": "keyframes.css" } }, { "type": "declaration", "property": "opacity", "value": "1", "position": { "start": { "line": 11, "column": 5 }, "end": { "line": 11, "column": 15 }, "source": "keyframes.css" } } ], "position": { "start": { "line": 9, "column": 3 }, "end": { "line": 12, "column": 4 }, "source": "keyframes.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 13, "column": 2 }, "source": "keyframes.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/keyframes.css0000664000000000000000000000023212255746762021512 0ustar rootroot@keyframes fade { /* from above */ from { /* from inside */ opacity: 0; } /* to above */ to { /* to inside */ opacity: 1; } }node-css-parse-1.7.0+dfsg.orig/test/cases/keyframes.complex.json0000664000000000000000000001162212255746762023346 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "keyframes", "name": "foo", "keyframes": [ { "type": "keyframe", "values": [ "0%" ], "declarations": [ { "type": "declaration", "property": "top", "value": "0", "position": { "start": { "line": 2, "column": 8 }, "end": { "line": 2, "column": 14 }, "source": "keyframes.complex.css" } }, { "type": "declaration", "property": "left", "value": "0", "position": { "start": { "line": 2, "column": 16 }, "end": { "line": 2, "column": 24 }, "source": "keyframes.complex.css" } } ], "position": { "start": { "line": 2, "column": 3 }, "end": { "line": 2, "column": 25 }, "source": "keyframes.complex.css" } }, { "type": "keyframe", "values": [ "30.50%" ], "declarations": [ { "type": "declaration", "property": "top", "value": "50px", "position": { "start": { "line": 3, "column": 12 }, "end": { "line": 3, "column": 22 }, "source": "keyframes.complex.css" } } ], "position": { "start": { "line": 3, "column": 3 }, "end": { "line": 3, "column": 23 }, "source": "keyframes.complex.css" } }, { "type": "keyframe", "values": [ ".68%", "72%", "85%" ], "declarations": [ { "type": "declaration", "property": "left", "value": "50px", "position": { "start": { "line": 6, "column": 15 }, "end": { "line": 6, "column": 26 }, "source": "keyframes.complex.css" } } ], "position": { "start": { "line": 4, "column": 3 }, "end": { "line": 6, "column": 27 }, "source": "keyframes.complex.css" } }, { "type": "keyframe", "values": [ "100%" ], "declarations": [ { "type": "declaration", "property": "top", "value": "100px", "position": { "start": { "line": 7, "column": 10 }, "end": { "line": 7, "column": 20 }, "source": "keyframes.complex.css" } }, { "type": "declaration", "property": "left", "value": "100%", "position": { "start": { "line": 7, "column": 22 }, "end": { "line": 7, "column": 33 }, "source": "keyframes.complex.css" } } ], "position": { "start": { "line": 7, "column": 3 }, "end": { "line": 7, "column": 34 }, "source": "keyframes.complex.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 8, "column": 2 }, "source": "keyframes.complex.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/keyframes.complex.css0000664000000000000000000000021612255746762023162 0ustar rootroot@keyframes foo { 0% { top: 0; left: 0 } 30.50% { top: 50px } .68% , 72% , 85% { left: 50px } 100% { top: 100px; left: 100% } }node-css-parse-1.7.0+dfsg.orig/test/cases/keyframes.advanced.json0000664000000000000000000000612112255746762023442 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "keyframes", "name": "advanced", "keyframes": [ { "type": "keyframe", "values": [ "top" ], "declarations": [ { "type": "declaration", "property": "opacity[sqrt]", "value": "0", "position": { "start": { "line": 3, "column": 5 }, "end": { "line": 3, "column": 21 }, "source": "keyframes.advanced.css" } } ], "position": { "start": { "line": 2, "column": 3 }, "end": { "line": 4, "column": 4 }, "source": "keyframes.advanced.css" } }, { "type": "keyframe", "values": [ "100" ], "declarations": [ { "type": "declaration", "property": "opacity", "value": "0.5", "position": { "start": { "line": 7, "column": 5 }, "end": { "line": 7, "column": 17 }, "source": "keyframes.advanced.css" } } ], "position": { "start": { "line": 6, "column": 3 }, "end": { "line": 8, "column": 4 }, "source": "keyframes.advanced.css" } }, { "type": "keyframe", "values": [ "bottom" ], "declarations": [ { "type": "declaration", "property": "opacity", "value": "1", "position": { "start": { "line": 11, "column": 5 }, "end": { "line": 11, "column": 15 }, "source": "keyframes.advanced.css" } } ], "position": { "start": { "line": 10, "column": 3 }, "end": { "line": 12, "column": 4 }, "source": "keyframes.advanced.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 13, "column": 2 }, "source": "keyframes.advanced.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/keyframes.advanced.css0000664000000000000000000000017112255746762023260 0ustar rootroot@keyframes advanced { top { opacity[sqrt]: 0; } 100 { opacity: 0.5; } bottom { opacity: 1; } } node-css-parse-1.7.0+dfsg.orig/test/cases/invalid.json0000664000000000000000000000010112255746762021326 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [] } }node-css-parse-1.7.0+dfsg.orig/test/cases/invalid.css0000664000000000000000000000002612255746762021153 0ustar rootroot{ asdfasdfasdfasdnode-css-parse-1.7.0+dfsg.orig/test/cases/import.messed.json0000664000000000000000000000327112255746762022504 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "import", "import": "url(\"fineprint.css\") print", "position": { "start": { "line": 2, "column": 4 }, "end": { "line": 2, "column": 39 }, "source": "import.messed.css" } }, { "type": "import", "import": "url(\"bluish.css\") projection, tv", "position": { "start": { "line": 3, "column": 3 }, "end": { "line": 3, "column": 44 }, "source": "import.messed.css" } }, { "type": "import", "import": "'custom.css'", "position": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 28 }, "source": "import.messed.css" } }, { "type": "import", "import": "\"common.css\" screen, projection", "position": { "start": { "line": 5, "column": 3 }, "end": { "line": 5, "column": 45 }, "source": "import.messed.css" } }, { "type": "import", "import": "url('landscape.css') screen and (orientation:landscape)", "position": { "start": { "line": 7, "column": 3 }, "end": { "line": 7, "column": 67 }, "source": "import.messed.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/import.messed.css0000664000000000000000000000034112255746762022316 0ustar rootroot @import url("fineprint.css") print; @import url("bluish.css") projection, tv; @import 'custom.css'; @import "common.css" screen, projection ; @import url('landscape.css') screen and (orientation:landscape); node-css-parse-1.7.0+dfsg.orig/test/cases/import.json0000664000000000000000000000322612255746762021225 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "import", "import": "url(\"fineprint.css\") print", "position": { "start": { "line": 2, "column": 1 }, "end": { "line": 2, "column": 36 }, "source": "import.css" } }, { "type": "import", "import": "url(\"bluish.css\") projection, tv", "position": { "start": { "line": 3, "column": 1 }, "end": { "line": 3, "column": 42 }, "source": "import.css" } }, { "type": "import", "import": "'custom.css'", "position": { "start": { "line": 4, "column": 1 }, "end": { "line": 4, "column": 22 }, "source": "import.css" } }, { "type": "import", "import": "\"common.css\" screen, projection", "position": { "start": { "line": 5, "column": 1 }, "end": { "line": 5, "column": 41 }, "source": "import.css" } }, { "type": "import", "import": "url('landscape.css') screen and (orientation:landscape)", "position": { "start": { "line": 6, "column": 1 }, "end": { "line": 6, "column": 65 }, "source": "import.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/import.css0000664000000000000000000000031712255746762021042 0ustar rootroot @import url("fineprint.css") print; @import url("bluish.css") projection, tv; @import 'custom.css'; @import "common.css" screen, projection; @import url('landscape.css') screen and (orientation:landscape); node-css-parse-1.7.0+dfsg.orig/test/cases/host.json0000664000000000000000000000234012255746762020664 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "host", "rules": [ { "type": "rule", "selectors": [ ":scope" ], "declarations": [ { "type": "declaration", "property": "display", "value": "block", "position": { "start": { "line": 3, "column": 5 }, "end": { "line": 3, "column": 19 }, "source": "host.css" } } ], "position": { "start": { "line": 2, "column": 3 }, "end": { "line": 4, "column": 4 }, "source": "host.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 5, "column": 2 }, "source": "host.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/host.css0000664000000000000000000000005412255746762020503 0ustar rootroot@host { :scope { display: block; } }node-css-parse-1.7.0+dfsg.orig/test/cases/escapes.json0000664000000000000000000010250012255746762021331 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "comment", "comment": " tests compressed for easy testing ", "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 40 }, "source": "escapes.css" } }, { "type": "comment", "comment": " http://mathiasbynens.be/notes/css-escapes ", "position": { "start": { "line": 2, "column": 1 }, "end": { "line": 2, "column": 48 }, "source": "escapes.css" } }, { "type": "comment", "comment": " will match elements with class=\":`(\" ", "position": { "start": { "line": 3, "column": 1 }, "end": { "line": 3, "column": 43 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ ".\\3A \\`\\(" ], "declarations": [], "position": { "start": { "line": 4, "column": 1 }, "end": { "line": 4, "column": 12 }, "source": "escapes.css" } }, { "type": "comment", "comment": " will match elements with class=\"1a2b3c\" ", "position": { "start": { "line": 5, "column": 1 }, "end": { "line": 5, "column": 46 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ ".\\31 a2b3c" ], "declarations": [], "position": { "start": { "line": 6, "column": 1 }, "end": { "line": 6, "column": 13 }, "source": "escapes.css" } }, { "type": "comment", "comment": " will match the element with id=\"#fake-id\" ", "position": { "start": { "line": 7, "column": 1 }, "end": { "line": 7, "column": 48 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\#fake-id" ], "declarations": [], "position": { "start": { "line": 8, "column": 1 }, "end": { "line": 8, "column": 13 }, "source": "escapes.css" } }, { "type": "comment", "comment": " will match the element with id=\"---\" ", "position": { "start": { "line": 9, "column": 1 }, "end": { "line": 9, "column": 43 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\---" ], "declarations": [], "position": { "start": { "line": 10, "column": 1 }, "end": { "line": 10, "column": 8 }, "source": "escapes.css" } }, { "type": "comment", "comment": " will match the element with id=\"-a-b-c-\" ", "position": { "start": { "line": 11, "column": 1 }, "end": { "line": 11, "column": 47 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#-a-b-c-" ], "declarations": [], "position": { "start": { "line": 12, "column": 1 }, "end": { "line": 12, "column": 11 }, "source": "escapes.css" } }, { "type": "comment", "comment": " will match the element with id=\"©\" ", "position": { "start": { "line": 13, "column": 1 }, "end": { "line": 13, "column": 41 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#©" ], "declarations": [], "position": { "start": { "line": 14, "column": 1 }, "end": { "line": 14, "column": 5 }, "source": "escapes.css" } }, { "type": "comment", "comment": " More tests from http://mathiasbynens.be/demo/html5-id ", "position": { "start": { "line": 15, "column": 1 }, "end": { "line": 15, "column": 60 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "html" ], "declarations": [ { "type": "declaration", "property": "font", "value": "1.2em/1.6 Arial", "position": { "start": { "line": 16, "column": 6 }, "end": { "line": 16, "column": 26 }, "source": "escapes.css" } } ], "position": { "start": { "line": 16, "column": 1 }, "end": { "line": 16, "column": 28 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "code" ], "declarations": [ { "type": "declaration", "property": "font-family", "value": "Consolas", "position": { "start": { "line": 17, "column": 6 }, "end": { "line": 17, "column": 26 }, "source": "escapes.css" } } ], "position": { "start": { "line": 17, "column": 1 }, "end": { "line": 17, "column": 28 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "li code" ], "declarations": [ { "type": "declaration", "property": "background", "value": "rgba(255, 255, 255, .5)", "position": { "start": { "line": 18, "column": 9 }, "end": { "line": 18, "column": 43 }, "source": "escapes.css" } }, { "type": "declaration", "property": "padding", "value": ".3em", "position": { "start": { "line": 18, "column": 44 }, "end": { "line": 18, "column": 56 }, "source": "escapes.css" } } ], "position": { "start": { "line": 18, "column": 1 }, "end": { "line": 18, "column": 58 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "li" ], "declarations": [ { "type": "declaration", "property": "background", "value": "orange", "position": { "start": { "line": 19, "column": 4 }, "end": { "line": 19, "column": 21 }, "source": "escapes.css" } } ], "position": { "start": { "line": 19, "column": 1 }, "end": { "line": 19, "column": 23 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#♥" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 20, "column": 4 }, "end": { "line": 20, "column": 19 }, "source": "escapes.css" } } ], "position": { "start": { "line": 20, "column": 1 }, "end": { "line": 20, "column": 21 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#©" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 21, "column": 4 }, "end": { "line": 21, "column": 19 }, "source": "escapes.css" } } ], "position": { "start": { "line": 21, "column": 1 }, "end": { "line": 21, "column": 21 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#“‘’”" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 22, "column": 7 }, "end": { "line": 22, "column": 22 }, "source": "escapes.css" } } ], "position": { "start": { "line": 22, "column": 1 }, "end": { "line": 22, "column": 24 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#☺☃" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 23, "column": 5 }, "end": { "line": 23, "column": 20 }, "source": "escapes.css" } } ], "position": { "start": { "line": 23, "column": 1 }, "end": { "line": 23, "column": 22 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#⌘⌥" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 24, "column": 5 }, "end": { "line": 24, "column": 20 }, "source": "escapes.css" } } ], "position": { "start": { "line": 24, "column": 1 }, "end": { "line": 24, "column": 22 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#𝄞♪♩♫♬" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 25, "column": 9 }, "end": { "line": 25, "column": 24 }, "source": "escapes.css" } } ], "position": { "start": { "line": 25, "column": 1 }, "end": { "line": 25, "column": 26 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\?" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 26, "column": 5 }, "end": { "line": 26, "column": 20 }, "source": "escapes.css" } } ], "position": { "start": { "line": 26, "column": 1 }, "end": { "line": 26, "column": 22 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\@" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 27, "column": 5 }, "end": { "line": 27, "column": 20 }, "source": "escapes.css" } } ], "position": { "start": { "line": 27, "column": 1 }, "end": { "line": 27, "column": 22 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\." ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 28, "column": 5 }, "end": { "line": 28, "column": 20 }, "source": "escapes.css" } } ], "position": { "start": { "line": 28, "column": 1 }, "end": { "line": 28, "column": 22 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\3A \\)" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 29, "column": 9 }, "end": { "line": 29, "column": 24 }, "source": "escapes.css" } } ], "position": { "start": { "line": 29, "column": 1 }, "end": { "line": 29, "column": 26 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\3A \\`\\(" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 30, "column": 11 }, "end": { "line": 30, "column": 26 }, "source": "escapes.css" } } ], "position": { "start": { "line": 30, "column": 1 }, "end": { "line": 30, "column": 28 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\31 23" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 31, "column": 9 }, "end": { "line": 31, "column": 24 }, "source": "escapes.css" } } ], "position": { "start": { "line": 31, "column": 1 }, "end": { "line": 31, "column": 26 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\31 a2b3c" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 32, "column": 12 }, "end": { "line": 32, "column": 27 }, "source": "escapes.css" } } ], "position": { "start": { "line": 32, "column": 1 }, "end": { "line": 32, "column": 29 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 33, "column": 8 }, "end": { "line": 33, "column": 23 }, "source": "escapes.css" } } ], "position": { "start": { "line": 33, "column": 1 }, "end": { "line": 33, "column": 25 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\<\\>\\<\\<\\<\\>\\>\\<\\>" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 34, "column": 21 }, "end": { "line": 34, "column": 36 }, "source": "escapes.css" } } ], "position": { "start": { "line": 34, "column": 1 }, "end": { "line": 34, "column": 38 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\+\\+\\+\\+\\+\\+\\+\\+\\+\\+\\[\\>\\+\\+\\+\\+\\+\\+\\+\\>\\+\\+\\+\\+\\+\\+\\+\\+\\+\\+\\>\\+\\+\\+\\>\\+\\<\\<\\<\\<\\-\\]\\>\\+\\+\\.\\>\\+\\.\\+\\+\\+\\+\\+\\+\\+\\.\\.\\+\\+\\+\\.\\>\\+\\+\\.\\<\\<\\+\\+\\+\\+\\+\\+\\+\\+\\+\\+\\+\\+\\+\\+\\+\\.\\>\\.\\+\\+\\+\\.\\-\\-\\-\\-\\-\\-\\.\\-\\-\\-\\-\\-\\-\\-\\-\\.\\>\\+\\.\\>\\." ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 35, "column": 225 }, "end": { "line": 35, "column": 240 }, "source": "escapes.css" } } ], "position": { "start": { "line": 35, "column": 1 }, "end": { "line": 35, "column": 242 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\#" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 36, "column": 5 }, "end": { "line": 36, "column": 20 }, "source": "escapes.css" } } ], "position": { "start": { "line": 36, "column": 1 }, "end": { "line": 36, "column": 22 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\#\\#" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 37, "column": 7 }, "end": { "line": 37, "column": 22 }, "source": "escapes.css" } } ], "position": { "start": { "line": 37, "column": 1 }, "end": { "line": 37, "column": 24 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\#\\.\\#\\.\\#" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 38, "column": 13 }, "end": { "line": 38, "column": 28 }, "source": "escapes.css" } } ], "position": { "start": { "line": 38, "column": 1 }, "end": { "line": 38, "column": 30 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\_" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 39, "column": 5 }, "end": { "line": 39, "column": 20 }, "source": "escapes.css" } } ], "position": { "start": { "line": 39, "column": 1 }, "end": { "line": 39, "column": 22 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\.fake\\-class" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 40, "column": 16 }, "end": { "line": 40, "column": 31 }, "source": "escapes.css" } } ], "position": { "start": { "line": 40, "column": 1 }, "end": { "line": 40, "column": 33 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#foo\\.bar" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 41, "column": 11 }, "end": { "line": 41, "column": 26 }, "source": "escapes.css" } } ], "position": { "start": { "line": 41, "column": 1 }, "end": { "line": 41, "column": 28 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\3A hover" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 42, "column": 12 }, "end": { "line": 42, "column": 27 }, "source": "escapes.css" } } ], "position": { "start": { "line": 42, "column": 1 }, "end": { "line": 42, "column": 29 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\3A hover\\3A focus\\3A active" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 43, "column": 31 }, "end": { "line": 43, "column": 46 }, "source": "escapes.css" } } ], "position": { "start": { "line": 43, "column": 1 }, "end": { "line": 43, "column": 48 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#\\[attr\\=value\\]" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 44, "column": 18 }, "end": { "line": 44, "column": 33 }, "source": "escapes.css" } } ], "position": { "start": { "line": 44, "column": 1 }, "end": { "line": 44, "column": 35 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#f\\/o\\/o" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 45, "column": 10 }, "end": { "line": 45, "column": 25 }, "source": "escapes.css" } } ], "position": { "start": { "line": 45, "column": 1 }, "end": { "line": 45, "column": 27 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#f\\\\o\\\\o" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 46, "column": 10 }, "end": { "line": 46, "column": 25 }, "source": "escapes.css" } } ], "position": { "start": { "line": 46, "column": 1 }, "end": { "line": 46, "column": 27 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#f\\*o\\*o" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 47, "column": 10 }, "end": { "line": 47, "column": 25 }, "source": "escapes.css" } } ], "position": { "start": { "line": 47, "column": 1 }, "end": { "line": 47, "column": 27 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#f\\!o\\!o" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 48, "column": 10 }, "end": { "line": 48, "column": 25 }, "source": "escapes.css" } } ], "position": { "start": { "line": 48, "column": 1 }, "end": { "line": 48, "column": 27 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#f\\'o\\'o" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 49, "column": 10 }, "end": { "line": 49, "column": 25 }, "source": "escapes.css" } } ], "position": { "start": { "line": 49, "column": 1 }, "end": { "line": 49, "column": 27 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#f\\~o\\~o" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 50, "column": 10 }, "end": { "line": 50, "column": 25 }, "source": "escapes.css" } } ], "position": { "start": { "line": 50, "column": 1 }, "end": { "line": 50, "column": 27 }, "source": "escapes.css" } }, { "type": "rule", "selectors": [ "#f\\+o\\+o" ], "declarations": [ { "type": "declaration", "property": "background", "value": "lime", "position": { "start": { "line": 51, "column": 10 }, "end": { "line": 51, "column": 25 }, "source": "escapes.css" } } ], "position": { "start": { "line": 51, "column": 1 }, "end": { "line": 51, "column": 27 }, "source": "escapes.css" } }, { "type": "comment", "comment": " css-parse does not yet pass this test ", "position": { "start": { "line": 53, "column": 1 }, "end": { "line": 53, "column": 44 }, "source": "escapes.css" } }, { "type": "comment", "comment": "#\\{\\}{background:lime;}", "position": { "start": { "line": 54, "column": 1 }, "end": { "line": 54, "column": 28 }, "source": "escapes.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/escapes.css0000664000000000000000000000340312255746762021152 0ustar rootroot/* tests compressed for easy testing */ /* http://mathiasbynens.be/notes/css-escapes */ /* will match elements with class=":`(" */ .\3A \`\({} /* will match elements with class="1a2b3c" */ .\31 a2b3c{} /* will match the element with id="#fake-id" */ #\#fake-id{} /* will match the element with id="---" */ #\---{} /* will match the element with id="-a-b-c-" */ #-a-b-c-{} /* will match the element with id="©" */ #©{} /* More tests from http://mathiasbynens.be/demo/html5-id */ html{font:1.2em/1.6 Arial;} code{font-family:Consolas;} li code{background:rgba(255, 255, 255, .5);padding:.3em;} li{background:orange;} #♥{background:lime;} #©{background:lime;} #“‘’”{background:lime;} #☺☃{background:lime;} #⌘⌥{background:lime;} #𝄞♪♩♫♬{background:lime;} #\?{background:lime;} #\@{background:lime;} #\.{background:lime;} #\3A \){background:lime;} #\3A \`\({background:lime;} #\31 23{background:lime;} #\31 a2b3c{background:lime;} #\{background:lime;} #\<\>\<\<\<\>\>\<\>{background:lime;} #\+\+\+\+\+\+\+\+\+\+\[\>\+\+\+\+\+\+\+\>\+\+\+\+\+\+\+\+\+\+\>\+\+\+\>\+\<\<\<\<\-\]\>\+\+\.\>\+\.\+\+\+\+\+\+\+\.\.\+\+\+\.\>\+\+\.\<\<\+\+\+\+\+\+\+\+\+\+\+\+\+\+\+\.\>\.\+\+\+\.\-\-\-\-\-\-\.\-\-\-\-\-\-\-\-\.\>\+\.\>\.{background:lime;} #\#{background:lime;} #\#\#{background:lime;} #\#\.\#\.\#{background:lime;} #\_{background:lime;} #\.fake\-class{background:lime;} #foo\.bar{background:lime;} #\3A hover{background:lime;} #\3A hover\3A focus\3A active{background:lime;} #\[attr\=value\]{background:lime;} #f\/o\/o{background:lime;} #f\\o\\o{background:lime;} #f\*o\*o{background:lime;} #f\!o\!o{background:lime;} #f\'o\'o{background:lime;} #f\~o\~o{background:lime;} #f\+o\+o{background:lime;} /* css-parse does not yet pass this test */ /*#\{\}{background:lime;}*/ node-css-parse-1.7.0+dfsg.orig/test/cases/empty.json0000664000000000000000000000010112255746762021036 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [] } }node-css-parse-1.7.0+dfsg.orig/test/cases/empty.css0000664000000000000000000000000012255746762020653 0ustar rootrootnode-css-parse-1.7.0+dfsg.orig/test/cases/document.json0000664000000000000000000000413012255746762021524 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "document", "document": "url-prefix()", "vendor": "-moz-", "rules": [ { "type": "comment", "comment": " ui above ", "position": { "start": { "line": 2, "column": 3 }, "end": { "line": 2, "column": 17 }, "source": "document.css" } }, { "type": "rule", "selectors": [ ".ui-select .ui-btn select" ], "declarations": [ { "type": "comment", "comment": " ui inside ", "position": { "start": { "line": 4, "column": 5 }, "end": { "line": 4, "column": 20 }, "source": "document.css" } }, { "type": "declaration", "property": "opacity", "value": ".0001", "position": { "start": { "line": 5, "column": 5 }, "end": { "line": 6, "column": 3 }, "source": "document.css" } } ], "position": { "start": { "line": 3, "column": 3 }, "end": { "line": 6, "column": 4 }, "source": "document.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 7, "column": 2 }, "source": "document.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/document.css0000664000000000000000000000017112255746762021344 0ustar rootroot@-moz-document url-prefix() { /* ui above */ .ui-select .ui-btn select { /* ui inside */ opacity:.0001 } } node-css-parse-1.7.0+dfsg.orig/test/cases/comment.url.json0000664000000000000000000000500012255746762022146 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "comment", "comment": " http://foo.com/bar/baz.html ", "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 34 }, "source": "comment.url.css" } }, { "type": "comment", "comment": "", "position": { "start": { "line": 2, "column": 1 }, "end": { "line": 2, "column": 5 }, "source": "comment.url.css" } }, { "type": "rule", "selectors": [ "foo" ], "declarations": [ { "type": "comment", "comment": "/", "position": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 12 }, "source": "comment.url.css" } }, { "type": "comment", "comment": " something ", "position": { "start": { "line": 5, "column": 3 }, "end": { "line": 5, "column": 18 }, "source": "comment.url.css" } }, { "type": "declaration", "property": "bar", "value": "baz", "position": { "start": { "line": 6, "column": 3 }, "end": { "line": 6, "column": 11 }, "source": "comment.url.css" } }, { "type": "comment", "comment": " http://foo.com/bar/baz.html ", "position": { "start": { "line": 6, "column": 13 }, "end": { "line": 6, "column": 46 }, "source": "comment.url.css" } } ], "position": { "start": { "line": 4, "column": 1 }, "end": { "line": 7, "column": 2 }, "source": "comment.url.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/comment.url.css0000664000000000000000000000016612255746762021775 0ustar rootroot/* http://foo.com/bar/baz.html */ /**/ foo { /*/*/ /* something */ bar: baz; /* http://foo.com/bar/baz.html */ } node-css-parse-1.7.0+dfsg.orig/test/cases/comment.json0000664000000000000000000000607012255746762021355 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "comment", "comment": " 1 ", "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 8 }, "source": "comment.css" } }, { "type": "rule", "selectors": [ "body" ], "declarations": [ { "type": "comment", "comment": " 2 ", "position": { "start": { "line": 3, "column": 8 }, "end": { "line": 3, "column": 15 }, "source": "comment.css" } }, { "type": "comment", "comment": " 3 ", "position": { "start": { "line": 4, "column": 3 }, "end": { "line": 4, "column": 10 }, "source": "comment.css" } }, { "type": "comment", "comment": "", "position": { "start": { "line": 5, "column": 3 }, "end": { "line": 5, "column": 7 }, "source": "comment.css" } }, { "type": "declaration", "property": "foo", "value": "'bar'", "position": { "start": { "line": 5, "column": 7 }, "end": { "line": 5, "column": 17 }, "source": "comment.css" } }, { "type": "comment", "comment": " 4 ", "position": { "start": { "line": 6, "column": 3 }, "end": { "line": 6, "column": 10 }, "source": "comment.css" } } ], "position": { "start": { "line": 3, "column": 1 }, "end": { "line": 7, "column": 2 }, "source": "comment.css" } }, { "type": "comment", "comment": " 5 ", "position": { "start": { "line": 7, "column": 3 }, "end": { "line": 7, "column": 10 }, "source": "comment.css" } }, { "type": "comment", "comment": " 6 ", "position": { "start": { "line": 9, "column": 1 }, "end": { "line": 9, "column": 8 }, "source": "comment.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/comment.css0000664000000000000000000000012212255746762021164 0ustar rootroot/* 1 */ body { /* 2 */ /* 3 */ /**/foo: 'bar'; /* 4 */ } /* 5 */ /* 6 */ node-css-parse-1.7.0+dfsg.orig/test/cases/colon-space.json0000664000000000000000000000230212255746762022110 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "rule", "selectors": [ "a" ], "declarations": [ { "type": "declaration", "property": "margin", "value": "auto", "position": { "start": { "line": 2, "column": 5 }, "end": { "line": 2, "column": 19 }, "source": "colon-space.css" } }, { "type": "declaration", "property": "padding", "value": "0", "position": { "start": { "line": 3, "column": 5 }, "end": { "line": 3, "column": 16 }, "source": "colon-space.css" } } ], "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 4, "column": 2 }, "source": "colon-space.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/colon-space.css0000664000000000000000000000005212255746762021727 0ustar rootroota { margin : auto; padding : 0; }node-css-parse-1.7.0+dfsg.orig/test/cases/charset.json0000664000000000000000000000261012255746762021340 0ustar rootroot{ "type": "stylesheet", "stylesheet": { "rules": [ { "type": "charset", "charset": "\"UTF-8\"", "position": { "start": { "line": 1, "column": 1 }, "end": { "line": 1, "column": 18 }, "source": "charset.css" } }, { "type": "comment", "comment": " Set the encoding of the style sheet to Unicode UTF-8", "position": { "start": { "line": 1, "column": 25 }, "end": { "line": 1, "column": 82 }, "source": "charset.css" } }, { "type": "charset", "charset": "'iso-8859-15'", "position": { "start": { "line": 2, "column": 1 }, "end": { "line": 2, "column": 24 }, "source": "charset.css" } }, { "type": "comment", "comment": " Set the encoding of the style sheet to Latin-9 (Western European languages, with euro sign) ", "position": { "start": { "line": 2, "column": 25 }, "end": { "line": 2, "column": 122 }, "source": "charset.css" } } ] } }node-css-parse-1.7.0+dfsg.orig/test/cases/charset.css0000664000000000000000000000031412255746762021156 0ustar rootroot@charset "UTF-8"; /* Set the encoding of the style sheet to Unicode UTF-8*/ @charset 'iso-8859-15'; /* Set the encoding of the style sheet to Latin-9 (Western European languages, with euro sign) */ node-css-parse-1.7.0+dfsg.orig/package.json0000664000000000000000000000101012255746762017216 0ustar rootroot{ "name": "css-parse", "version": "1.7.0", "description": "CSS parser", "keywords": [ "css", "parser", "stylesheet" ], "author": "TJ Holowaychuk ", "license": "MIT", "devDependencies": { "mocha": "*", "should": "*", "matcha": "~0.4.0", "bytes": "~0.2.1" }, "main": "index", "repository": { "type": "git", "url": "https://github.com/visionmedia/css-parse.git" }, "scripts": { "test": "make test" }, "files": [ "index.js" ] } node-css-parse-1.7.0+dfsg.orig/index.js0000664000000000000000000002010612255746762016404 0ustar rootroot module.exports = function(css, options){ options = options || {}; /** * Positional. */ var lineno = 1; var column = 1; /** * Update lineno and column based on `str`. */ function updatePosition(str) { var lines = str.match(/\n/g); if (lines) lineno += lines.length; var i = str.lastIndexOf('\n'); column = ~i ? str.length - i : column + str.length; } /** * Mark position and patch `node.position`. */ function position() { var start = { line: lineno, column: column }; if (!options.position) return positionNoop; return function(node){ node.position = { start: start, end: { line: lineno, column: column }, source: options.source }; whitespace(); return node; } } /** * Return `node`. */ function positionNoop(node) { whitespace(); return node; } /** * Error `msg`. */ function error(msg) { var err = new Error(msg + ' near line ' + lineno + ':' + column); err.filename = options.source; err.line = lineno; err.column = column; err.source = css; throw err; } /** * Parse stylesheet. */ function stylesheet() { return { type: 'stylesheet', stylesheet: { rules: rules() } }; } /** * Opening brace. */ function open() { return match(/^{\s*/); } /** * Closing brace. */ function close() { return match(/^}/); } /** * Parse ruleset. */ function rules() { var node; var rules = []; whitespace(); comments(rules); while (css.charAt(0) != '}' && (node = atrule() || rule())) { rules.push(node); comments(rules); } return rules; } /** * Match `re` and return captures. */ function match(re) { var m = re.exec(css); if (!m) return; var str = m[0]; updatePosition(str); css = css.slice(str.length); return m; } /** * Parse whitespace. */ function whitespace() { match(/^\s*/); } /** * Parse comments; */ function comments(rules) { var c; rules = rules || []; while (c = comment()) rules.push(c); return rules; } /** * Parse comment. */ function comment() { var pos = position(); if ('/' != css.charAt(0) || '*' != css.charAt(1)) return; var i = 2; while (null != css.charAt(i) && ('*' != css.charAt(i) || '/' != css.charAt(i + 1))) ++i; i += 2; var str = css.slice(2, i - 2); column += 2; updatePosition(str); css = css.slice(i); column += 2; return pos({ type: 'comment', comment: str }); } /** * Parse selector. */ function selector() { var m = match(/^([^{]+)/); if (!m) return; return trim(m[0]).split(/\s*,\s*/); } /** * Parse declaration. */ function declaration() { var pos = position(); // prop var prop = match(/^(\*?[-#\/\*\w]+(\[[0-9a-z_-]+\])?)\s*/); if (!prop) return; prop = trim(prop[0]); // : if (!match(/^:\s*/)) return error("property missing ':'"); // val var val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/); if (!val) return error('property missing value'); var ret = pos({ type: 'declaration', property: prop, value: trim(val[0]) }); // ; match(/^[;\s]*/); return ret; } /** * Parse declarations. */ function declarations() { var decls = []; if (!open()) return error("missing '{'"); comments(decls); // declarations var decl; while (decl = declaration()) { decls.push(decl); comments(decls); } if (!close()) return error("missing '}'"); return decls; } /** * Parse keyframe. */ function keyframe() { var m; var vals = []; var pos = position(); while (m = match(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/)) { vals.push(m[1]); match(/^,\s*/); } if (!vals.length) return; return pos({ type: 'keyframe', values: vals, declarations: declarations() }); } /** * Parse keyframes. */ function atkeyframes() { var pos = position(); var m = match(/^@([-\w]+)?keyframes */); if (!m) return; var vendor = m[1]; // identifier var m = match(/^([-\w]+)\s*/); if (!m) return error("@keyframes missing name"); var name = m[1]; if (!open()) return error("@keyframes missing '{'"); var frame; var frames = comments(); while (frame = keyframe()) { frames.push(frame); frames = frames.concat(comments()); } if (!close()) return error("@keyframes missing '}'"); return pos({ type: 'keyframes', name: name, vendor: vendor, keyframes: frames }); } /** * Parse supports. */ function atsupports() { var pos = position(); var m = match(/^@supports *([^{]+)/); if (!m) return; var supports = trim(m[1]); if (!open()) return error("@supports missing '{'"); var style = comments().concat(rules()); if (!close()) return error("@supports missing '}'"); return pos({ type: 'supports', supports: supports, rules: style }); } /** * Parse host. */ function athost() { var pos = position(); var m = match(/^@host */); if (!m) return; if (!open()) return error("@host missing '{'"); var style = comments().concat(rules()); if (!close()) return error("@host missing '}'"); return pos({ type: 'host', rules: style }); } /** * Parse media. */ function atmedia() { var pos = position(); var m = match(/^@media *([^{]+)/); if (!m) return; var media = trim(m[1]); if (!open()) return error("@media missing '{'"); var style = comments().concat(rules()); if (!close()) return error("@media missing '}'"); return pos({ type: 'media', media: media, rules: style }); } /** * Parse paged media. */ function atpage() { var pos = position(); var m = match(/^@page */); if (!m) return; var sel = selector() || []; if (!open()) return error("@page missing '{'"); var decls = comments(); // declarations var decl; while (decl = declaration()) { decls.push(decl); decls = decls.concat(comments()); } if (!close()) return error("@page missing '}'"); return pos({ type: 'page', selectors: sel, declarations: decls }); } /** * Parse document. */ function atdocument() { var pos = position(); var m = match(/^@([-\w]+)?document *([^{]+)/); if (!m) return; var vendor = trim(m[1]); var doc = trim(m[2]); if (!open()) return error("@document missing '{'"); var style = comments().concat(rules()); if (!close()) return error("@document missing '}'"); return pos({ type: 'document', document: doc, vendor: vendor, rules: style }); } /** * Parse import */ function atimport() { return _atrule('import'); } /** * Parse charset */ function atcharset() { return _atrule('charset'); } /** * Parse namespace */ function atnamespace() { return _atrule('namespace') } /** * Parse non-block at-rules */ function _atrule(name) { var pos = position(); var m = match(new RegExp('^@' + name + ' *([^;\\n]+);')); if (!m) return; var ret = { type: name }; ret[name] = trim(m[1]); return pos(ret); } /** * Parse at rule. */ function atrule() { if (css[0] != '@') return; return atkeyframes() || atmedia() || atsupports() || atimport() || atcharset() || atnamespace() || atdocument() || atpage() || athost(); } /** * Parse rule. */ function rule() { var pos = position(); var sel = selector(); if (!sel) return; comments(); return pos({ type: 'rule', selectors: sel, declarations: declarations() }); } return stylesheet(); }; /** * Trim `str`. */ function trim(str) { return str ? str.replace(/^\s+|\s+$/g, '') : ''; } node-css-parse-1.7.0+dfsg.orig/examples/0000775000000000000000000000000012255746762016556 5ustar rootrootnode-css-parse-1.7.0+dfsg.orig/examples/dialog.js0000664000000000000000000000031712255746762020354 0ustar rootroot /** * Module dependencies. */ var parse = require('..') , fs = require('fs') , read = fs.readFileSync , css = read('examples/dialog.css', 'utf8'); console.log(JSON.stringify(parse(css), null, 2));node-css-parse-1.7.0+dfsg.orig/examples/dialog.css0000664000000000000000000000241112255746762020525 0ustar rootroot#dialog { position: fixed; left: 50%; top: 150px; max-width: 600px; min-width: 250px; border: 1px solid #eee; background: white; z-index: 1000; } #dialog .content { padding: 15px 20px; } #dialog h1 { margin: 0 0 5px 0; font-size: 16px; font-weight: normal; } #dialog p { margin: 0; padding: 0; font-size: .9em; } #dialog.modal { box-shadow: 0 1px 8px 0 black; } /* close */ #dialog .close { position: absolute; top: 3px; right: 10px; text-decoration: none; color: #888; font-size: 16px; font-weight: bold; display: none; } #dialog.closable .close { display: block; } #dialog .close:hover { color: black; } #dialog .close:active { margin-top: 1px; } /* slide */ #dialog.slide { -webkit-transition: opacity 300ms, top 300ms; -moz-transition: opacity 300ms, top 300ms; } #dialog.slide.hide { opacity: 0; top: -500px; } /* fade */ #dialog.fade { -webkit-transition: opacity 300ms; -moz-transition: opacity 300ms; } #dialog.fade.hide { opacity: 0; } /* scale */ #dialog.scale { -webkit-transition: -webkit-transform 300ms; -moz-transition: -moz-transform 300ms; -webkit-transform: scale(1); -moz-transform: scale(1); } #dialog.scale.hide { -webkit-transform: scale(0); -moz-transform: scale(0); }node-css-parse-1.7.0+dfsg.orig/component.json0000664000000000000000000000027412255746762017640 0ustar rootroot{ "name": "css-parse", "repo": "visionmedia/css-parse", "version": "1.7.0", "description": "CSS parser", "keywords": ["css", "parser", "stylesheet"], "scripts": ["index.js"] } node-css-parse-1.7.0+dfsg.orig/benchmark/0000775000000000000000000000000012334151736016657 5ustar rootrootnode-css-parse-1.7.0+dfsg.orig/benchmark/index.js0000664000000000000000000000136512255746762020344 0ustar rootroot var bytes = require('bytes'); var parse = require('..'); var fs = require('fs'); var small = fs.readFileSync('benchmark/small.css', 'utf8'); var large = fs.readFileSync('benchmark/large.css', 'utf8'); var huge = Array(8).join(large); function lines(str) { return str.split(/\n/g).length; } console.log(); console.log(' small : %s : %s lines', bytes(Buffer.byteLength(small)), lines(small)); console.log(' large : %s : %s lines', bytes(Buffer.byteLength(large)), lines(large)); console.log(' huge : %s : %s lines', bytes(Buffer.byteLength(huge)), lines(huge)); suite('css parse', function(){ bench('small', function(){ parse(small) }) bench('large', function(){ parse(large) }) bench('huge', function(){ parse(huge) }) })node-css-parse-1.7.0+dfsg.orig/Readme.md0000664000000000000000000000512512255746762016462 0ustar rootroot# css-parse [![Build Status](https://travis-ci.org/visionmedia/css-parse.png)](https://travis-ci.org/visionmedia/css-parse) JavaScript CSS parser for nodejs and the browser. ## Installation $ npm install css-parse ## Usage ````javascript var parse = require('css-parse'); // CSS input string var css = "body { \n background-color: #fff;\n }"; var output_obj = parse(css); // Position and Source parameters var output_obj_pos = parse(css, { position: true, source: 'file.css' }); // Print parsed object as CSS string console.log(JSON.stringify(output_obj, null, 2)); ```` ## Example css: ```css body { background: #eee; color: #888; } ``` parse tree: ```json { "type": "stylesheet", "stylesheet": { "rules": [ { "type": "rule", "selectors": [ "body" ], "declarations": [ { "type": "declaration", "property": "background", "value": "#eee" }, { "type": "declaration", "property": "color", "value": "#888" } ] } ] } } ``` parse tree with `.position` enabled: ```json { "type": "stylesheet", "stylesheet": { "rules": [ { "type": "rule", "selectors": [ "body" ], "declarations": [ { "type": "declaration", "property": "background", "value": "#eee", "position": { "start": { "line": 3, "column": 3 }, "end": { "line": 3, "column": 19 } } }, { "type": "declaration", "property": "color", "value": "#888", "position": { "start": { "line": 4, "column": 3 }, "end": { "line": 4, "column": 14 } } } ], "position": { "start": { "line": 2, "column": 1 }, "end": { "line": 5, "column": 2 } } } ] } } ``` If you also pass in `source: 'path/to/original.css'`, that will be set on `node.position.source`. ## Performance Parsed 15,000 lines of CSS (2mb) in 40ms on my macbook air. ## Related [css-stringify](https://github.com/visionmedia/css-stringify "CSS-Stringify") [css-value](https://github.com/visionmedia/css-value "CSS-Value") ## License MIT node-css-parse-1.7.0+dfsg.orig/Makefile0000664000000000000000000000022012255746762016372 0ustar rootroot test: @./node_modules/.bin/mocha \ --require should \ --reporter spec \ --bail bench: @./node_modules/.bin/matcha .PHONY: test bench node-css-parse-1.7.0+dfsg.orig/LICENSE0000664000000000000000000000211212255746762015741 0ustar rootroot(The MIT License) Copyright (c) 2013 TJ Holowaychuk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. node-css-parse-1.7.0+dfsg.orig/History.md0000664000000000000000000000352712255746762016732 0ustar rootroot 1.7.0 / 2013-12-21 ================== * allow # in property names * report filename in errors if available 1.6.0 / 2013-10-16 ================== * add @host support. Closes #54 * add benchmarks * add `source` property to `position` * change: relax keyframe selectors and property names 1.5.3 / 2013-09-10 ================== * add trim shim function. Closes #45 * fix: parser now correctly parses attributes with whitespace before colon 1.5.2 / 2013-07-28 ================== * fix another regexp for good old FF 1.5.1 / 2013-07-23 ================== * fix // declaration hack. Closes #42 * fix comments for several nodes (#34). 1.5.0 / 2013-06-18 ================== * add error reporting * fix @document with no vendor prefix 1.4.0 / 2013-05-22 ================== * add `position` option support * add .type to all nodes. Closes #18 * fix comments within rulesets. Closes #30 * fix handling of unterminated comment. Closes #24 1.3.0 / 2013-05-21 ================== * add @document parsing. Closes #29 1.2.0 / 2013-03-28 ================== * add support for @page at-rules with nested @margin at-rules. * add @namespace support. * add support for new @supports at-rule. 1.1.0 / 2013-03-18 ================== * add comment parsing 1.0.4 / 2012-09-17 ================== * fix keyframes float percentages * fix an issue with comments containing slashes. 1.0.3 / 2012-09-01 ================== * add component support * fix unquoted data uris [rstacruz] * fix keyframe names with no whitespace [rstacruz] * fix excess semicolon support [rstacruz] 1.0.2 / 2012-09-01 ================== * fix IE property hack support [rstacruz] * fix quoted strings in declarations [rstacruz] 1.0.1 / 2012-07-26 ================== * change "selector" to "selectors" array 1.0.0 / 2010-01-03 ================== * Initial release node-css-parse-1.7.0+dfsg.orig/.travis.yml0000664000000000000000000000005412255746762017050 0ustar rootrootlanguage: node_js node_js: - 0.8 - 0.10 node-css-parse-1.7.0+dfsg.orig/.npmignore0000664000000000000000000000005612255746762016740 0ustar rootrootsupport test examples *.sock test.css test.js node-css-parse-1.7.0+dfsg.orig/.gitignore0000664000000000000000000000003612255746762016727 0ustar rootrootnode_modules test.js test.css