Skip to content

Commit 6dc8ff6

Browse files
author
Abhishek Bindra
committed
support advanced rule execution for iframes
1 parent e208dab commit 6dc8ff6

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/core/public/run-rules.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/*global a11yEngine*/
12
import Context from '../base/context';
23
import teardown from './teardown';
34
import {
@@ -36,6 +37,12 @@ export default function runRules(context, options, resolve, reject) {
3637
performanceTimer.auditStart();
3738
}
3839

40+
if (options.a11yEngineConfig && options.a11yEngineConfig.advancedRun) {
41+
// do a11yEngine setup for iframe
42+
console.log('>>> iframe detected, initiating setup ...');
43+
a11yEngine.setup(options.a11yEngineConfig);
44+
}
45+
3946
if (context.frames.length && options.iframes !== false) {
4047
q.defer((res, rej) => {
4148
collectResultsFromFrames(context, options, 'rules', null, res, rej);

lib/core/utils/collect-results-from-frames.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ export default function collectResultsFromFrames(
2222
// elementRefs can't be passed across frame boundaries
2323
options = { ...options, elementRef: false };
2424

25+
// check a11yengine advance run flag
26+
if (options.a11yEngineConfig && !options.a11yEngineConfig.advancedRun) {
27+
options.a11yEngineConfig.advancedRun = true;
28+
}
29+
2530
var q = queue();
2631
var frames = parentContent.frames;
2732

0 commit comments

Comments
 (0)