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