Consider signing in before you create benchmark. Then you will be able to edit it later.
Benchmarks created by guest users can't be edited , only forked.
Log in
const comments = [];
testTraverse(testTemplate.content.firstChild, node => {
if (node.nodeType === Node.COMMENT_NODE) {
comments.push(node);
}
});
const nodeIterator = document.createNodeIterator(
testTemplate.content,
NodeFilter.SHOW_ALL,
{
acceptNode(node) {
if (node.nodeType === Node.COMMENT_NODE) {
return NodeFilter.FILTER_ACCEPT;
}
return NodeFilter.FILTER_REJECT;
}
}
);
const comments = [];
while (nodeIterator.nextNode()) {
comments.push(nodeIterator.currentNode);
}
const nodeIterator = document.createNodeIterator(
testTemplate.content,
NodeFilter.SHOW_COMMENT
);
const comments = [];
while (nodeIterator.nextNode()) {
comments.push(nodeIterator.currentNode);
}
const treeWalker = document.createTreeWalker(
testTemplate.content,
NodeFilter.SHOW_ALL,
{
acceptNode(node) {
if (node.nodeType === Node.COMMENT_NODE) {
return NodeFilter.FILTER_ACCEPT;
}
return NodeFilter.FILTER_REJECT;
}
}
);
const comments = [];
while (treeWalker.nextNode()) {
comments.push(treeWalker.currentNode);
}
const treeWalker = document.createTreeWalker(
testTemplate.content,
NodeFilter.SHOW_COMMENT
);
const comments = [];
while (treeWalker.nextNode()) {
comments.push(treeWalker.currentNode);
}