Fix some local/global variable issues detected by doing the compression.

This commit is contained in:
Davide P. Cervone 2014-11-08 09:30:24 -05:00
parent ff6d6935df
commit 8c616789ef

View File

@ -857,7 +857,7 @@
var base = this.data[this.base], sub = this.data[this.sub], sup = this.data[this.sup]; var base = this.data[this.base], sub = this.data[this.sub], sup = this.data[this.sup];
if (!base) base = {bbox: {h:.8, d:.2}}; if (!base) base = {bbox: {h:.8, d:.2}};
span.firstChild.style.marginRight = ".05em"; span.firstChild.style.marginRight = ".05em";
var h = Math.max(.4,base.CHTML.h-.4); var h = Math.max(.4,base.CHTML.h-.4),
d = Math.max(.2,base.CHTML.d+.1); d = Math.max(.2,base.CHTML.d+.1);
var bbox = this.CHTML; var bbox = this.CHTML;
if (sup && sub) { if (sup && sub) {
@ -1009,7 +1009,7 @@
// //
var H = this.CHTML.h, D = this.CHTML.d; var H = this.CHTML.h, D = this.CHTML.d;
this.CHTMLstretchChild("open",H,D); this.CHTMLstretchChild("open",H,D);
for (var i = 0, m = this.data.length; i < m; i++) { for (i = 0, m = this.data.length; i < m; i++) {
this.CHTMLstretchChild("sep"+i,H,D); this.CHTMLstretchChild("sep"+i,H,D);
this.CHTMLstretchChild(i,H,D); this.CHTMLstretchChild(i,H,D);
} }
@ -1055,11 +1055,11 @@
var CSPACE = SPLIT(values.columnspacing), var CSPACE = SPLIT(values.columnspacing),
RSPACE = SPLIT(values.rowspacing), RSPACE = SPLIT(values.rowspacing),
CALIGN = SPLIT(values.columnalign), CALIGN = SPLIT(values.columnalign),
RALIGN = SPLIT(values.rowalign), RALIGN = SPLIT(values.rowalign);//,
CLINES = SPLIT(values.columnlines), // CLINES = SPLIT(values.columnlines),
RLINES = SPLIT(values.rowlines), // RLINES = SPLIT(values.rowlines),
CWIDTH = SPLIT(values.columnwidth), // CWIDTH = SPLIT(values.columnwidth),
RCALIGN = []; // RCALIGN = [];
for (i = 0, m = CSPACE.length; i < m; i++) {CSPACE[i] = CHTML.length2em(CSPACE[i])} for (i = 0, m = CSPACE.length; i < m; i++) {CSPACE[i] = CHTML.length2em(CSPACE[i])}
for (i = 0, m = RSPACE.length; i < m; i++) {RSPACE[i] = CHTML.length2em(RSPACE[i])} for (i = 0, m = RSPACE.length; i < m; i++) {RSPACE[i] = CHTML.length2em(RSPACE[i])}
@ -1077,7 +1077,7 @@
var cell = row.data[j]; var cell = row.data[j];
if (cell) { if (cell) {
var cspace = CHTML.arrayEntry(CSPACE,j-1), calign = CHTML.arrayEntry(CALIGN,j); var cspace = CHTML.arrayEntry(CSPACE,j-1), calign = CHTML.arrayEntry(CALIGN,j);
var cbox = cell.CHTML, cspan = cell.CHTMLspanElement(); var /*cbox = cell.CHTML,*/ cspan = cell.CHTMLspanElement();
if (j) {rbox.w += cspace; cspan.style.paddingLeft = CHTML.Em(cspace)} if (j) {rbox.w += cspace; cspan.style.paddingLeft = CHTML.Em(cspace)}
if (i) cspan.style.paddingTop = CHTML.Em(rspace); if (i) cspan.style.paddingTop = CHTML.Em(rspace);
cspan.style.textAlign = calign; cspan.style.textAlign = calign;
@ -1097,9 +1097,9 @@
MML.semantics.Augment({ MML.semantics.Augment({
toCommonHTML: function (span) { toCommonHTML: function (span) {
span = this.CHTMLcreateSpan(span); span = this.CHTMLcreateSpan(span);
if (this.data[i]) { if (this.data[0]) {
this.data[i].toCommonHTML(span); this.data[0].toCommonHTML(span);
this.CHTML = this.data[i].CHTML; this.CHTML = this.data[0].CHTML;
} }
return span; return span;
} }
@ -1110,7 +1110,7 @@
// //
// Loading isn't complete until the element jax is modified, // Loading isn't complete until the element jax is modified,
// but can't call loadComplete within the callback for "mml Jax Ready" // but can't call loadComplete within the callback for "mml Jax Ready"
// (it would call HTMLCSS's Require routine, asking for the mml jax again) // (it would call CommonHTML's Require routine, asking for the mml jax again)
// so wait until after the mml jax has finished processing. // so wait until after the mml jax has finished processing.
// //
// We also need to wait for the onload handler to run, since the loadComplete // We also need to wait for the onload handler to run, since the loadComplete