blob: 170386aa41c541f55c6e43bfb4d8049e57ba0d95 [file] [log] [blame]
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg xmlns="http://www.w3.org/2000/svg" onload="runTest()">
<script>
<![CDATA[
function log(string) {
var newDiv = document.createElementNS("http://www.w3.org/1999/xhtml", "div");
newDiv.textContent = string;
document.getElementById('log').appendChild(newDiv);
}
function runTest()
{
if (window.layoutTestController)
layoutTestController.dumpAsText();
var rect = document.getElementById("secondrect");
var fill = rect.getPresentationAttribute("fill");
if (fill == null) {
log("Failed getting the fill PA");
return;
}
fill.setRGBColor("green");
rect = document.getElementById("firstrect");
fill = rect.getPresentationAttribute("fill");
if (fill.cssText != '#FF0000') {
log("Changing fill PA should not change firstrect fill PA");
return;
}
rect = document.getElementById("secondrect");
fill = rect.getPresentationAttribute("fill");
fill.setRGBColor("blue");
rect = document.getElementById("thirdrect");
fill = rect.getPresentationAttribute("fill");
if (fill.cssText != '#008000') {
log("Changing fill PA should not change thirdrect fill PA");
return;
}
log("Passed");
}
]]>
</script>
<foreignObject>
<html xmlns="http://www.w3.org/1999/xhtml">
<div id="log">
This test tests that getting a CSSValue using getPresentationAttribute
and then changing that value does not influence other presentation
attributes that share that value.
See <a href="http://bugs.webkit.org/show_bug.cgi?id=18512">Bug 18512</a>.
</div>
</html>
</foreignObject>
<rect id="firstrect" x="100" y="100" width="100" height="100" fill="red" />
<rect id="secondrect" x="100" y="250" width="100" height="100" fill="red" />
<rect id="thirdrect" x="100" y="400" width="100" height="100" fill="green" />
</svg>