Skip to content

Commit 6f8faff

Browse files
committed
changes for sub menu rule node
1 parent 4334d1a commit 6f8faff

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

lib/core/base/rule.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,13 +583,27 @@ Rule.prototype.after = function after(result, options) {
583583
// only add the node property for the check.after so we can
584584
// look at which iframe a check result came from, but we don't
585585
// want it for the final results object
586-
delete item.node;
586+
if (item.data.metaData) {
587+
delete item.node;
588+
item.result = true;
589+
}
587590
if (afterResults.indexOf(item) === -1) {
588591
item.filtered = true;
589592
}
590593
});
591594
});
592595

596+
// Sub menu nodes modifications
597+
const data = result.nodes.filter((r) => !r.all[0].result);
598+
data.forEach((r) => {
599+
const node = r.all[0].data;
600+
r.node = new axe.utils.DqElement(node);
601+
});
602+
603+
result.nodes.forEach((r) => {
604+
delete r.all[0].data;
605+
});
606+
593607
result.nodes = sanitizeNodes(result);
594608
return result;
595609
};

lib/core/utils/check-helper.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ function checkHelper(checkResult, options, resolve, reject) {
2525
data(data) {
2626
checkResult.data = data;
2727
},
28+
getData() {
29+
return checkResult.data;
30+
},
2831
relatedNodes(nodes) {
2932
if (!window.Node) {
3033
return;

0 commit comments

Comments
 (0)