Commit e1388118 authored by zimmermann@webkit.org's avatar zimmermann@webkit.org

Reviewed by Oliver.

Add new dynamic-update layout tests covering SVGImageElement.
Fix bug: SVGImageElement doesn't react on 'preserveAspectRatio' changes.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35679 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2f2cde3f
2008-08-12 Nikolas Zimmermann <zimmermann@kde.org>
Reviewed by Oliver.
Add new dynamic-update layout tests covering SVGImageElement.
Fix bug: SVGImageElement doesn't react on 'preserveAspectRatio' changes.
* platform/mac/svg/dynamic-updates/SVGImageElement-dom-height-attr-expected.checksum: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-dom-height-attr-expected.png: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-dom-preserveAspectRatio-attr-expected.checksum: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-dom-preserveAspectRatio-attr-expected.png: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-dom-width-attr-expected.checksum: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-dom-width-attr-expected.png: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-dom-x-attr-expected.checksum: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-dom-x-attr-expected.png: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-dom-y-attr-expected.checksum: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-dom-y-attr-expected.png: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-svgdom-height-prop-expected.checksum: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-svgdom-height-prop-expected.png: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-svgdom-preserveAspectRatio-prop-expected.checksum: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-svgdom-preserveAspectRatio-prop-expected.png: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-svgdom-width-prop-expected.checksum: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-svgdom-width-prop-expected.png: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-svgdom-x-prop-expected.checksum: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-svgdom-x-prop-expected.png: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-svgdom-y-prop-expected.checksum: Added.
* platform/mac/svg/dynamic-updates/SVGImageElement-svgdom-y-prop-expected.png: Added.
* svg/dynamic-updates/SVGImageElement-dom-height-attr-expected.txt: Added.
* svg/dynamic-updates/SVGImageElement-dom-height-attr.html: Added.
* svg/dynamic-updates/SVGImageElement-dom-preserveAspectRatio-attr-expected.txt: Added.
* svg/dynamic-updates/SVGImageElement-dom-preserveAspectRatio-attr.html: Added.
* svg/dynamic-updates/SVGImageElement-dom-width-attr-expected.txt: Added.
* svg/dynamic-updates/SVGImageElement-dom-width-attr.html: Added.
* svg/dynamic-updates/SVGImageElement-dom-x-attr-expected.txt: Added.
* svg/dynamic-updates/SVGImageElement-dom-x-attr.html: Added.
* svg/dynamic-updates/SVGImageElement-dom-y-attr-expected.txt: Added.
* svg/dynamic-updates/SVGImageElement-dom-y-attr.html: Added.
* svg/dynamic-updates/SVGImageElement-svgdom-height-prop-expected.txt: Added.
* svg/dynamic-updates/SVGImageElement-svgdom-height-prop.html: Added.
* svg/dynamic-updates/SVGImageElement-svgdom-preserveAspectRatio-prop-expected.txt: Added.
* svg/dynamic-updates/SVGImageElement-svgdom-preserveAspectRatio-prop.html: Added.
* svg/dynamic-updates/SVGImageElement-svgdom-width-prop-expected.txt: Added.
* svg/dynamic-updates/SVGImageElement-svgdom-width-prop.html: Added.
* svg/dynamic-updates/SVGImageElement-svgdom-x-prop-expected.txt: Added.
* svg/dynamic-updates/SVGImageElement-svgdom-x-prop.html: Added.
* svg/dynamic-updates/SVGImageElement-svgdom-y-prop-expected.txt: Added.
* svg/dynamic-updates/SVGImageElement-svgdom-y-prop.html: Added.
* svg/dynamic-updates/resources/SVGImageElement-dom-height-attr.js: Added.
* svg/dynamic-updates/resources/SVGImageElement-dom-preserveAspectRatio-attr.js: Added.
* svg/dynamic-updates/resources/SVGImageElement-dom-width-attr.js: Added.
* svg/dynamic-updates/resources/SVGImageElement-dom-x-attr.js: Added.
* svg/dynamic-updates/resources/SVGImageElement-dom-y-attr.js: Added.
* svg/dynamic-updates/resources/SVGImageElement-svgdom-height-prop.js: Added.
* svg/dynamic-updates/resources/SVGImageElement-svgdom-preserveAspectRatio-prop.js: Added.
* svg/dynamic-updates/resources/SVGImageElement-svgdom-width-prop.js: Added.
* svg/dynamic-updates/resources/SVGImageElement-svgdom-x-prop.js: Added.
* svg/dynamic-updates/resources/SVGImageElement-svgdom-y-prop.js: Added.
2008-08-11 Nikolas Zimmermann <zimmermann@kde.org>
Rubber stamped by Oliver.
......
SVG 1.1 dynamic update tests
Tests dynamic updates of the 'height' attribute of the SVGImageElement object
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS imageElement.getAttribute('height') is "100"
PASS imageElement.getAttribute('height') is "200"
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="resources/SVGTestCase.js"></script>
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
<script src="resources/SVGImageElement-dom-height-attr.js"></script>
</body>
</html>
SVG 1.1 dynamic update tests
Tests dynamic updates of the 'preserveAspectRatio' attribute of the SVGImageElement object
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS imageElement.getAttribute('preserveAspectRatio') is "xMaxYMax meet"
PASS imageElement.getAttribute('preserveAspectRatio') is "none"
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="resources/SVGTestCase.js"></script>
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
<script src="resources/SVGImageElement-dom-preserveAspectRatio-attr.js"></script>
</body>
</html>
SVG 1.1 dynamic update tests
Tests dynamic updates of the 'width' attribute of the SVGImageElement object
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS imageElement.getAttribute('width') is "100"
PASS imageElement.getAttribute('width') is "200"
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="resources/SVGTestCase.js"></script>
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
<script src="resources/SVGImageElement-dom-width-attr.js"></script>
</body>
</html>
SVG 1.1 dynamic update tests
Tests dynamic updates of the 'x' attribute of the SVGImageElement object
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS imageElement.getAttribute('x') is "-190"
PASS imageElement.getAttribute('x') is "0"
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="resources/SVGTestCase.js"></script>
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
<script src="resources/SVGImageElement-dom-x-attr.js"></script>
</body>
</html>
SVG 1.1 dynamic update tests
Tests dynamic updates of the 'y' attribute of the SVGImageElement object
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS imageElement.getAttribute('y') is "-190"
PASS imageElement.getAttribute('y') is "0"
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="resources/SVGTestCase.js"></script>
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
<script src="resources/SVGImageElement-dom-y-attr.js"></script>
</body>
</html>
SVG 1.1 dynamic update tests
Tests dynamic updates of the 'height' property of the SVGImageElement object
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS imageElement.height.baseVal.value is 100
PASS imageElement.height.baseVal.value is 200
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="resources/SVGTestCase.js"></script>
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
<script src="resources/SVGImageElement-svgdom-height-prop.js"></script>
</body>
</html>
SVG 1.1 dynamic update tests
Tests dynamic updates of the 'preserveAspectRatio' property of the SVGImageElement object
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS imageElement.preserveAspectRatio.baseVal.align is SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_XMAXYMAX
PASS imageElement.preserveAspectRatio.baseVal.meetOrSlice is SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET
PASS imageElement.preserveAspectRatio.baseVal.align is SVGPreserveAspectRatio.SVG_PRESERVEASPECTRATIO_NONE
PASS imageElement.preserveAspectRatio.baseVal.meetOrSlice is SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="resources/SVGTestCase.js"></script>
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
<script src="resources/SVGImageElement-svgdom-preserveAspectRatio-prop.js"></script>
</body>
</html>
SVG 1.1 dynamic update tests
Tests dynamic updates of the 'width' property of the SVGImageElement object
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS imageElement.width.baseVal.value is 100
PASS imageElement.width.baseVal.value is 200
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="resources/SVGTestCase.js"></script>
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
<script src="resources/SVGImageElement-svgdom-width-prop.js"></script>
</body>
</html>
SVG 1.1 dynamic update tests
Tests dynamic updates of the 'x' property of the SVGImageElement object
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS imageElement.x.baseVal.value is -190
PASS imageElement.x.baseVal.value is 0
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="resources/SVGTestCase.js"></script>
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
<script src="resources/SVGImageElement-svgdom-x-prop.js"></script>
</body>
</html>
SVG 1.1 dynamic update tests
Tests dynamic updates of the 'y' property of the SVGImageElement object
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS imageElement.y.baseVal.value is -190
PASS imageElement.y.baseVal.value is 0
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="resources/SVGTestCase.js"></script>
<script src="../../fast/js/resources/js-test-pre.js"></script>
</head>
<body>
<h1>SVG 1.1 dynamic update tests</h1>
<p id="description"></p>
<div id="console"></div>
<script src="resources/SVGImageElement-svgdom-y-prop.js"></script>
</body>
</html>
// [Name] SVGImageElement-dom-height-attr.js
// [Expected rendering result] image at 0x0 size 200x200 - and a series of PASS mesages
description("Tests dynamic updates of the 'height' attribute of the SVGImageElement object")
createSVGTestCase();
var imageElement = createSVGElement("image");
imageElement.setAttributeNS(xlinkNS, "xlink:href", "../custom/resources/green-checker.png");
imageElement.setAttribute("preserveAspectRatio", "none");
imageElement.setAttribute("x", "0");
imageElement.setAttribute("y", "0");
imageElement.setAttribute("width", "200");
imageElement.setAttribute("height", "100");
rootSVGElement.appendChild(imageElement);
shouldBeEqualToString("imageElement.getAttribute('height')", "100");
function executeTest() {
imageElement.setAttribute("height", "200");
shouldBeEqualToString("imageElement.getAttribute('height')", "200");
completeTest();
}
startTest(imageElement, 150, 50);
// [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 mesages
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 executeTest() {
imageElement.setAttribute("preserveAspectRatio", "none");
shouldBeEqualToString("imageElement.getAttribute('preserveAspectRatio')", "none");
completeTest();
}
startTest(imageElement, 50, 150);
// [Name] SVGImageElement-dom-width-attr.js
// [Expected rendering result] image at 0x0 size 200x200 - and a series of PASS mesages
description("Tests dynamic updates of the 'width' attribute of the SVGImageElement object")
createSVGTestCase();
var imageElement = createSVGElement("image");
imageElement.setAttributeNS(xlinkNS, "xlink:href", "../custom/resources/green-checker.png");
imageElement.setAttribute("preserveAspectRatio", "none");
imageElement.setAttribute("x", "0");
imageElement.setAttribute("y", "0");
imageElement.setAttribute("width", "100");
imageElement.setAttribute("height", "200");
rootSVGElement.appendChild(imageElement);
shouldBeEqualToString("imageElement.getAttribute('width')", "100");
function executeTest() {
imageElement.setAttribute("width", "200");
shouldBeEqualToString("imageElement.getAttribute('width')", "200");
completeTest();
}
startTest(imageElement, 50, 150);
// [Name] SVGImageElement-dom-x-attr.js
// [Expected rendering result] image at 0x0 size 200x200 - and a series of PASS mesages
description("Tests dynamic updates of the 'x' attribute of the SVGImageElement object")
createSVGTestCase();
var imageElement = createSVGElement("image");
imageElement.setAttributeNS(xlinkNS, "xlink:href", "../custom/resources/green-checker.png");
imageElement.setAttribute("preserveAspectRatio", "none");
imageElement.setAttribute("x", "-190");
imageElement.setAttribute("y", "0");
imageElement.setAttribute("width", "200");
imageElement.setAttribute("height", "200");
rootSVGElement.appendChild(imageElement);
shouldBeEqualToString("imageElement.getAttribute('x')", "-190");
function executeTest() {
imageElement.setAttribute("x", "0");
shouldBeEqualToString("imageElement.getAttribute('x')", "0");
completeTest();
}
startTest(imageElement, 5, 100);
// [Name] SVGImageElement-dom-y-attr.js
// [Expected rendering result] image at 0x0 size 200x200 - and a series of PASS mesages
description("Tests dynamic updates of the 'y' attribute of the SVGImageElement object")
createSVGTestCase();
var imageElement = createSVGElement("image");
imageElement.setAttributeNS(xlinkNS, "xlink:href", "../custom/resources/green-checker.png");
imageElement.setAttribute("preserveAspectRatio", "none");
imageElement.setAttribute("x", "0");
imageElement.setAttribute("y", "-190");
imageElement.setAttribute("width", "200");
imageElement.setAttribute("height", "200");
rootSVGElement.appendChild(imageElement);
shouldBeEqualToString("imageElement.getAttribute('y')", "-190");
function executeTest() {
imageElement.setAttribute("y", "0");
shouldBeEqualToString("imageElement.getAttribute('y')", "0");
completeTest();
}
startTest(imageElement, 100, 5);
// [Name] SVGImageElement-svgdom-height-prop.js
// [Expected rendering result] image at 0x0 size 200x200 - and a series of PASS mesages
description("Tests dynamic updates of the 'height' property of the SVGImageElement object")
createSVGTestCase();
var imageElement = createSVGElement("image");
imageElement.setAttributeNS(xlinkNS, "xlink:href", "../custom/resources/green-checker.png");
imageElement.setAttribute("preserveAspectRatio", "none");
imageElement.setAttribute("x", "0");
imageElement.setAttribute("y", "0");
imageElement.setAttribute("width", "200");
imageElement.setAttribute("height", "100");
rootSVGElement.appendChild(imageElement);
shouldBe("imageElement.height.baseVal.value", "100");
function executeTest() {
imageElement.height.baseVal.value = 200;
shouldBe("imageElement.height.baseVal.value", "200");
completeTest();
}
startTest(imageElement, 150, 50);
// [Name] SVGImageElement-svgdom-preserveAspectRatio-prop.js
// [Expected rendering result] image at 0x0 size 200x200 - and a series of PASS mesages
description("Tests dynamic updates of the 'preserveAspectRatio' property 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");