<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[195745] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/195745">195745</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-01-28 09:33:46 -0800 (Thu, 28 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[SVG] Add support for 'lighter' operator in feComposite
https://bugs.webkit.org/show_bug.cgi?id=141376

Patch by Nikos Andronikos &lt;nikos.andronikos-webkit@cisra.canon.com.au&gt; on 2016-01-28
Reviewed by Darin Adler.

Source/WebCore:

Added new cases where needed to support the lighter (aka 'plus')
Porter Duff operator in SVG Filter Effects.
https://www.w3.org/TR/filter-effects/#valdef-operator-lighter
Note that in the specification, no constant was added to the IDL for
the lighter operator.

Test: svg/filters/feCompositeOpaque.html
      svg/dom/script-tests/SVGAnimatedEnumeration-SVGFECompositeElement.js

* platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::platformApplySoftware):
  Add case to support lighter.
(WebCore::operator&lt;&lt;):
  Add case to support lighter for text stream operations.
* platform/graphics/filters/FEComposite.h:
  Add case for lighter to CompositeOperationType enum.
* svg/SVGFECompositeElement.h:
(WebCore::SVGIDLEnumLimits&lt;CompositeOperationType&gt;::highestExposedEnumValue):
  Higest exposed value is arithmetic - do not expose lighter.
(WebCore::SVGPropertyTraits&lt;CompositeOperationType&gt;::highestEnumValue):
  Highest possible value is now lighter.
(WebCore::SVGPropertyTraits&lt;CompositeOperationType&gt;::toString):
  Add case to support lighter.
(WebCore::SVGPropertyTraits&lt;CompositeOperationType&gt;::fromString):
  Add case to support lighter.

LayoutTests:

Add case to support lighter to DOM manipulation test for feComposite.
Add a new reftest that tests lighter case and supercedes older
pixel test for other modes.

* svg/dom/script-tests/SVGAnimatedEnumeration-SVGFECompositeElement.js:
  Test DOM read/write of SVGFEComposite operator property with new
  lighter mode.
* svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement-expected.txt:
* svg/filters/feCompositeOpaque.html: Added.
  A reftest that supersedes svg/filters/feComposite.svg
  That test used opacity 0.5 which resulted in differing colors
  across platforms. This makes it very hard to maintain the references
  but it's probably still useful as a regression test.
  This new test uses solid colors which result in consistency across
  platforms and allow a reftest to be used.
