www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 1fa9bbaef0ea70a3b5a27ab308805d620f6f9424
parent e3f65aa912554b1bb2864e8ca8ba95e69425e484
Author: Davide P. Cervone <dpvc@union.edu>
Date:   Wed,  7 Oct 2015 18:06:49 -0400

Force width of mrow if there is negative space within the mrow (to work around WebKit bug).  Resolves issue #1278.

Diffstat:
Munpacked/jax/output/CommonHTML/jax.js | 14+++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/unpacked/jax/output/CommonHTML/jax.js b/unpacked/jax/output/CommonHTML/jax.js @@ -2527,9 +2527,17 @@ MML.mrow.Augment({ toCommonHTML: function (node) { node = this.CHTMLdefaultNode(node); - var bbox = this.CHTML, H = bbox.h, D = bbox.d; - for (var i = 0, m = this.data.length; i < m; i++) this.CHTMLstretchChildV(i,H,D); - if (this.CHTMLlineBreaks()) this.CHTMLmultiline(node); + var bbox = this.CHTML, H = bbox.h, D = bbox.d, hasNegative; + for (var i = 0, m = this.data.length; i < m; i++) { + this.CHTMLstretchChildV(i,H,D); + if (this.data[i] && this.data[i].CHTML && this.data[i].CHTML.w < 0) hasNegative = true; + } + if (this.CHTMLlineBreaks()) { + this.CHTMLmultiline(node); + } else { + if (hasNegative && bbox.w) node.style.width = CHTML.Em(Math.max(0,bbox.w)); + if (bbox.w < 0) node.style.marginRight = CHTML.Em(bbox.w); + } return node; }, CHTMLlineBreaks: function () {