1<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="runTest()">
2<rect id="foo" color="green" fill="currentColor" width="100" height="100"/>
3<foreignObject>
4<html xmlns="http://www.w3.org/1999/xhtml">
5 <body>
6 <div id="log">
7 </div>
8 </body>
9</html>
10</foreignObject>
11<script> <![CDATA[
12 if (window.layoutTestController)
13 layoutTestController.dumpAsText();
14
15 function log(string) {
16 var newDiv = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
17 newDiv.textContent = string;
18 document.getElementById('log').appendChild(newDiv);
19 }
20
21 function runTest()
22 {
23 var element = document.getElementById('foo');
24 if (element.getPresentationAttribute('color') instanceof SVGColor &&
25 document.defaultView.getComputedStyle(element).getPropertyValue('color') == 'rgb(0, 128, 0)')
26 log('PASS');
27 else
28 log('FAIL');
29 }
30]]></script>
31</svg>