diff --git a/unpacked/extensions/MathZoom.js b/unpacked/extensions/MathZoom.js index bccfa6a35..42d3df73a 100644 --- a/unpacked/extensions/MathZoom.js +++ b/unpacked/extensions/MathZoom.js @@ -222,10 +222,12 @@ // Set the position of the zoom box and overlay // Position: function (zoom,bbox) { + zoom.style.display = "none"; // avoids getting excessive width in Resize() var XY = this.Resize(), x = XY.x, y = XY.y, W = bbox.mW; + zoom.style.display = ""; var dx = -W-Math.floor((zoom.offsetWidth-W)/2), dy = bbox.Y; zoom.style.left = Math.max(dx,10-x)+"px"; zoom.style.top = Math.max(dy,10-y)+"px"; - setTimeout(ZOOM.Resize); // refigure overlay position and size + if (!ZOOM.msiePositionBug) {ZOOM.SetWH()} // refigure overlay width/height }, // @@ -249,10 +251,11 @@ }, SetWH: function () { var overlay = document.getElementById("MathJax_ZoomOverlay"); - overlay.style.width = overlay.style.height = "1px"; // so scrollWidth/Height will be right below + overlay.style.display = "none"; // so scrollWidth/Height will be right below var doc = overlay.scroll_parent || document.documentElement || document.body; overlay.style.width = doc.scrollWidth + "px"; overlay.style.height = Math.max(doc.clientHeight,doc.scrollHeight) + "px"; + overlay.style.display = ""; }, findContainer: function (obj) { var obj = obj.parentNode; diff --git a/unpacked/jax/output/SVG/jax.js b/unpacked/jax/output/SVG/jax.js index b43c12fa8..3c860945d 100644 --- a/unpacked/jax/output/SVG/jax.js +++ b/unpacked/jax/output/SVG/jax.js @@ -425,6 +425,13 @@ if (this.operaZoomRefresh) {setTimeout(function () {span.firstChild.style.border="1px solid transparent"},1)} // + // WebKit bug (issue #749) + // + if (span.offsetWidth < span.firstChild.offsetWidth) { + span.style.minWidth = span.firstChild.offsetWidth + "px"; + math.style.minWidth = math.firstChild.offsetWidth + "px"; + } + // // Get height and width of zoomed math and original math // span.style.position = math.style.position = "absolute";