fabric
Version:
Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.
15 lines (14 loc) • 554 B
JavaScript
import { selectorMatches } from "./selectorMatches.mjs";
//#region src/parser/doesSomeParentMatch.ts
function doesSomeParentMatch(element, selectors) {
let selector, parentMatching = true;
while (element.parentElement && element.parentElement.nodeType === 1 && selectors.length) {
if (parentMatching) selector = selectors.pop();
element = element.parentElement;
parentMatching = selectorMatches(element, selector);
}
return selectors.length === 0;
}
//#endregion
export { doesSomeParentMatch };
//# sourceMappingURL=doesSomeParentMatch.mjs.map