Skip to content

Commit

Permalink
Add test for mathjax/MathJax#824.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpvc committed May 27, 2014
1 parent 360d618 commit b713c76
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
44 changes: 44 additions & 0 deletions testsuite/UI/zoom/issue824-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<title>zoom box</title>
<!-- Copyright (c) 2011 Design Science, Inc.
License: Apache License 2.0 -->

<!-- This test verifies zoom box size with HTML-CSS or SVG output.
See issue 59
https://github.com/mathjax/MathJax/issues/59 -->

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="../../header.js"></script>
<script type="text/javascript">
function preMathJax()
{
gConfigObject.extensions.push("MathZoom.js");
}

function postMathJax()
{
var jax = MathJax.Hub.getAllJax()[0];
var math = document.getElementById(jax.inputID+"-Frame");
if (!math.jaxID) {math = math.childNode}
MathJax.Extension.MathZoom.Zoom(null, math)

// If the zoom box is large enough, it should render the same with or
// without scroll bars.
document.getElementById("MathJax_Zoom").style.overflow = "auto";
}
</script>
</head>

<body>
<div>
$$
\hspace{3em}
\tag{1}
$$
</div>
</body>
</html>
44 changes: 44 additions & 0 deletions testsuite/UI/zoom/issue824.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<title>zoom box</title>
<!-- Copyright (c) 2011 Design Science, Inc.
License: Apache License 2.0 -->

<!-- This test verifies zoom box size with HTML-CSS output.
See issue 824
https://github.com/mathjax/MathJax/issues/824 -->

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="../../header.js"></script>
<script type="text/javascript">
function preMathJax() {
gConfigObject.extensions.push("MathZoom.js");
}

function postMathJax() {
var jax = MathJax.Hub.getAllJax()[0];
var math = document.getElementById(jax.inputID+"-Frame");
if (!math.jaxID) {math = math.firstChild}
MathJax.Extension.MathZoom.Zoom(null, math)

if (getQueryBoolean("auto")) {
var zoom = document.getElementById("MathJax_Zoom");
zoom.style.overflow = "auto";
}
}
</script>
</head>

<body>
<div style="width:600px">
$$
\Rule{400px}{1em}{0px}
\tag{1}
$$
</div>

</body>
</html>
1 change: 1 addition & 0 deletions testsuite/UI/zoom/reftest.list
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ fails-if(MSIE) == zoom-box-2.html zoom-box-2-ref.html
load zoom-box-6.html
== zoom-box-7.html zoom-box-7-ref.html
script issue460.html
== issue824.html issue824.html?auto=true

0 comments on commit b713c76

Please sign in to comment.