diff options
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/dom/selector-engine.js | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/js/src/dom/selector-engine.js b/js/src/dom/selector-engine.js index 3c407667c..727df7518 100644 --- a/js/src/dom/selector-engine.js +++ b/js/src/dom/selector-engine.js @@ -14,10 +14,6 @@ const NODE_TEXT = 3 const SelectorEngine = { - matches(element, selector) { - return element.matches(selector) - }, - find(selector, element = document.documentElement) { return [].concat(...Element.prototype.querySelectorAll.call(element, selector)) }, @@ -38,7 +34,7 @@ const SelectorEngine = { let ancestor = element.parentNode while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) { - if (this.matches(ancestor, selector)) { + if (ancestor.matches(selector)) { parents.push(ancestor) } @@ -66,7 +62,7 @@ const SelectorEngine = { let next = element.nextElementSibling while (next) { - if (this.matches(next, selector)) { + if (next.matches(selector)) { return [next] } |
