From 922eabdf720cdcc19545148bff2d6e1fcc112c10 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 4 Aug 2015 09:19:41 -0400 Subject: [PATCH 1/2] Use px rather than em for rule thicknesses, and use borderTop for wide rules rather than borderLeft. This makes them less likely to disappear. Resolves issue #1095. --- unpacked/jax/output/HTML-CSS/jax.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js index 41a9f39f9..d4e4c33ba 100644 --- a/unpacked/jax/output/HTML-CSS/jax.js +++ b/unpacked/jax/output/HTML-CSS/jax.js @@ -1136,14 +1136,20 @@ if (w > 0 && w*this.em < min) {w = min/this.em} if (h+d > 0 && (h+d)*this.em < min) {f = 1/(h+d)*(min/this.em); h *= f; d *= f} if (!color) {color = "solid"} else {color = "solid "+color} - color = this.Em(w)+" "+color; - var H = (f === 1 ? this.Em(h+d) : min+"px"), D = this.Em(-d); + var style = {display: "inline-block", overflow:"hidden", verticalAlign:this.Em(-d)}; + if (w > h+d) { + style.borderTop = this.Px(h+d)+" "+color; + style.width = this.Em(w); + style.height = (this.msieRuleBug && h+d > 0 ? this.Em(h+d) : 0); + } else { + style.borderLeft = this.Px(w)+" "+color; + style.width = (this.msieRuleBug && w > 0 ? this.Em(w) : 0); + style.height = this.Em(h+d); + } var rule = this.addElement(span,"span",{ - style: {borderLeft: color, display: "inline-block", overflow:"hidden", - width:0, height:H, verticalAlign:D}, - bbox: {h:h, d:d, w:w, rw:w, lw:0, exactW:true}, noAdjust:true, HH:h+d, isMathJax:true + style: style, noAdjust:true, HH:h+d, isMathJax:true, + bbox: {h:h, d:d, w:w, rw:w, lw:0, exactW:true} }); - if (this.msieRuleBug && w > 0) {rule.style.width = this.Em(w)} if (span.isBox || span.className == "mspace") {span.bbox = rule.bbox, span.HH = h+d} return rule; }, From b1b6861a6ca44404b2807acc22508c3397c38041 Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Tue, 4 Aug 2015 09:23:03 -0400 Subject: [PATCH 2/2] Use px rather than em for frames as well. Resolves issue #1095 in Safari. --- unpacked/jax/output/HTML-CSS/jax.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js index d4e4c33ba..1a99295d4 100644 --- a/unpacked/jax/output/HTML-CSS/jax.js +++ b/unpacked/jax/output/HTML-CSS/jax.js @@ -1159,7 +1159,7 @@ if (this.msieFrameSizeBug) {if (w < T) {w = T}; if (h+d < T) {h = T-d}} if (this.msieBorderWidthBug) {T = 0} var H = this.Em(h+d-T), D = this.Em(-d-t), W = this.Em(w-T); - var B = this.Em(t)+" "+style; + var B = this.Px(t)+" "+style; var frame = this.addElement(span,"span",{ style: {border: B, display:"inline-block", overflow:"hidden", width:W, height:H}, bbox: {h:h, d:d, w:w, rw:w, lw:0, exactW:true}, noAdjust: true, HH:h+d, isMathJax:true