Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: LayoutTests/svg/dynamic-updates/script-tests/SVGFESpotLightElement-dom-pointsAtY-attr.js

Issue 181943003: Scaling and offset fix for FELighting (software and skia paths) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changed fix to temporary light creation Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // [Name] SVGFESpotLightElement-dom-pointsAtY-attr.js 1 // [Name] SVGFESpotLightElement-dom-pointsAtY-attr.js
2 // [Expected rendering result] A shining cone (performed by diffuse lighting) - and a series of PASS messages 2 // [Expected rendering result] A shining cone (performed by diffuse lighting) - and a series of PASS messages
3 3
4 description("Tests dynamic updates of the 'pointsAtY' attribute of the SVGFESpot LightElement object") 4 description("Tests dynamic updates of the 'pointsAtY' attribute of the SVGFESpot LightElement object")
5 createSVGTestCase(); 5 createSVGTestCase();
6 6
7 var spotLightElement = createSVGElement("feSpotLight"); 7 var spotLightElement = createSVGElement("feSpotLight");
8 spotLightElement.setAttribute("x", "113"); 8 spotLightElement.setAttribute("x", "83");
9 spotLightElement.setAttribute("y", "0"); 9 spotLightElement.setAttribute("y", "-30");
10 spotLightElement.setAttribute("z", "100"); 10 spotLightElement.setAttribute("z", "100");
11 spotLightElement.setAttribute("pointsAtX", "113"); 11 spotLightElement.setAttribute("pointsAtX", "83");
12 spotLightElement.setAttribute("pointsAtY", "0"); 12 spotLightElement.setAttribute("pointsAtY", "-30");
13 spotLightElement.setAttribute("pointsAtZ", "0"); 13 spotLightElement.setAttribute("pointsAtZ", "0");
14 spotLightElement.setAttribute("specularExponent", "1"); 14 spotLightElement.setAttribute("specularExponent", "1");
15 spotLightElement.setAttribute("limitingConeAngle", "15"); 15 spotLightElement.setAttribute("limitingConeAngle", "15");
16 16
17 var gradientElement = createSVGElement("feDiffuseLighting"); 17 var gradientElement = createSVGElement("feDiffuseLighting");
18 gradientElement.setAttribute("surfaceScale", "1"); 18 gradientElement.setAttribute("surfaceScale", "1");
19 gradientElement.setAttribute("diffuseConstant", "1"); 19 gradientElement.setAttribute("diffuseConstant", "1");
20 gradientElement.setAttribute("lighting-color", "aqua"); 20 gradientElement.setAttribute("lighting-color", "aqua");
21 gradientElement.appendChild(spotLightElement); 21 gradientElement.appendChild(spotLightElement);
22 22
23 var filterElement = createSVGElement("filter"); 23 var filterElement = createSVGElement("filter");
24 filterElement.setAttribute("id", "myFilter"); 24 filterElement.setAttribute("id", "myFilter");
25 filterElement.setAttribute("filterUnits", "userSpaceOnUse"); 25 filterElement.setAttribute("filterUnits", "userSpaceOnUse");
26 filterElement.setAttribute("width", "200"); 26 filterElement.setAttribute("width", "200");
27 filterElement.setAttribute("height", "200"); 27 filterElement.setAttribute("height", "200");
28 filterElement.appendChild(gradientElement); 28 filterElement.appendChild(gradientElement);
29 29
30 var defsElement = createSVGElement("defs"); 30 var defsElement = createSVGElement("defs");
31 defsElement.appendChild(filterElement); 31 defsElement.appendChild(filterElement);
32 32
33 rootSVGElement.appendChild(defsElement); 33 rootSVGElement.appendChild(defsElement);
34 34
35 var rectElement = createSVGElement("rect"); 35 var rectElement = createSVGElement("rect");
36 rectElement.setAttribute("width", "200"); 36 rectElement.setAttribute("width", "200");
37 rectElement.setAttribute("height", "200"); 37 rectElement.setAttribute("height", "200");
38 rectElement.setAttribute("filter", "url(#myFilter)"); 38 rectElement.setAttribute("filter", "url(#myFilter)");
39 rootSVGElement.appendChild(rectElement); 39 rootSVGElement.appendChild(rectElement);
40 40
41 shouldBeEqualToString("spotLightElement.getAttribute('pointsAtY')", "0"); 41 shouldBeEqualToString("spotLightElement.getAttribute('pointsAtY')", "-30");
42 42
43 function repaintTest() { 43 function repaintTest() {
44 spotLightElement.setAttribute("pointsAtY", "100"); 44 spotLightElement.setAttribute("pointsAtY", "70");
45 shouldBeEqualToString("spotLightElement.getAttribute('pointsAtY')", "100"); 45 shouldBeEqualToString("spotLightElement.getAttribute('pointsAtY')", "70");
46 46
47 completeTest(); 47 completeTest();
48 } 48 }
49 49
50 50
51 var successfullyParsed = true; 51 var successfullyParsed = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698