Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// :withLabel(text)
Sizzle.selectors.pseudos.withLabel = createPseudo((text) => {
return (element) => {
return matchElementByLabel(element, text, options)
}
})
Sizzle.selectors.pseudos.label = Sizzle.selectors.pseudos.withLabel
// :withText(text)
Sizzle.selectors.pseudos.withText = createPseudo((text) => {
return (element) => {
return matchElementByText(element, text, options)
}
})
Sizzle.selectors.pseudos.textContent = Sizzle.selectors.pseudos.withText
// :withTitle(text)
Sizzle.selectors.pseudos.withTitle = createPseudo((text) => {
return (element) => {
return matchElementByTitle(element, text, options)
}
})
Sizzle.selectors.pseudos.title = Sizzle.selectors.pseudos.withTitle
// :clickable
Sizzle.selectors.pseudos.clickable = (element) => {
return clickable(element)
}
// :focusable
Sizzle.selectors.pseudos.focusable = (element) => {
function addPseudos (
options = {
exact: true,
trim: true,
collapseWhitespace: true
}
) {
const { createPseudo } = Sizzle.selectors
// :withLabel(text)
Sizzle.selectors.pseudos.withLabel = createPseudo((text) => {
return (element) => {
return matchElementByLabel(element, text, options)
}
})
Sizzle.selectors.pseudos.label = Sizzle.selectors.pseudos.withLabel
// :withText(text)
Sizzle.selectors.pseudos.withText = createPseudo((text) => {
return (element) => {
return matchElementByText(element, text, options)
}
})
Sizzle.selectors.pseudos.textContent = Sizzle.selectors.pseudos.withText
import {
tabbable,
focusable,
clickable,
visible,
exists
} from './helpers'
import {
matchElementByTitle,
matchElementByLabel,
matchElementByText
} from './matchers'
Sizzle.selectors.cacheLength = 1
function querySelectorAll (...args) {
const { element, selector, options } = parseQueryArguments(...args)
let results = []
if (selector) {
results = findAllMatches(element, selector, options)
} else {
throwQueryError(element, selector)
}
return results
}
function querySelector (...args) {