Change how combining characters are handled so that they show up in IE but are still placed properly in Chrome (putting them over a non-breaking space got the baseline wrong in Chrome for some reason, and over a space got the width wrong).

This commit is contained in:
Davide P. Cervone 2015-04-17 17:22:48 -04:00
parent 562786da5e
commit 64ed60ac51

View File

@ -113,6 +113,7 @@
"mjx-box": {display:"inline-block"},
"mjx-block": {display:"block"},
"mjx-span": {display:"span"},
"mjx-char": {display:"block"},
"mjx-itable": {display:"inline-table"},
"mjx-row": {display:"table-row"},
@ -1758,12 +1759,10 @@
// IE doesn't display combining chararacters unless they combine with
// something, so put them over a space and remove the space's width
//
var char = node.firstChild.textContent;
node.firstChild.innerHTML = "\u00A0" + char;
var font = this.CHTMLvariant.cache[char.charCodeAt(0)][0].font;
var space = font[0xA0] || font[0x20];
var w = space[2] / (space.c ? 1 : 1000);
node.firstChild.style.marginLeft = CHTML.Em(-w);
node = node.firstChild;
var char = node.textContent;
var space = HTML.Element("mjx-span",{style:{width:".25em","margin-left":"-.25em"}});
node.insertBefore(space,node.firstChild);
},
CHTMLcenterOp: function (node) {
var bbox = this.CHTML;