Skip to content

Commit 15b3928

Browse files
committed
Break HTML-CSS output into phases so that the final measurement can be done all at once. Restores timing improvements that were lost due to a change made in the testing for v2.5.
1 parent cb13a05 commit 15b3928

File tree

2 files changed

+170
-127
lines changed

2 files changed

+170
-127
lines changed

unpacked/MathJax.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,15 +2273,23 @@ MathJax.Hub = {
22732273
var jax = script.MathJax.elementJax; if (!jax) {state.i++; continue}
22742274
//
22752275
// Call the output Jax's Process method (which will be its Translate()
2276-
// method once loaded). Mark it as complete and remove the preview.
2276+
// method once loaded). Mark it as complete and remove the preview unless
2277+
// the Process() call returns an explicit false value (in which case, it will
2278+
// handle this later during the postProcess phase, as HTML-CSS does).
22772279
//
22782280
result = MathJax.OutputJax[jax.outputJax].Process(script,state);
2279-
script.MathJax.state = STATE.PROCESSED; state.i++;
2280-
if (script.MathJax.preview) {script.MathJax.preview.innerHTML = ""}
2281+
if (result !== false) {
2282+
script.MathJax.state = STATE.PROCESSED;
2283+
if (script.MathJax.preview) {script.MathJax.preview.innerHTML = ""}
2284+
//
2285+
// Signal that new math is available
2286+
//
2287+
this.signal.Post(["New Math",jax.inputID]); // FIXME: wait for this? (i.e., restart if returns uncalled callback)
2288+
}
22812289
//
2282-
// Signal that new math is available
2290+
// Go on to next math expression
22832291
//
2284-
this.signal.Post(["New Math",jax.inputID]); // FIXME: wait for this? (i.e., restart if returns uncalled callback)
2292+
state.i++;
22852293
//
22862294
// Update the processing message, if needed
22872295
//

0 commit comments

Comments
 (0)