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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/filters/feBlend-all-modes.html

Issue 2703803003: Use unique id's in svg/filters/feBlend-all-modes.html (Closed)
Patch Set: Updated expectations Created 3 years, 10 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <style> 2 <style>
3 .group { 3 .group {
4 width: 400px; 4 width: 400px;
5 } 5 }
6 </style> 6 </style>
7 <body></body> 7 <body></body>
8 <script> 8 <script>
9 function createSvgElement(name, attributes) { 9 function createSvgElement(name, attributes) {
10 var element = document.createElementNS('http://www.w3.org/2000/svg', name); 10 var element = document.createElementNS('http://www.w3.org/2000/svg', name);
(...skipping 18 matching lines...) Expand all
29 "hue", 29 "hue",
30 "saturation", 30 "saturation",
31 "color", 31 "color",
32 "luminosity" 32 "luminosity"
33 ]; 33 ];
34 34
35 [ 35 [
36 {a: 'rgb(255,0,0)', b: 'rgb(0,255,0)' }, 36 {a: 'rgb(255,0,0)', b: 'rgb(0,255,0)' },
37 {a: 'rgb(51,64,204)', b: 'rgb(153,192,102)' }, 37 {a: 'rgb(51,64,204)', b: 'rgb(153,192,102)' },
38 {a: 'rgba(51,64,204,0.5)', b: 'rgba(153,192,102,0.5)' }, 38 {a: 'rgba(51,64,204,0.5)', b: 'rgba(153,192,102,0.5)' },
39 ].forEach(function(colors) { 39 ].forEach(function(colors, groupNr) {
40 var group = document.createElement('div'); 40 var group = document.createElement('div');
41 group.className = 'group'; 41 group.className = 'group';
42 document.body.appendChild(group); 42 document.body.appendChild(group);
43 43
44 blendModes.forEach(function(mode, i) { 44 blendModes.forEach(function(mode) {
45 var filterId = 'f_' + mode; 45 var filterId = 'f_' + mode + groupNr;
46 var filter = createSvgElement('filter', { id: filterId, x: 0, y: 0, width: 1 , height: 1 }); 46 var filter = createSvgElement('filter', { id: filterId, x: 0, y: 0, width: 1 , height: 1 });
47 filter.appendChild(createSvgElement('feFlood', { result: 'a', 'flood-color': colors.a })); 47 filter.appendChild(createSvgElement('feFlood', { result: 'a', 'flood-color': colors.a }));
48 filter.appendChild(createSvgElement('feFlood', { result: 'b', 'flood-color': colors.b })); 48 filter.appendChild(createSvgElement('feFlood', { result: 'b', 'flood-color': colors.b }));
49 filter.appendChild(createSvgElement('feBlend', { in: 'a', in2: 'b', mode: mo de })); 49 filter.appendChild(createSvgElement('feBlend', { in: 'a', in2: 'b', mode: mo de }));
50 var svgRoot = createSvgElement('svg', { width: '50', height: '50' }); 50 var svgRoot = createSvgElement('svg', { width: '50', height: '50' });
51 var rect = createSvgElement('rect', { width: 50, height: 50, filter: 'url(#' + filterId + ')' }); 51 var rect = createSvgElement('rect', { width: 50, height: 50, filter: 'url(#' + filterId + ')' });
52 svgRoot.appendChild(filter); 52 svgRoot.appendChild(filter);
53 svgRoot.appendChild(rect); 53 svgRoot.appendChild(rect);
54 group.appendChild(svgRoot); 54 group.appendChild(svgRoot);
55 }); 55 });
56 }); 56 });
57 </script> 57 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698