Skip to content

Commit 5820a59

Browse files
committed
Addressed comments
1 parent 0b2e1ff commit 5820a59

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

lib/core/public/run-rules.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ export default function runRules(context, options, resolve, reject) {
3737
performanceTimer.auditStart();
3838
}
3939

40-
if (options.a11yEngineConfig && options.a11yEngineConfig.advancedRun) {
40+
// If advanced run for iframes is true then setup socket for iframes
41+
if (options.a11yEngineConfig && options.a11yEngineConfig.iframesAdvancedRun) {
4142
a11yEngine.setup(options.a11yEngineConfig);
4243
}
4344

45+
// If run for iframes is true then collect results from iframes
4446
if (context.frames.length && options.iframes === true) {
4547
q.defer((res, rej) => {
4648
collectResultsFromFrames(context, options, 'rules', null, res, rej);

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ 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;
25+
// check a11yengine iframe advance run flag
26+
if (
27+
options.a11yEngineConfig &&
28+
options.a11yEngineConfig.iframesAdvancedRun === false
29+
) {
30+
options.a11yEngineConfig.iframesAdvancedRun = true;
2831
}
2932

3033
var q = queue();

lib/core/utils/merge-results.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ function normalizeResult(result) {
7676
*/
7777
function mergeResults(frameResults, options) {
7878
const mergedResult = [];
79+
// A11yEngine merged errors
7980
let mergedErrors = {};
8081
frameResults.forEach(frameResult => {
8182
const results = normalizeResult(frameResult);
@@ -84,6 +85,7 @@ function mergeResults(frameResults, options) {
8485
}
8586

8687
const frameSpec = getFrameSpec(frameResult);
88+
// Extract existing errors and merge with new ones
8789
if (results[results.length - 1].a11yEngineErrors) {
8890
const error = results.pop();
8991
delete error.a11yEngineErrors;

0 commit comments

Comments
 (0)