diff options
Diffstat (limited to 'js/src/dom')
-rw-r--r-- | js/src/dom/selector-engine.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/js/src/dom/selector-engine.js b/js/src/dom/selector-engine.js index a8c14ae4c8..c18ec4136f 100644 --- a/js/src/dom/selector-engine.js +++ b/js/src/dom/selector-engine.js @@ -67,6 +67,20 @@ const SelectorEngine = { } return [] + }, + + next(element, selector) { + let next = element.nextElementSibling + + while (next) { + if (this.matches(next, selector)) { + return [next] + } + + next = next.nextElementSibling + } + + return [] } } |