blob: 33386e520573920fbdd6db98b0193e0a58b50732 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="resources/SVGTestCase.js"></script>
<script src="../../resources/js-test-pre.js"></script>
<script src="../../fast/repaint/resources/repaint.js"></script>
</head>
<body onload="runRepaintTest()">
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
<script>
// [Name] SVGImageElement-dom-preserveAspectRatio-attr.js
// [Expected rendering result] image at 0x0 size 100x200, needs to fit exactly in destination bbox (aka. preserveAspectRatio=none) - and a series of PASS messages
description("Tests dynamic updates of the 'preserveAspectRatio' attribute of the SVGImageElement object")
createSVGTestCase();
var imageElement = createSVGElement("image");
imageElement.setAttributeNS(xlinkNS, "xlink:href", "../custom/resources/green-checker.png");
imageElement.setAttribute("preserveAspectRatio", "xMaxYMax meet");
imageElement.setAttribute("x", "0");
imageElement.setAttribute("y", "0");
imageElement.setAttribute("width", "100");
imageElement.setAttribute("height", "200");
rootSVGElement.appendChild(imageElement);
shouldBeEqualToString("imageElement.getAttribute('preserveAspectRatio')", "xMaxYMax meet");
function repaintTest() {
imageElement.setAttribute("preserveAspectRatio", "none");
shouldBeEqualToString("imageElement.getAttribute('preserveAspectRatio')", "none");
completeTest();
}
var successfullyParsed = true;
</script>
</body>
</html>