fabric
Version:
Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.
1 lines • 1.01 kB
Source Map (JSON)
{"version":3,"file":"doesSomeParentMatch.min.mjs","sources":["../../../src/parser/doesSomeParentMatch.ts"],"sourcesContent":["import { selectorMatches } from './selectorMatches';\n\nexport function doesSomeParentMatch(element: HTMLElement, selectors: string[]) {\n let selector: string,\n parentMatching = true;\n while (\n element.parentElement &&\n element.parentElement.nodeType === 1 &&\n selectors.length\n ) {\n if (parentMatching) {\n selector = selectors.pop()!;\n }\n element = element.parentElement;\n parentMatching = selectorMatches(element, selector!);\n }\n return selectors.length === 0;\n}\n"],"names":["doesSomeParentMatch","element","selectors","selector","parentMatching","parentElement","nodeType","length","pop","selectorMatches"],"mappings":"4DAEO,SAASA,EAAoBC,EAAsBC,GACxD,IAAIC,EACFC,GAAiB,EACnB,KACEH,EAAQI,eAC2B,IAAnCJ,EAAQI,cAAcC,UACtBJ,EAAUK,QAENH,IACFD,EAAWD,EAAUM,OAEvBP,EAAUA,EAAQI,cAClBD,EAAiBK,EAAgBR,EAASE,GAE5C,OAA4B,IAArBD,EAAUK,MACnB"}