blob: 1f13ecb83ac4e605ec933d2eacaec0b11f8c85b6 [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 width="450" height="450" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="Gradient" gradientUnits="userSpaceOnUse" x1="10" y1="10" x2="440" y2="10">
<stop id="stop1" stop-color="blue" offset="0"/>
<stop stop-color="red" offset="1"/>
</linearGradient>
</defs>
<script>
if (window.layoutTestController)
layoutTestController.waitUntilDone();
window.setTimeout("clickNow()", 0);
function clickNow() {
if (window.eventSender) {
eventSender.mouseMoveTo(150, 50);
eventSender.mouseDown();
eventSender.mouseUp();
}
if (window.layoutTestController) {
layoutTestController.notifyDone();
}
}
function mouseHandler(evt)
{
var gradient = document.getElementById("Gradient");
var stop = document.getElementById("stop1");
if(gradient.x1.baseVal.value == 150) {
gradient.setAttribute("x1", "10");
stop.setAttribute("stop-color", "blue");
stop.setAttribute("stop-opacity", "1.0");
stop.setAttribute("offset", "0");
} else {
gradient.x1.baseVal.value = 150;
stop.setAttribute("stop-color", "green");
stop.setAttribute("stop-opacity", "0.5");
stop.setAttribute("offset", "0.3");
}
}
</script>
<rect onclick="mouseHandler(evt)" x="10" y="10" width="430" height="80" fill="url(#Gradient)" />
<rect x="10" y="100" width="430" height="80" fill="url(#Gradient)" />
</svg>