| | |
| | | */ |
| | | function compile(selector, options, context) { |
| | | var next = compileUnsafe(selector, options, context); |
| | | return subselects_1.ensureIsTag(next, options.adapter); |
| | | return (0, subselects_1.ensureIsTag)(next, options.adapter); |
| | | } |
| | | exports.compile = compile; |
| | | function compileUnsafe(selector, options, context) { |
| | | var token = typeof selector === "string" ? css_what_1.parse(selector, options) : selector; |
| | | var token = typeof selector === "string" ? (0, css_what_1.parse)(selector) : selector; |
| | | return compileToken(token, options, context); |
| | | } |
| | | exports.compileUnsafe = compileUnsafe; |
| | |
| | | (Array.isArray(t.data) && |
| | | t.data.some(function (data) { return data.some(includesScopePseudo); })))); |
| | | } |
| | | var DESCENDANT_TOKEN = { type: "descendant" }; |
| | | var DESCENDANT_TOKEN = { type: css_what_1.SelectorType.Descendant }; |
| | | var FLEXIBLE_DESCENDANT_TOKEN = { |
| | | type: "_flexibleDescendant", |
| | | }; |
| | | var SCOPE_TOKEN = { type: "pseudo", name: "scope", data: null }; |
| | | var SCOPE_TOKEN = { |
| | | type: css_what_1.SelectorType.Pseudo, |
| | | name: "scope", |
| | | data: null, |
| | | }; |
| | | /* |
| | | * CSS 4 Spec (Draft): 3.3.1. Absolutizing a Scope-relative Selector |
| | | * http://www.w3.org/TR/selectors4/#absolutizing |
| | |
| | | })); |
| | | for (var _i = 0, token_1 = token; _i < token_1.length; _i++) { |
| | | var t = token_1[_i]; |
| | | if (t.length > 0 && procedure_1.isTraversal(t[0]) && t[0].type !== "descendant") { |
| | | if (t.length > 0 && (0, procedure_1.isTraversal)(t[0]) && t[0].type !== "descendant") { |
| | | // Don't continue in else branch |
| | | } |
| | | else if (hasContext && !t.some(includesScopePseudo)) { |
| | |
| | | return rules.reduce(function (previous, rule) { |
| | | return previous === boolbase_1.falseFunc |
| | | ? boolbase_1.falseFunc |
| | | : general_1.compileGeneralSelector(previous, rule, options, context, compileToken); |
| | | : (0, general_1.compileGeneralSelector)(previous, rule, options, context, compileToken); |
| | | }, (_a = options.rootFunc) !== null && _a !== void 0 ? _a : boolbase_1.trueFunc); |
| | | } |
| | | function reduceRules(a, b) { |