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

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

Issue 447193002: Add support for additional blend modes to SVGFEBlendElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
(Empty)
1 <!DOCTYPE html>
2 <style>
3 .group {
4 width: 400px;
5 }
6 </style>
7 <body></body>
8 <script>
9 function createSvgElement(name, attributes) {
10 var element = document.createElementNS('http://www.w3.org/2000/svg', name);
11 for (var attrName in attributes)
12 element.setAttribute(attrName, attributes[attrName]);
13 return element;
14 }
15
16 const blendModes = [
17 "normal",
18 "multiply",
19 "screen",
20 "darken",
21 "lighten",
22 "overlay",
23 "color-dodge",
24 "color-burn",
25 "hard-light",
26 "soft-light",
27 "difference",
28 "exclusion",
29 "hue",
30 "saturation",
31 "color",
32 "luminosity"
33 ];
34
35 [
36 {a: 'rgb(255,0,0)', b: 'rgb(0,255,0)' },
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)' },
39 ].forEach(function(colors) {
40 var group = document.createElement('div');
41 group.className = 'group';
42 document.body.appendChild(group);
43
44 blendModes.forEach(function(mode, i) {
45 var filterId = 'f_' + mode;
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 }));
48 filter.appendChild(createSvgElement('feFlood', { result: 'b', 'flood-color': colors.b }));
49 filter.appendChild(createSvgElement('feBlend', { in: 'a', in2: 'b', mode: mo de }));
50 var svgRoot = createSvgElement('svg', { width: '50', height: '50' });
51 var rect = createSvgElement('rect', { width: 50, height: 50, filter: 'url(#' + filterId + ')' });
52 svgRoot.appendChild(filter);
53 svgRoot.appendChild(rect);
54 group.appendChild(svgRoot);
55 });
56 });
57 </script>
OLDNEW
« no previous file with comments | « LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration-SVGFEBlendElement.js ('k') | Source/core/svg/SVGEnumeration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698