Commit 0c647499 authored by dmazzoni's avatar dmazzoni Committed by Commit bot

ChromeVox is using Array.every in three places where it should be forEach.

This is causing problems when a function that returns an array of
nav descriptions returns more than one item, they're not all processed
correctly.

BUG=408821

Review URL: https://codereview.chromium.org/517843002

Cr-Commit-Position: refs/heads/master@{#292844}
parent 13cb53db
......@@ -404,7 +404,7 @@ cvox.LiveRegions.announceChange = function(
// Set a category on the NavDescriptions - that way live regions
// interrupt other live regions but not anything else.
navDescriptions.every(function(desc) {
navDescriptions.forEach(function(desc) {
if (!desc.category) {
desc.category = 'live';
}
......
......@@ -647,14 +647,14 @@ cvox.NavigationManager.prototype.speakDescriptionArray = function(
opt_personality,
opt_category) {
if (opt_personality) {
descriptionArray.every(function(desc) {
descriptionArray.forEach(function(desc) {
if (!desc.personality) {
desc.personality = opt_personality;
}
});
}
if (opt_category) {
descriptionArray.every(function(desc) {
descriptionArray.forEach(function(desc) {
if (!desc.category) {
desc.category = opt_category;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment