-
Notifications
You must be signed in to change notification settings - Fork 9
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
add test for MathJax/MathJax#912 #3
Conversation
Not sure if that's what you had in mind. Should I split it into two tests? |
try { | ||
check = ( mstyle.getAttribute('scriptlevel') === '0' && mstyle.getAttribute('displaystyle') === 'false'); | ||
} | ||
catch (err) {check = false}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, but you should be able to do it without the overhead of try/catch
. How about:
var check = !!(mstyle && mstyle.getAttribute('scriptlevel') === '0' && mstyle.getAttribute('displaystyle') === 'false');
I think one test is fine for this. If you want, you could do return [
newScriptReftestResult("Scriplevel 0",(mstyle && mstyle.getAttribute('scriptlevel') === '0')),
newScriptReftestResult("Displaystyle false",(mstyle && mstyle.getAttribute('displaystyle') === 'false'))
]; which would be one test file with each part tested separately. |
catch (err) {check = false}; | ||
return [ | ||
newScriptReftestResult("Check displaystyle and scriptlevel changes in toMathML() output", | ||
check), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't want the final comma, since that will fail in IE < 9.
How about now? |
Looks good. The copyright date could be changed and scriptlevel and displaystyle shouldn't be capitalized now that they are not the beginning of the sentence, but I wouldn't worry about those. I'll merge... |
No description provided.