openstax / css-manipulate

Do more with CSS!
https://jsfiddle.net/philschatz/hjk2z4af/
5 stars 0 forks source link

Panics if namespace selectors are in use but no namespaces have been declared #9

Open aiwenar opened 6 years ago

aiwenar commented 6 years ago

Following CSS will remain correct if we remove namespace declaration (since it's never used),

@namespace test "";
div { content: move-here('|*'); }

but css-plus will panic, claiming that

Error: Evaluation failed: Error: Syntax error, unrecognized expression: |*
    at Function.Sizzle.error (/home/aiwenar/Documents/Connexions/css-manipulate/node_modules/jquery/dist/jquery.js:1580:8)
    at Sizzle.tokenize (/home/aiwenar/Documents/Connexions/css-manipulate/node_modules/jquery/dist/jquery.js:2232:11)
    at Function.Sizzle [as find] (/home/aiwenar/Documents/Connexions/css-manipulate/node_modules/jquery/dist/jquery.js:854:15)
    at jQuery.fn.init.find (/home/aiwenar/Documents/Connexions/css-manipulate/node_modules/jquery/dist/jquery.js:2922:11)
    at FUNCTIONS.push.FunctionEvaluator (<anonymous>:21283:24)
    at FunctionEvaluator.evaluateFunction (<anonymous>:21106:95)
    at argExpr.map (<anonymous>:20204:43)
    at Array.map (<anonymous>)
    at FunctionEvaluator.evaluateArg (<anonymous>:20170:20)
    at _argExprs.map (<anonymous>:20158:19)
    at ExecutionContext.evaluateHandle (/home/aiwenar/Documents/Connexions/css-manipulate/node_modules/puppeteer/lib/ExecutionContext.js:54:15)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

CSS will be parsed properly if at least one namespace declaration is present.