Skip to content

Commit

Permalink
add test for mathjax/MathJax#1002 test SVG output inheriting currentC…
Browse files Browse the repository at this point in the history
…olor
  • Loading branch information
pkra committed Jan 20, 2015
1 parent 1ba9ea1 commit ff754bd
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
45 changes: 45 additions & 0 deletions testsuite/MathMLToDisplay/General/Colors/issue1002.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<title>Test SVG output inherting color</title>
<!-- Copyright (c) 2015 MathJax Consortium
License: Apache License 2.0 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="../../../header.js"></script>
<script type="text/javascript" src="../../../scriptTests.js"></script>
<script type="text/javascript">
function getTestCases() {
var path = document.querySelectorAll('g')[0];
var check1 = (path.getAttribute('fill') === 'currentColor' & path.getAttribute('stroke') === 'currentColor');
var computedColor = window.getComputedStyle(path).color;
var check2 = (computedColor === 'rgb(255, 0, 0)');
return [
newScriptReftestResult("Check if fill and stroke are set to currentColor",
check1),
newScriptReftestResult("Check if color is inherited by MathJax output",
check2),
];
}
</script>
<style>
body{
color:rgb(255, 0, 0);
}
</style>
</head>

<body>

<!--
Test if SVG output inherits text color. See issue 1002
https://github.com/mathjax/MathJax/issues/1002 -->
<div>
<math>
<mrow>
<mi>x</mi><mo>+</mo><mn>1</mn>
</mrow>
</math>
</div>

</body>
</html>
2 changes: 2 additions & 0 deletions testsuite/MathMLToDisplay/General/Colors/reftest.list
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ annotate(@note1) fails-if(Opera&&SVG) == mathbackground-5b.html mathbackground-5
!= mathcolor-2.html mathcolor-2-ref.html
!= mathcolor-3.html mathcolor-3-ref.html
== mathcolor-4.html mathcolor-4-ref.html

require(SVG) script issue1002.html

0 comments on commit ff754bd

Please sign in to comment.