* svg/filters/feCompositeOpaque-expected.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestssvgdomSVGAnimatedEnumerationSVGFECompositeElementexpectedtxt">trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgdomscripttestsSVGAnimatedEnumerationSVGFECompositeElementjs">trunk/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration-SVGFECompositeElement.js</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFECompositecpp">trunk/Source/WebCore/platform/graphics/filters/FEComposite.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFECompositeh">trunk/Source/WebCore/platform/graphics/filters/FEComposite.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFECompositeElementh">trunk/Source/WebCore/svg/SVGFECompositeElement.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvgfiltersfeCompositeOpaqueexpectedhtml">trunk/LayoutTests/svg/filters/feCompositeOpaque-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgfiltersfeCompositeOpaquehtml">trunk/LayoutTests/svg/filters/feCompositeOpaque.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (195744 => 195745)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-01-28 17:30:00 UTC (rev 195744)
+++ trunk/LayoutTests/ChangeLog        2016-01-28 17:33:46 UTC (rev 195745)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2016-01-28  Nikos Andronikos  &lt;nikos.andronikos-webkit@cisra.canon.com.au&gt;
+
+        [SVG] Add support for 'lighter' operator in feComposite
+        https://bugs.webkit.org/show_bug.cgi?id=141376
+
+        Reviewed by Darin Adler.
+
+        Add case to support lighter to DOM manipulation test for feComposite.
+        Add a new reftest that tests lighter case and supercedes older
+        pixel test for other modes.
+
+        * svg/dom/script-tests/SVGAnimatedEnumeration-SVGFECompositeElement.js:
+          Test DOM read/write of SVGFEComposite operator property with new
+          lighter mode.
+        * svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement-expected.txt:
+        * svg/filters/feCompositeOpaque.html: Added.
+          A reftest that supersedes svg/filters/feComposite.svg
+          That test used opacity 0.5 which resulted in differing colors
+          across platforms. This makes it very hard to maintain the references
+          but it's probably still useful as a regression test.
+          This new test uses solid colors which result in consistency across
+          platforms and allow a reftest to be used.
+        * svg/filters/feCompositeOpaque-expected.html: Added.
+
</ins><span class="cx"> 2016-01-28  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove equalIgnoringCase since all callers really wanted equalIgnoringASCIICase
</span></span></pre></div>
<a id="trunkLayoutTestssvgdomSVGAnimatedEnumerationSVGFECompositeElementexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement-expected.txt (195744 => 195745)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement-expected.txt        2016-01-28 17:30:00 UTC (rev 195744)
+++ trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement-expected.txt        2016-01-28 17:33:46 UTC (rev 195745)
</span><span class="lines">@@ -14,6 +14,11 @@
</span><span class="cx"> PASS feCompositeElement.operator.baseVal is SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_IN
</span><span class="cx"> PASS feCompositeElement.getAttribute('operator') is &quot;in&quot;
</span><span class="cx"> 
</span><ins>+Switch to 'over'
+PASS feCompositeElement.operator.baseVal = SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER is SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER
+PASS feCompositeElement.operator.baseVal is SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER
+PASS feCompositeElement.getAttribute('operator') is &quot;over&quot;
+
</ins><span class="cx"> Switch to 'out'
</span><span class="cx"> PASS feCompositeElement.operator.baseVal = SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OUT is SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OUT
</span><span class="cx"> PASS feCompositeElement.operator.baseVal is SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OUT
</span><span class="lines">@@ -45,10 +50,9 @@
</span><span class="cx"> PASS feCompositeElement.operator.baseVal is SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_ARITHMETIC
</span><span class="cx"> PASS feCompositeElement.getAttribute('operator') is &quot;arithmetic&quot;
</span><span class="cx"> 
</span><del>-Switch to 'over'
-PASS feCompositeElement.operator.baseVal = SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER is SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER
-PASS feCompositeElement.operator.baseVal is SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER
-PASS feCompositeElement.getAttribute('operator') is &quot;over&quot;
</del><ins>+Switch to 'lighter'
+PASS feCompositeElement.operator.baseVal is SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_UNKNOWN
+PASS feCompositeElement.getAttribute('operator') is &quot;lighter&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestssvgdomscripttestsSVGAnimatedEnumerationSVGFECompositeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration-SVGFECompositeElement.js (195744 => 195745)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration-SVGFECompositeElement.js        2016-01-28 17:30:00 UTC (rev 195744)
+++ trunk/LayoutTests/svg/dom/script-tests/SVGAnimatedEnumeration-SVGFECompositeElement.js        2016-01-28 17:33:46 UTC (rev 195745)
</span><span class="lines">@@ -16,6 +16,12 @@
</span><span class="cx"> shouldBeEqualToString(&quot;feCompositeElement.getAttribute('operator')&quot;, &quot;in&quot;);
</span><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><ins>+debug(&quot;Switch to 'over'&quot;);
+shouldBe(&quot;feCompositeElement.operator.baseVal = SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER&quot;, &quot;SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER&quot;);
+shouldBe(&quot;feCompositeElement.operator.baseVal&quot;, &quot;SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER&quot;);
+shouldBeEqualToString(&quot;feCompositeElement.getAttribute('operator')&quot;, &quot;over&quot;);
+
+debug(&quot;&quot;);
</ins><span class="cx"> debug(&quot;Switch to 'out'&quot;);
</span><span class="cx"> shouldBe(&quot;feCompositeElement.operator.baseVal = SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OUT&quot;, &quot;SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OUT&quot;);
</span><span class="cx"> shouldBe(&quot;feCompositeElement.operator.baseVal&quot;, &quot;SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OUT&quot;);
</span><span class="lines">@@ -39,6 +45,11 @@
</span><span class="cx"> shouldBe(&quot;feCompositeElement.operator.baseVal&quot;, &quot;SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_ARITHMETIC&quot;);
</span><span class="cx"> shouldBeEqualToString(&quot;feCompositeElement.getAttribute('operator')&quot;, &quot;arithmetic&quot;);
</span><span class="cx"> 
</span><ins>+// Compositing modes added to SVG 2 do not expose their enumeration values through
+// the IDL the way older modes did. Therefore, lighter cannot be selected by
+// setting operator.baseVal and SVG_FECOMPOSITE_OPERATOR_UNKNOWN is returned
+// for all new modes.
+
</ins><span class="cx"> debug(&quot;&quot;);
</span><span class="cx"> debug(&quot;Try setting invalid values&quot;);
</span><span class="cx"> shouldThrow(&quot;feCompositeElement.operator.baseVal = 7&quot;);
</span><span class="lines">@@ -54,9 +65,9 @@
</span><span class="cx"> shouldBeEqualToString(&quot;feCompositeElement.getAttribute('operator')&quot;, &quot;arithmetic&quot;);
</span><span class="cx"> 
</span><span class="cx"> debug(&quot;&quot;);
</span><del>-debug(&quot;Switch to 'over'&quot;);
-shouldBe(&quot;feCompositeElement.operator.baseVal = SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER&quot;, &quot;SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER&quot;);
-shouldBe(&quot;feCompositeElement.operator.baseVal&quot;, &quot;SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_OVER&quot;);
-shouldBeEqualToString(&quot;feCompositeElement.getAttribute('operator')&quot;, &quot;over&quot;);
</del><ins>+debug(&quot;Switch to 'lighter'&quot;);
+feCompositeElement.setAttribute('operator', 'lighter');
+shouldBe(&quot;feCompositeElement.operator.baseVal&quot;, &quot;SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_UNKNOWN&quot;);
+shouldBeEqualToString(&quot;feCompositeElement.getAttribute('operator')&quot;, &quot;lighter&quot;);
</ins><span class="cx"> 
</span><span class="cx"> successfullyParsed = true;
</span></span></pre></div>
<a id="trunkLayoutTestssvgfiltersfeCompositeOpaqueexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/filters/feCompositeOpaque-expected.html (0 => 195745)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/filters/feCompositeOpaque-expected.html                                (rev 0)
+++ trunk/LayoutTests/svg/filters/feCompositeOpaque-expected.html        2016-01-28 17:33:46 UTC (rev 195745)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+&lt;!-- feComposite reference image --&gt;
+&lt;style&gt;
+* { margin: 0; padding: 0; }
+svg { width: 700px;}
+&lt;/style&gt;
+
+&lt;body&gt;
+&lt;svg viewBox=&quot;0 0 700 100&quot;&gt;
+
+&lt;path d=&quot;M 0,0 h75 v75 h-75 z&quot; fill=&quot;#f00&quot; /&gt;
+&lt;path d=&quot;M 25,25 h75 v75 h-75 z&quot; fill=&quot;#00f&quot; /&gt;
+
+&lt;g transform=&quot;translate(100,0)&quot;&gt;
+&lt;path d=&quot;M 25,25 h50 v50 h-50 z&quot; fill=&quot;#00f&quot; /&gt;
+&lt;/g&gt;
+
+&lt;g transform=&quot;translate(200,0)&quot;&gt;
+&lt;path d=&quot;M 0,0 h75 v75 h-75 z&quot; fill=&quot;#f00&quot; /&gt;
+&lt;path d=&quot;M 25,25 h50 v50 h-50 z&quot; fill=&quot;#00f&quot; /&gt;
+&lt;/g&gt;
+
+&lt;g transform=&quot;translate(300,0)&quot;&gt;
+&lt;path d=&quot;M 75,25 h25 v75 h-75 v-25 h50 z&quot; fill=&quot;#00f&quot; /&gt;
+&lt;/g&gt;
+
+&lt;g transform=&quot;translate(400,0)&quot;&gt;
+&lt;path d=&quot;M 0,0 h75 v25 h-50 v50 h-25 z&quot; fill=&quot;#f00&quot; /&gt;
+&lt;path d=&quot;M 75,25 h25 v75 h-75 v-25 h50 z&quot; fill=&quot;#00f&quot; /&gt;
+&lt;/g&gt;
+
+&lt;g transform=&quot;translate(500,0)&quot;&gt;
+&lt;path d=&quot;M 0,0 h75 v75 h-75 z&quot; fill=&quot;#ff8080&quot; /&gt;
+&lt;path d=&quot;M 25,25 h75 v75 h-75 z&quot; fill=&quot;#8080ff&quot; /&gt;
+&lt;path d=&quot;M 25,25 h50 v50 h-50 z&quot; fill=&quot;#b0b&quot; /&gt;
+&lt;/g&gt;
+
+&lt;g transform=&quot;translate(600,0)&quot;&gt;
+&lt;path d=&quot;M 0,0 h75 v75 h-75 z&quot; fill=&quot;#f00&quot; /&gt;
+&lt;path d=&quot;M 25,25 h75 v75 h-75 z&quot; fill=&quot;#00f&quot; /&gt;
+&lt;path d=&quot;M 25,25 h50 v50 h-50 z&quot; fill=&quot;#f0f&quot; /&gt;
+&lt;/g&gt;
+
+&lt;/svg&gt;
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestssvgfiltersfeCompositeOpaquehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/filters/feCompositeOpaque.html (0 => 195745)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/filters/feCompositeOpaque.html                                (rev 0)
+++ trunk/LayoutTests/svg/filters/feCompositeOpaque.html        2016-01-28 17:33:46 UTC (rev 195745)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+&lt;!-- 
+  Tests each feComposite operator.
+  Only uses full opacity so that results are consistent across platforms.
+--&gt;
+&lt;style&gt;
+* { margin: 0; padding: 0; }
+svg {width: 700px;}
+&lt;/style&gt;
+
+&lt;body&gt;
+&lt;svg viewBox=&quot;0 0 700 100&quot;&gt;
+&lt;defs&gt;
+    &lt;filter id=&quot;composite1&quot; filterUnits=&quot;objectBoundingBox&quot; primitiveUnits=&quot;objectBoundingBox&quot;&gt;
+        &lt;feFlood flood-color=&quot;#f00&quot; flood-opacity=&quot;1&quot; result=&quot;res1&quot; x=&quot;0%&quot; y=&quot;0%&quot; width=&quot;75%&quot; height=&quot;75%&quot;/&gt;
+        &lt;feFlood flood-color=&quot;#00f&quot; flood-opacity=&quot;1&quot; result=&quot;res2&quot; x=&quot;25%&quot; y=&quot;25%&quot; width=&quot;75%&quot; height=&quot;75%&quot;/&gt;
+        &lt;feComposite id=&quot;fecomposite1&quot; operator=&quot;over&quot; in2=&quot;res1&quot; in=&quot;res2&quot;/&gt;
+    &lt;/filter&gt;
+    &lt;filter id=&quot;composite2&quot; filterUnits=&quot;objectBoundingBox&quot; primitiveUnits=&quot;objectBoundingBox&quot;&gt;
+        &lt;feFlood flood-color=&quot;#f00&quot; flood-opacity=&quot;1&quot; result=&quot;res1&quot; x=&quot;0%&quot; y=&quot;0%&quot; width=&quot;75%&quot; height=&quot;75%&quot;/&gt;
+        &lt;feFlood flood-color=&quot;#00f&quot; flood-opacity=&quot;1&quot; result=&quot;res2&quot; x=&quot;25%&quot; y=&quot;25%&quot; width=&quot;75%&quot; height=&quot;75%&quot;/&gt;
+        &lt;feComposite id=&quot;fecomposite2&quot; operator=&quot;in&quot; in2=&quot;res1&quot; in=&quot;res2&quot;/&gt;
+    &lt;/filter&gt;
+    &lt;filter id=&quot;composite3&quot; filterUnits=&quot;objectBoundingBox&quot; primitiveUnits=&quot;objectBoundingBox&quot;&gt;
+        &lt;feFlood flood-color=&quot;#f00&quot; flood-opacity=&quot;1&quot; result=&quot;res1&quot; x=&quot;0%&quot; y=&quot;0%&quot; width=&quot;75%&quot; height=&quot;75%&quot;/&gt;
+        &lt;feFlood flood-color=&quot;#00f&quot; flood-opacity=&quot;1&quot; result=&quot;res2&quot; x=&quot;25%&quot; y=&quot;25%&quot; width=&quot;75%&quot; height=&quot;75%&quot;/&gt;
+        &lt;feComposite id=&quot;fecomposite3&quot; operator=&quot;atop&quot; in2=&quot;res1&quot; in=&quot;res2&quot;/&gt;
+    &lt;/filter&gt;
+    &lt;filter id=&quot;composite4&quot; filterUnits=&quot;objectBoundingBox&quot; primitiveUnits=&quot;objectBoundingBox&quot;&gt;
+        &lt;feFlood flood-color=&quot;#f00&quot; flood-opacity=&quot;1&quot; result=&quot;res1&quot; x=&quot;0%&quot; y=&quot;0%&quot; width=&quot;75%&quot; height=&quot;75%&quot;/&gt;
+        &lt;feFlood flood-color=&quot;#00f&quot; flood-opacity=&quot;1&quot; result=&quot;res2&quot; x=&quot;25%&quot; y=&quot;25%&quot; width=&quot;75%&quot; height=&quot;75%&quot;/&gt;
+        &lt;feComposite id=&quot;fecomposite4&quot; operator=&quot;out&quot; in2=&quot;res1&quot; in=&quot;res2&quot;/&gt;
+    &lt;/filter&gt;
+    &lt;filter id=&quot;composite5&quot; filterUnits=&quot;objectBoundingBox&quot; primitiveUnits=&quot;objectBoundingBox&quot;&gt;
+        &lt;feFlood flood-color=&quot;#f00&quot; flood-opacity=&quot;1&quot; result=&quot;res1&quot; x=&quot;0%&quot; y=&quot;0%&quot; width=&quot;75%&quot; height=&quot;75%&quot;/&gt;
+        &lt;feFlood flood-color=&quot;#00f&quot; flood-opacity=&quot;1&quot; result=&quot;res2&quot; x=&quot;25%&quot; y=&quot;25%&quot; width=&quot;75%&quot; height=&quot;75%&quot;/&gt;
+        &lt;feComposite id=&quot;fecomposite5&quot; operator=&quot;xor&quot; in2=&quot;res1&quot; in=&quot;res2&quot;/&gt;
+    &lt;/filter&gt;
+    &lt;filter id=&quot;composite6&quot; filterUnits=&quot;objectBoundingBox&quot; primitiveUnits=&quot;objectBoundingBox&quot;&gt;
+        &lt;feFlood flood-color=&quot;#f00&quot; flood-opacity=&quot;1&quot; result=&quot;res1&quot; x=&quot;0%&quot; y=&quot;0%&quot; width=&quot;75%&quot; height=&quot;75%&quot;/&gt;
+        &lt;feFlood flood-color=&quot;#00f&quot; flood-opacity=&quot;1&quot; result=&quot;res2&quot; x=&quot;25%&quot; y=&quot;25%&quot; width=&quot;75%&quot; height=&quot;75%&quot;/&gt;
+        &lt;feComposite id=&quot;fecomposite6&quot; operator=&quot;arithmetic&quot; in2=&quot;res1&quot; in=&quot;res2&quot; k1=&quot;1&quot; k2=&quot;0.5&quot; k3=&quot;0.5&quot; k4=&quot;0&quot;/&gt;
+    &lt;/filter&gt;
+    &lt;filter id=&quot;composite7&quot; filterUnits=&quot;objectBoundingBox&quot; primitiveUnits=&quot;objectBoundingBox&quot;&gt;
+        &lt;feFlood flood-color=&quot;#f00&quot; flood-opacity=&quot;1&quot; result=&quot;res1&quot; x=&quot;0%&quot; y=&quot;0%&quot; width=&quot;75%&quot; height=&quot;75%&quot;/&gt;
+        &lt;feFlood flood-color=&quot;#00f&quot; flood-opacity=&quot;1&quot; result=&quot;res2&quot; x=&quot;25%&quot; y=&quot;25%&quot; width=&quot;75%&quot; height=&quot;75%&quot;/&gt;
+        &lt;feComposite id=&quot;fecomposite7&quot; operator=&quot;lighter&quot; in2=&quot;res1&quot; in=&quot;res2&quot;/&gt;
+    &lt;/filter&gt;
+&lt;/defs&gt;
+&lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;100&quot; height=&quot;100&quot; filter=&quot;url(#composite1)&quot;/&gt;
+&lt;rect x=&quot;100&quot; y=&quot;0&quot; width=&quot;100&quot; height=&quot;100&quot; filter=&quot;url(#composite2)&quot;/&gt;
+&lt;rect x=&quot;200&quot; y=&quot;0&quot; width=&quot;100&quot; height=&quot;100&quot; filter=&quot;url(#composite3)&quot;/&gt;
+&lt;rect x=&quot;300&quot; y=&quot;0&quot; width=&quot;100&quot; height=&quot;100&quot; filter=&quot;url(#composite4)&quot;/&gt;
+&lt;rect x=&quot;400&quot; y=&quot;0&quot; width=&quot;100&quot; height=&quot;100&quot; filter=&quot;url(#composite5)&quot;/&gt;
+&lt;rect x=&quot;500&quot; y=&quot;0&quot; width=&quot;100&quot; height=&quot;100&quot; filter=&quot;url(#composite6)&quot;/&gt;
+&lt;rect x=&quot;600&quot; y=&quot;0&quot; width=&quot;100&quot; height=&quot;100&quot; filter=&quot;url(#composite7)&quot;/&gt;
+&lt;/svg&gt;
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (195744 => 195745)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-28 17:30:00 UTC (rev 195744)
+++ trunk/Source/WebCore/ChangeLog        2016-01-28 17:33:46 UTC (rev 195745)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2016-01-28  Nikos Andronikos  &lt;nikos.andronikos-webkit@cisra.canon.com.au&gt;
+
+        [SVG] Add support for 'lighter' operator in feComposite
+        https://bugs.webkit.org/show_bug.cgi?id=141376
+
+        Reviewed by Darin Adler.
+
+        Added new cases where needed to support the lighter (aka 'plus')
+        Porter Duff operator in SVG Filter Effects.
+        https://www.w3.org/TR/filter-effects/#valdef-operator-lighter
+        Note that in the specification, no constant was added to the IDL for
+        the lighter operator. 
+
+        Test: svg/filters/feCompositeOpaque.html
+              svg/dom/script-tests/SVGAnimatedEnumeration-SVGFECompositeElement.js
+
+        * platform/graphics/filters/FEComposite.cpp:
+        (WebCore::FEComposite::platformApplySoftware):
+          Add case to support lighter.
+        (WebCore::operator&lt;&lt;):
+          Add case to support lighter for text stream operations.
+        * platform/graphics/filters/FEComposite.h:
+          Add case for lighter to CompositeOperationType enum.
+        * svg/SVGFECompositeElement.h:
+        (WebCore::SVGIDLEnumLimits&lt;CompositeOperationType&gt;::highestExposedEnumValue):
+          Higest exposed value is arithmetic - do not expose lighter.
+        (WebCore::SVGPropertyTraits&lt;CompositeOperationType&gt;::highestEnumValue):
+          Highest possible value is now lighter.
+        (WebCore::SVGPropertyTraits&lt;CompositeOperationType&gt;::toString):
+          Add case to support lighter.
+        (WebCore::SVGPropertyTraits&lt;CompositeOperationType&gt;::fromString):
+          Add case to support lighter.
+
</ins><span class="cx"> 2016-01-28  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove equalIgnoringCase since all callers really wanted equalIgnoringASCIICase
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFECompositecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FEComposite.cpp (195744 => 195745)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FEComposite.cpp        2016-01-28 17:30:00 UTC (rev 195744)
+++ trunk/Source/WebCore/platform/graphics/filters/FEComposite.cpp        2016-01-28 17:33:46 UTC (rev 195745)
</span><span class="lines">@@ -310,6 +310,10 @@
</span><span class="cx">         filterContext.drawImageBuffer(*imageBuffer2, drawingRegionOfInputImage(in2-&gt;absolutePaintRect()));
</span><span class="cx">         filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in-&gt;absolutePaintRect()), IntRect(IntPoint(), imageBuffer-&gt;logicalSize()), CompositeXOR);
</span><span class="cx">         break;
</span><ins>+    case FECOMPOSITE_OPERATOR_LIGHTER:
+        filterContext.drawImageBuffer(*imageBuffer2, drawingRegionOfInputImage(in2-&gt;absolutePaintRect()));
+        filterContext.drawImageBuffer(*imageBuffer, drawingRegionOfInputImage(in-&gt;absolutePaintRect()), IntRect(IntPoint(), imageBuffer-&gt;logicalSize()), CompositePlusLighter);
+        break;
</ins><span class="cx">     default:
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="lines">@@ -343,6 +347,9 @@
</span><span class="cx">     case FECOMPOSITE_OPERATOR_ARITHMETIC:
</span><span class="cx">         ts &lt;&lt; &quot;ARITHMETIC&quot;;
</span><span class="cx">         break;
</span><ins>+    case FECOMPOSITE_OPERATOR_LIGHTER:
+        ts &lt;&lt; &quot;LIGHTER&quot;;
+        break;
</ins><span class="cx">     }
</span><span class="cx">     return ts;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFECompositeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FEComposite.h (195744 => 195745)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FEComposite.h        2016-01-28 17:30:00 UTC (rev 195744)
+++ trunk/Source/WebCore/platform/graphics/filters/FEComposite.h        2016-01-28 17:33:46 UTC (rev 195745)
</span><span class="lines">@@ -36,7 +36,8 @@
</span><span class="cx">     FECOMPOSITE_OPERATOR_OUT        = 3,
</span><span class="cx">     FECOMPOSITE_OPERATOR_ATOP       = 4,
</span><span class="cx">     FECOMPOSITE_OPERATOR_XOR        = 5,
</span><del>-    FECOMPOSITE_OPERATOR_ARITHMETIC = 6
</del><ins>+    FECOMPOSITE_OPERATOR_ARITHMETIC = 6,
+    FECOMPOSITE_OPERATOR_LIGHTER    = 7
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class FEComposite : public FilterEffect {
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFECompositeElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFECompositeElement.h (195744 => 195745)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFECompositeElement.h        2016-01-28 17:30:00 UTC (rev 195744)
+++ trunk/Source/WebCore/svg/SVGFECompositeElement.h        2016-01-28 17:33:46 UTC (rev 195745)
</span><span class="lines">@@ -29,8 +29,11 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> template&lt;&gt;
</span><ins>+inline unsigned SVGIDLEnumLimits&lt;CompositeOperationType&gt;::highestExposedEnumValue() { return FECOMPOSITE_OPERATOR_ARITHMETIC; }
+
+template&lt;&gt;
</ins><span class="cx"> struct SVGPropertyTraits&lt;CompositeOperationType&gt; {
</span><del>-    static unsigned highestEnumValue() { return FECOMPOSITE_OPERATOR_ARITHMETIC; }
</del><ins>+    static unsigned highestEnumValue() { return FECOMPOSITE_OPERATOR_LIGHTER; }
</ins><span class="cx"> 
</span><span class="cx">     static String toString(CompositeOperationType type)
</span><span class="cx">     {
</span><span class="lines">@@ -49,6 +52,8 @@
</span><span class="cx">             return &quot;xor&quot;;
</span><span class="cx">         case FECOMPOSITE_OPERATOR_ARITHMETIC:
</span><span class="cx">             return &quot;arithmetic&quot;;
</span><ins>+        case FECOMPOSITE_OPERATOR_LIGHTER:
+            return &quot;lighter&quot;;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="lines">@@ -69,6 +74,8 @@
</span><span class="cx">             return FECOMPOSITE_OPERATOR_XOR;
</span><span class="cx">         if (value == &quot;arithmetic&quot;)
</span><span class="cx">             return FECOMPOSITE_OPERATOR_ARITHMETIC;
</span><ins>+        if (value == &quot;lighter&quot;)
+            return FECOMPOSITE_OPERATOR_LIGHTER;
</ins><span class="cx">         return FECOMPOSITE_OPERATOR_UNKNOWN;
</span><span class="cx">     }
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>