blob: 845758f2e6002b8229cb08e0608c52214e7fbc69 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("This test checks the currentColor value on the color property");
// Setup a real SVG document, as we want to access CSS style information.
var svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
svgElement.setAttribute("width", "150");
svgElement.setAttribute("height", "50");
var gElement = document.createElementNS("http://www.w3.org/2000/svg", "g");
gElement.setAttribute("style", "color: green");
svgElement.appendChild(gElement);
var rectElement = document.createElementNS("http://www.w3.org/2000/svg", "rect");
rectElement.setAttribute("color", "currentColor");
rectElement.setAttribute("fill", "currentColor");
gElement.appendChild(rectElement);
document.getElementById("description").appendChild(svgElement);
shouldBeEqualToString("getComputedStyle(rectElement).color", "rgb(0, 128, 0)");
successfullyParsed = true;
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>