Skip to content

Commit e4e3bff

Browse files
committed
Add test for mathjax/MathJax#1478
1 parent 6f432c6 commit e4e3bff

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed
+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<!DOCTYPE html>
2+
<html class="reftest-wait">
3+
<head>
4+
<title>Issue 1478</title>
5+
<!-- Copyright (c) 2016 MathJax Consortium
6+
License: Apache License 2.0 -->
7+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
8+
<script type="text/javascript" src="../header.js"></script>
9+
<script type="text/javascript" src="../scriptTests.js"></script>
10+
11+
<script>
12+
gConfigObject["HTML-CSS"].linebreaks = {automatic: true};
13+
gConfigObject.CommonHTML.linebreaks = {automatic: true};
14+
gConfigObject.SVG.linebreaks = {automatic: true};
15+
16+
function getTestCases() {
17+
var math = MathJax.Hub.getAllJax();
18+
var w = [];
19+
for (var i = 0; i < math.length; i++) {
20+
var frame = document.getElementById(math[i].inputID+"-Frame");
21+
w.push(frame.offsetWidth);
22+
}
23+
return [
24+
newScriptReftestResult('Math width good ('+w[0]+')', Math.abs(600-w[0]) < 5),
25+
newScriptReftestResult('Math in table good ('+w[1]+')', Math.abs(600-w[1]) < 5),
26+
newScriptReftestResult('Math in inline-block good ('+w[2]+')', Math.abs(600-w[2]) < 5)
27+
];
28+
}
29+
</script>
30+
31+
</head>
32+
33+
<body>
34+
35+
<!-- Shrink-wrap containers don't produce proper line-break width
36+
https://github.com/mathjax/MathJax/issues/1478 -->
37+
38+
<div style="width:800px">
39+
<div style="float:left; height:200px; width:100px; background-color:red"></div>
40+
<div style="float:right; height:200px; width:100px; background-color:red"></div>
41+
42+
<br/>
43+
\[x\tag{1}\]
44+
45+
<table><tr></td>
46+
\[x\tag{2}\]
47+
</td></tr></table>
48+
49+
<br clear="all"/>
50+
<div style="width:600px">
51+
<span style="display:inline-block">
52+
\[x\tag{3}\]
53+
</span>
54+
</div>
55+
</div>
56+
57+
</body>
58+
</html>

testsuite/MathMLToDisplay/reftest.list

+1
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,5 @@ require(CommonHTML) script issue1393.html
6161
script issue1422.html
6262
require(CommonHTML||HTML-CSS) script issue1437.html
6363
require(HTML-CSS) script issue1452.html
64+
fails-if(NativeMML) script issue1478.html
6465
script issue1499.html

0 commit comments

Comments
 (0)