Make sure aria attributes use setAttribute so they appear properly in the DOM

This commit is contained in:
Davide P. Cervone 2015-09-12 06:58:06 -04:00
parent c2ef3d9312
commit 2756525e73

View File

@ -1048,10 +1048,11 @@ MathJax.HTML = {
{def.style[id.replace(/-([a-z])/g,this.ucMatch)] = style[id]}} {def.style[id.replace(/-([a-z])/g,this.ucMatch)] = style[id]}}
} }
MathJax.Hub.Insert(obj,def); MathJax.Hub.Insert(obj,def);
for (var id in def) {if (id.substr(0,5) === "aria-") obj.setAttribute(id,def[id])}
} }
if (contents) { if (contents) {
if (!(contents instanceof Array)) {contents = [contents]} if (!(contents instanceof Array)) {contents = [contents]}
for (var i = 0; i < contents.length; i++) { for (var i = 0, m = contents.length; i < m; i++) {
if (contents[i] instanceof Array) { if (contents[i] instanceof Array) {
obj.appendChild(this.Element(contents[i][0],contents[i][1],contents[i][2])); obj.appendChild(this.Element(contents[i][0],contents[i][1],contents[i][2]));
} else if (type === "script") { // IE throws an error if script is added as a text node } else if (type === "script") { // IE throws an error if script is added as a text node