Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Preliminary test for MathML support #513

Open
wants to merge 1 commit into
base: version-9.0
Choose a base branch
from
Open
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