UNPKG

nehan

Version:

Html layout engine for paged-media written in Typescript

24 lines 683 B
import { Selector, PseudoElementTagNames, } from "./public-api"; export class PseudoElementSelector extends Selector { constructor(source) { super(); this.src = source; this.specificity.c = 1; if (!PseudoElementTagNames.includes(this.tagName)) { console.error("pseudo element(" + this.pseudoName + ") is not defined."); } } toString() { return this.tagName; } get pseudoName() { return this.src; } get tagName() { return "::" + this.pseudoName; } test(element) { return element.tagName === this.tagName; } } //# sourceMappingURL=pseudo-element-selector.js.map