Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6054)

Unified Diff: chrome/browser/resources/chromeos/chromevox/common/dom_util.js

Issue 828373007: Fix math support on wikipedia. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/chromevox/common/dom_util.js
diff --git a/chrome/browser/resources/chromeos/chromevox/common/dom_util.js b/chrome/browser/resources/chromeos/chromevox/common/dom_util.js
index b9dd523220e50a13d7b59136c8dee310add8ee69..2f59cf49d15f82b5ef6ed86ca93dca400f733063 100644
--- a/chrome/browser/resources/chromeos/chromevox/common/dom_util.js
+++ b/chrome/browser/resources/chromeos/chromevox/common/dom_util.js
@@ -2447,9 +2447,10 @@ cvox.DomUtil.isMathImg = function(node) {
if (node.tagName != 'IMG') {
return false;
}
- var className = node.className.toLowerCase();
- return cvox.DomUtil.ALT_MATH_CLASSES.tex.indexOf(className) != -1 ||
- cvox.DomUtil.ALT_MATH_CLASSES.asciimath.indexOf(className) != -1;
+ return node.className.toLowerCase().split(' ').some(function(className) {
dmazzoni 2015/01/14 08:20:34 Can you use classList.contains? Or at least, itera
David Tseng 2015/01/14 18:17:35 No; since the current code lower cases the classna
+ return cvox.DomUtil.ALT_MATH_CLASSES.tex.indexOf(className) != -1 ||
+ cvox.DomUtil.ALT_MATH_CLASSES.asciimath.indexOf(className) != -1;
+ });
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698