We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43c9072 commit ba9a836Copy full SHA for ba9a836
src/backend/index.js
@@ -125,7 +125,18 @@ function scan () {
125
126
function walk (node, fn) {
127
if (node.childNodes) {
128
- Array.prototype.forEach.call(node.childNodes, function (node) {
+ node.childNodes.forEach(function (node) {
129
+ const stop = fn(node)
130
+ if (!stop) {
131
+ walk(node, fn)
132
+ }
133
+ })
134
135
+
136
+ // This code is duplicated because there doesn't seem to be
137
+ // a reasonable way to concat NodeLists
138
+ if (node.shadowRoot && node.shadowRoot.childNodes) {
139
+ node.shadowRoot.childNodes.forEach(function (node) {
140
const stop = fn(node)
141
if (!stop) {
142
walk(node, fn)
0 commit comments