blob: 93e0ad2d7668a6c37493c926ab5d7cb7078dacb7 [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] SVGTextElement-svgdom-textLength-prop.js
// [Expected rendering result] Text streteched using spaces with a length of 200 - and a series of PASS messages
description("Tests dynamic updates of the 'textLength' property of the SVGTextElement object")
createSVGTestCase();
var textElement = createSVGElement("text");
textElement.setAttribute("x", "0");
textElement.setAttribute("y", "215");
textElement.textContent = "Stretched text";
rootSVGElement.appendChild(textElement);
shouldBeNull("textElement.getAttribute('textLength')");
shouldBeTrue("lastLength = textElement.getComputedTextLength(); lastLength > 0 && lastLength < 200");
shouldBeTrue("lastLength == textElement.textLength.baseVal.value");
function repaintTest() {
textElement.textLength.baseVal.value = 200;
shouldBeEqualToString("textElement.getAttribute('textLength')", "200");
shouldBe("textElement.textLength.baseVal.value", "200");
shouldBeTrue("textElement.getComputedTextLength() == lastLength");
completeTest();
}
var successfullyParsed = true;
</script>
</body>
</html>