Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preliminary test for MathML support #5

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions scripts/9/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,20 @@ var tests = [
]
},

'<em>The next test checks if the browser makes any effort at rendering MathML, it does not stress test MathML support</em>',
/* We might want to expand the test to check for support of specific elements though, at least Content vs Presentation markup */

{
id: 'mathml',
name: 'MathML support',
value: 2 /* 1 for Content, 1 for Presentation */,
urls: [
[ 'w3c', 'https://www.w3.org/TR/MathML/' ],
[ 'mdn', '/Web/MathML' ]
]
},


'<strong>New or modified elements</strong>',

{
Expand Down
17 changes: 17 additions & 0 deletions scripts/9/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,23 @@ Test9 = (function () {
});
},

/* mathml support */

function (results) {
var element = document.createElement('div');
element.innerHTML = "<math><mspace height='23px' width='77px'/></math>";
document.body.appendChild(element);
var box = element.firstChild.firstChild.getBoundingClientRect();
console.log(box);

results.addItem({
key: 'elements.mathml',
passed: box.height == 23 && box.width == 77
});

document.body.removeChild(element);
},


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

Expand Down