OLD | NEW |
1 // [Name] SVGFEComponentTransferElement-svgdom-intercept-prop.js | 1 // [Name] SVGFEComponentTransferElement-svgdom-intercept-prop.js |
2 // [Expected rendering result] An image with feComponentTransfer filter - and a
series of PASS messages | 2 // [Expected rendering result] An image with feComponentTransfer filter - and a
series of PASS messages |
3 | 3 |
4 description("Tests dynamic updates of the 'intercept' property of the SVGFECompo
nentTransferElement object") | 4 description("Tests dynamic updates of the 'intercept' property of the SVGFECompo
nentTransferElement object") |
5 createSVGTestCase(); | 5 createSVGTestCase(); |
6 | 6 |
7 var feRFunc = createSVGElement("feFuncR"); | 7 var feRFunc = createSVGElement("feFuncR"); |
8 feRFunc.setAttribute("type", "linear"); | 8 feRFunc.setAttribute("type", "linear"); |
9 feRFunc.setAttribute("intercept", "0.2"); | 9 feRFunc.setAttribute("intercept", "0.2"); |
10 | 10 |
11 var feGFunc = createSVGElement("feFuncG"); | 11 var feGFunc = createSVGElement("feFuncG"); |
12 feGFunc.setAttribute("type", "linear"); | 12 feGFunc.setAttribute("type", "linear"); |
13 feGFunc.setAttribute("intercept", "0.2"); | 13 feGFunc.setAttribute("intercept", "0.2"); |
14 | 14 |
15 var feBFunc = createSVGElement("feFuncB"); | 15 var feBFunc = createSVGElement("feFuncB"); |
16 feBFunc.setAttribute("type", "linear"); | 16 feBFunc.setAttribute("type", "linear"); |
17 feBFunc.setAttribute("intercept", "0.2"); | 17 feBFunc.setAttribute("intercept", "0.2"); |
18 | 18 |
19 var feAFunc = createSVGElement("feFuncA"); | 19 var feAFunc = createSVGElement("feFuncA"); |
20 feAFunc.setAttribute("type", "linear"); | 20 feAFunc.setAttribute("type", "linear"); |
21 feAFunc.setAttribute("intercept", "0.2"); | 21 feAFunc.setAttribute("intercept", "0.2"); |
22 | 22 |
23 var feCompnentTransferElement = createSVGElement("feComponentTransfer"); | 23 var feComponentTransferElement = createSVGElement("feComponentTransfer"); |
24 feCompnentTransferElement.appendChild(feRFunc); | 24 feComponentTransferElement.appendChild(feRFunc); |
25 feCompnentTransferElement.appendChild(feGFunc); | 25 feComponentTransferElement.appendChild(feGFunc); |
26 feCompnentTransferElement.appendChild(feBFunc); | 26 feComponentTransferElement.appendChild(feBFunc); |
27 feCompnentTransferElement.appendChild(feAFunc); | 27 feComponentTransferElement.appendChild(feAFunc); |
28 | 28 |
29 var compTranFilter = createSVGElement("filter"); | 29 var compTranFilter = createSVGElement("filter"); |
30 compTranFilter.setAttribute("id", "compTranFilter"); | 30 compTranFilter.setAttribute("id", "compTranFilter"); |
31 compTranFilter.setAttribute("filterUnits", "objectBoundingBox"); | 31 compTranFilter.setAttribute("filterUnits", "objectBoundingBox"); |
32 compTranFilter.setAttribute("x", "0%"); | 32 compTranFilter.setAttribute("x", "0%"); |
33 compTranFilter.setAttribute("y", "0%"); | 33 compTranFilter.setAttribute("y", "0%"); |
34 compTranFilter.setAttribute("width", "100%"); | 34 compTranFilter.setAttribute("width", "100%"); |
35 compTranFilter.setAttribute("height", "100%"); | 35 compTranFilter.setAttribute("height", "100%"); |
36 compTranFilter.appendChild(feCompnentTransferElement); | 36 compTranFilter.appendChild(feComponentTransferElement); |
37 | 37 |
38 var defsElement = createSVGElement("defs"); | 38 var defsElement = createSVGElement("defs"); |
39 defsElement.appendChild(compTranFilter); | 39 defsElement.appendChild(compTranFilter); |
40 rootSVGElement.appendChild(defsElement); | 40 rootSVGElement.appendChild(defsElement); |
41 | 41 |
42 var imageElement = createSVGElement("image"); | 42 var imageElement = createSVGElement("image"); |
43 imageElement.setAttributeNS(xlinkNS, "xlink:href", "../W3C-SVG-1.1/resources/str
uct-image-01.png"); | 43 imageElement.setAttributeNS(xlinkNS, "xlink:href", "../W3C-SVG-1.1/resources/str
uct-image-01.png"); |
44 imageElement.setAttribute("width", "400"); | 44 imageElement.setAttribute("width", "400"); |
45 imageElement.setAttribute("height", "200"); | 45 imageElement.setAttribute("height", "200"); |
46 imageElement.setAttribute("preserveAspectRatio", "none"); | 46 imageElement.setAttribute("preserveAspectRatio", "none"); |
(...skipping 14 matching lines...) Expand all Loading... |
61 feBFunc.intercept.baseVal = 0.1; | 61 feBFunc.intercept.baseVal = 0.1; |
62 feAFunc.intercept.baseVal = 0.1; | 62 feAFunc.intercept.baseVal = 0.1; |
63 | 63 |
64 shouldBe("Math.round(feRFunc.intercept.baseVal * 100)", "10"); | 64 shouldBe("Math.round(feRFunc.intercept.baseVal * 100)", "10"); |
65 shouldBe("Math.round(feGFunc.intercept.baseVal * 100)", "10"); | 65 shouldBe("Math.round(feGFunc.intercept.baseVal * 100)", "10"); |
66 shouldBe("Math.round(feBFunc.intercept.baseVal * 100)", "10"); | 66 shouldBe("Math.round(feBFunc.intercept.baseVal * 100)", "10"); |
67 shouldBe("Math.round(feAFunc.intercept.baseVal * 100)", "10"); | 67 shouldBe("Math.round(feAFunc.intercept.baseVal * 100)", "10"); |
68 } | 68 } |
69 | 69 |
70 var successfullyParsed = true; | 70 var successfullyParsed = true; |
OLD | NEW |