Skip to content

Commit a830f4d

Browse files
authored
Merge pull request #5 from Oblomov/test-mathml
Preliminary test for MathML support
2 parents 2470e7d + dd4c8db commit a830f4d

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

scripts/9/data.js

+14
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,20 @@ var tests = [
7676
]
7777
},
7878

79+
'<em>The next test checks if the browser makes any effort at rendering MathML, it does not stress test MathML support</em>',
80+
/* We might want to expand the test to check for support of specific elements though, at least Content vs Presentation markup */
81+
82+
{
83+
id: 'mathml',
84+
name: 'MathML support',
85+
value: 2 /* 1 for Content, 1 for Presentation */,
86+
urls: [
87+
[ 'w3c', 'https://www.w3.org/TR/MathML/' ],
88+
[ 'mdn', '/Web/MathML' ]
89+
]
90+
},
91+
92+
7993
'<strong>New or modified elements</strong>',
8094

8195
{

scripts/9/engine.js

+17
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,23 @@ Test9 = (function () {
211211
});
212212
},
213213

214+
/* mathml support */
215+
216+
function (results) {
217+
var element = document.createElement('div');
218+
element.innerHTML = "<math><mspace height='23px' width='77px'/></math>";
219+
document.body.appendChild(element);
220+
var box = element.firstChild.firstChild.getBoundingClientRect();
221+
console.log(box);
222+
223+
results.addItem({
224+
key: 'elements.mathml',
225+
passed: box.height == 23 && box.width == 77
226+
});
227+
228+
document.body.removeChild(element);
229+
},
230+
214231

215232
/* section, nav, article, header and footer */
216233

0 commit comments

Comments
 (0)