From c9f50f77978d2e3232d94692f117937e90942362 Mon Sep 17 00:00:00 2001
From: "Davide P. Cervone" <dpvc@union.edu>
Date: Sat, 22 Feb 2014 10:21:44 -0500
Subject: [PATCH] Add extra DIV to prevent Font_Test DIV from adding space to
 the page, even temporarily.

---
 unpacked/jax/output/HTML-CSS/jax.js | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js
index 67c367fdb..d3ad84c68 100644
--- a/unpacked/jax/output/HTML-CSS/jax.js
+++ b/unpacked/jax/output/HTML-CSS/jax.js
@@ -60,15 +60,22 @@
     testSize: ["40px","50px","60px","30px","20px"],
 
     Init: function () {
-      this.div = MathJax.HTML.addElement(document.body,"div",{
-        id: "MathJax_Font_Test",
-        style: {position:"absolute", visibility:"hidden", top:0, left:0, width: "auto",
-                padding:0, border:0, margin:0, whiteSpace:"nowrap",
-                textAlign:"left", textIndent:0, textTransform:"none",
-                lineHeight:"normal", letterSpacing:"normal", wordSpacing:"normal",
-                fontSize:this.testSize[0], fontWeight:"normal", fontStyle:"normal",
-                fontSizeAdjust:"none"}
-      },[""]);
+      //
+      //  Wrap the Font_Test DIV in a 0x0 DIV so that it takes no room
+      //
+      this.div = MathJax.HTML.addElement(document.body,"div",{style: {
+          position:"absolute", width:0, height:0, overflow:"hidden",
+          padding:0, border:0, margin:0
+        }},[["div",{
+          id: "MathJax_Font_Test",
+          style: {position:"absolute", visibility:"hidden", top:0, left:0, width: "auto",
+                  padding:0, border:0, margin:0, whiteSpace:"nowrap",
+                  textAlign:"left", textIndent:0, textTransform:"none",
+                  lineHeight:"normal", letterSpacing:"normal", wordSpacing:"normal",
+                  fontSize:this.testSize[0], fontWeight:"normal", fontStyle:"normal",
+                  fontSizeAdjust:"none"}
+          },[""]]]
+      ).firstChild;
       this.text = this.div.firstChild;
     },