<!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>[170433] 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/170433">170433</a></dd>
<dt>Author</dt> <dd>krit@webkit.org</dd>
<dt>Date</dt> <dd>2014-06-25 12:03:47 -0700 (Wed, 25 Jun 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add all blend modes to feBlend

feBlend should support all blend modes from CSS and Canvas
https://bugs.webkit.org/show_bug.cgi?id=134296

Source/WebCore:
Reviewed by Dean Jackson.

Add all blend modes to &lt;feBlend&gt; (the SVG filter primitive) that are also
supported by HTML Canvas and CSS.

In addition, add &quot;normal&quot; blend mode to HTML Canvas as requested by the
CSS Compositing and Blending specification. (Referenced from HTML Canvas.)
With this change, SVG, CSS and Canvas truly share the same blend modes and
even the same keywords. This is much easier to for web authors.

http://www.w3.org/TR/2014/CR-compositing-1-20140220/#ltblendmodegt

Test: svg/filters/feBlend-all-blendmodes.svg

* platform/graphics/GraphicsTypes.cpp: Reorder blend mode text streams to match
    enumeration order. Add a new function to parse blend modes independent of
    compositing modes. Add a string &quot;normal&quot; that is supported by CSS, feBlend and
    HTML Canvas now.
(WebCore::parseBlendMode):
(WebCore::parseCompositeAndBlendOperator):
* platform/graphics/GraphicsTypes.h: Reorder BlendMode enumeration values to match
 the SVG JS enumeration for blend modes.
* platform/graphics/cpu/arm/filters/FEBlendNEON.h: Move all software code that is no
    longer required by the software path but still used by NEON here.
(WebCore::FEBlend::platformApplySoftware):
(WebCore::FEBlend::platformApplyNEON):
* platform/graphics/filters/FEBlend.cpp:
    Use drawImageBuffer() to blend the results of previous filter primitives. This
    allows removing more than 60% of the code.
(WebCore::FEBlend::FEBlend):
(WebCore::FEBlend::create):
(WebCore::FEBlend::blendMode):
(WebCore::FEBlend::setBlendMode):
(WebCore::FEBlend::platformApplySoftware):
(WebCore::FEBlend::dump):
(WebCore::FEBlend::externalRepresentation):
(WebCore::feBlendNormal): Deleted.
(WebCore::feBlendMultiply): Deleted.
(WebCore::feBlendScreen): Deleted.
(WebCore::feBlendDarken): Deleted.
(WebCore::feBlendLighten): Deleted.
(WebCore::feBlendUnknown): Deleted.
(WebCore::platformApply): Deleted.
(WebCore::FEBlend::platformApplyGeneric): Deleted.
(WebCore::operator&lt;&lt;): Deleted.
* platform/graphics/filters/FEBlend.h:
* svg/SVGAnimatedEnumeration.cpp: Use the global BlendMode enumeration.
(WebCore::enumerationValueForTargetAttribute):
* svg/SVGFEBlendElement.cpp:
(WebCore::SVGFEBlendElement::SVGFEBlendElement): Use the global BlendMode enumeration.
    No new enumeration values added or exposed to SVG DOM as requested by SVG WG.
(WebCore::SVGFEBlendElement::parseAttribute):
* svg/SVGFEBlendElement.h: Replace BlendModeType with global BlendMode enumeration. Remove
    blend mode parsing code and use the code in GraphicsTypes instead.
(WebCore::SVGPropertyTraits&lt;BlendMode&gt;::highestEnumValue):
(WebCore::SVGPropertyTraits&lt;BlendMode&gt;::toString):
(WebCore::SVGPropertyTraits&lt;BlendModeType&gt;::highestEnumValue): Deleted.
(WebCore::SVGPropertyTraits&lt;BlendModeType&gt;::toString): Deleted.
(WebCore::SVGPropertyTraits&lt;BlendModeType&gt;::fromString): Deleted.

LayoutTests:
Added tests for new blend modes in feBlend as well as a test for 'normal' blend mode
on HTML Canvas.

Reviewed by Dean Jackson.

* fast/canvas/canvas-blend-image-expected.txt:
* fast/canvas/canvas-blend-solid-expected.txt:
* fast/canvas/script-tests/canvas-blend-image.js: Test 'normal' blend mode in Canvas.
(prepareTestScenario):
* fast/canvas/script-tests/canvas-blend-solid.js: Ditto.
(prepareTestScenario):
* platform/mac/svg/W3C-SVG-1.1/filters-blend-01-b-expected.png:
* platform/mac/svg/W3C-SVG-1.1/filters-blend-01-b-expected.txt: DRT output is lowercase now.
* platform/mac/svg/filters/feBlend-all-blendmodes-expected.png: Added.
* platform/mac/svg/filters/feBlend-all-blendmodes-expected.txt: Added.
* svg/filters/feBlend-all-blendmodes.svg: Added. Tests all blend modes now supported by feBlend.
* svg/filters/feBlend-invalid-mode.xhtml: Add an upper bound check as well.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestscss3filterseffectreferenceexpectedtxt">trunk/LayoutTests/css3/filters/effect-reference-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3filterseffectreferencehwexpectedtxt">trunk/LayoutTests/css3/filters/effect-reference-hw-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvascanvasblendimageexpectedtxt">trunk/LayoutTests/fast/canvas/canvas-blend-image-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvascanvasblendsolidexpectedtxt">trunk/LayoutTests/fast/canvas/canvas-blend-solid-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcanvasscripttestscanvasblendimagejs">trunk/LayoutTests/fast/canvas/script-tests/canvas-blend-image.js</a></li>
<li><a href="#trunkLayoutTestsfastcanvasscripttestscanvasblendsolidjs">trunk/LayoutTests/fast/canvas/script-tests/canvas-blend-solid.js</a></li>
<li><a href="#trunkLayoutTestsplatformmacsvgW3CSVG11filtersblend01bexpectedpng">trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-blend-01-b-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmacsvgW3CSVG11filtersblend01bexpectedtxt">trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-blend-01-b-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcsspathgradientstrokeshadowexpectedtxt">trunk/LayoutTests/svg/css/path-gradient-stroke-shadow-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcssrectgradientstrokeshadowexpectedtxt">trunk/LayoutTests/svg/css/rect-gradient-stroke-shadow-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsTypescpp">trunk/Source/WebCore/platform/graphics/GraphicsTypes.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsTypesh">trunk/Source/WebCore/platform/graphics/GraphicsTypes.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscpuarmfiltersFEBlendNEONh">trunk/Source/WebCore/platform/graphics/cpu/arm/filters/FEBlendNEON.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFEBlendcpp">trunk/Source/WebCore/platform/graphics/filters/FEBlend.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFEBlendh">trunk/Source/WebCore/platform/graphics/filters/FEBlend.h</a></li>
<li><a href="#trunkSourceWebCoresvgSVGAnimatedEnumerationcpp">trunk/Source/WebCore/svg/SVGAnimatedEnumeration.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFEBlendElementcpp">trunk/Source/WebCore/svg/SVGFEBlendElement.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFEBlendElementh">trunk/Source/WebCore/svg/SVGFEBlendElement.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsplatformmacsvgfiltersfeBlendallblendmodesexpectedpng">trunk/LayoutTests/platform/mac/svg/filters/feBlend-all-blendmodes-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmacsvgfiltersfeBlendallblendmodesexpectedtxt">trunk/LayoutTests/platform/mac/svg/filters/feBlend-all-blendmodes-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgfiltersfeBlendallblendmodessvg">trunk/LayoutTests/svg/filters/feBlend-all-blendmodes.svg</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/LayoutTests/ChangeLog        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2014-06-25  Dirk Schulze  &lt;krit@webkit.org&gt;
+
+        Add all blend modes to feBlend
+
+        feBlend should support all blend modes from CSS and Canvas
+        https://bugs.webkit.org/show_bug.cgi?id=134296
+
+        Added tests for new blend modes in feBlend as well as a test for 'normal' blend mode
+        on HTML Canvas.
+
+        Reviewed by Dean Jackson.
+
+        * fast/canvas/canvas-blend-image-expected.txt:
+        * fast/canvas/canvas-blend-solid-expected.txt:
+        * fast/canvas/script-tests/canvas-blend-image.js: Test 'normal' blend mode in Canvas.
+        (prepareTestScenario):
+        * fast/canvas/script-tests/canvas-blend-solid.js: Ditto.
+        (prepareTestScenario):
+        * platform/mac/svg/W3C-SVG-1.1/filters-blend-01-b-expected.png:
+        * platform/mac/svg/W3C-SVG-1.1/filters-blend-01-b-expected.txt: DRT output is lowercase now.
+        * platform/mac/svg/filters/feBlend-all-blendmodes-expected.png: Added.
+        * platform/mac/svg/filters/feBlend-all-blendmodes-expected.txt: Added.
+        * svg/filters/feBlend-all-blendmodes.svg: Added. Tests all blend modes now supported by feBlend.
+        * svg/filters/feBlend-invalid-mode.xhtml: Add an upper bound check as well.
+
</ins><span class="cx"> 2014-06-25  Chris Fleizach  &lt;cfleizach@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: Crash at com.apple.WebCore: WebCore::AlternativeTextController::removeDictationAlternativesForMarker + 43
</span></span></pre></div>
<a id="trunkLayoutTestscss3filterseffectreferenceexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/filters/effect-reference-expected.txt (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/filters/effect-reference-expected.txt        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/LayoutTests/css3/filters/effect-reference-expected.txt        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -22,12 +22,12 @@
</span><span class="cx">             [feGaussianBlur stdDeviation=&quot;0.00, 5.00&quot;]
</span><span class="cx">               [SourceGraphic]
</span><span class="cx">           RenderSVGResourceFilter {filter} [id=&quot;blend&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
</span><del>-            [feBlend mode=&quot;SCREEN&quot;]
</del><ins>+            [feBlend mode=&quot;screen&quot;]
</ins><span class="cx">               [feGaussianBlur stdDeviation=&quot;5.00, 5.00&quot;]
</span><span class="cx">                 [SourceGraphic]
</span><span class="cx">               [SourceGraphic]
</span><span class="cx">           RenderSVGResourceFilter {filter} [id=&quot;lighting&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
</span><del>-            [feBlend mode=&quot;MULTIPLY&quot;]
</del><ins>+            [feBlend mode=&quot;multiply&quot;]
</ins><span class="cx">               [feColorMatrix type=&quot;MATRIX&quot; values=&quot;0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 1.00&quot;]
</span><span class="cx">                 [feSpecularLighting surfaceScale=&quot;1.00&quot; specualConstant=&quot;1.00&quot; specularExponent=&quot;1.00&quot;]
</span><span class="cx">                   [SourceGraphic]
</span></span></pre></div>
<a id="trunkLayoutTestscss3filterseffectreferencehwexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/filters/effect-reference-hw-expected.txt (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/filters/effect-reference-hw-expected.txt        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/LayoutTests/css3/filters/effect-reference-hw-expected.txt        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -22,12 +22,12 @@
</span><span class="cx">             [feGaussianBlur stdDeviation=&quot;0.00, 5.00&quot;]
</span><span class="cx">               [SourceGraphic]
</span><span class="cx">           RenderSVGResourceFilter {filter} [id=&quot;blend&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
</span><del>-            [feBlend mode=&quot;SCREEN&quot;]
</del><ins>+            [feBlend mode=&quot;screen&quot;]
</ins><span class="cx">               [feGaussianBlur stdDeviation=&quot;5.00, 5.00&quot;]
</span><span class="cx">                 [SourceGraphic]
</span><span class="cx">               [SourceGraphic]
</span><span class="cx">           RenderSVGResourceFilter {filter} [id=&quot;lighting&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
</span><del>-            [feBlend mode=&quot;MULTIPLY&quot;]
</del><ins>+            [feBlend mode=&quot;multiply&quot;]
</ins><span class="cx">               [feColorMatrix type=&quot;MATRIX&quot; values=&quot;0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 1.00&quot;]
</span><span class="cx">                 [feSpecularLighting surfaceScale=&quot;1.00&quot; specualConstant=&quot;1.00&quot; specularExponent=&quot;1.00&quot;]
</span><span class="cx">                   [SourceGraphic]
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvascanvasblendimageexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/canvas-blend-image-expected.txt (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/canvas-blend-image-expected.txt        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/LayoutTests/fast/canvas/canvas-blend-image-expected.txt        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -73,6 +73,76 @@
</span><span class="cx"> PASS pixelDataAtPoint(3)[2] is within 5 of 255
</span><span class="cx"> PASS pixelDataAtPoint(3)[3] is within 5 of 191
</span><span class="cx"> 
</span><ins>+Testing blend mode &quot;normal&quot;
+solid on solid
+PASS pixelDataAtPoint(0)[0] is within 5 of 255
+PASS pixelDataAtPoint(0)[1] is within 5 of 0
+PASS pixelDataAtPoint(0)[2] is within 5 of 0
+PASS pixelDataAtPoint(0)[3] is within 5 of 255
+PASS pixelDataAtPoint(1)[0] is within 5 of 255
+PASS pixelDataAtPoint(1)[1] is within 5 of 255
+PASS pixelDataAtPoint(1)[2] is within 5 of 0
+PASS pixelDataAtPoint(1)[3] is within 5 of 255
+PASS pixelDataAtPoint(2)[0] is within 5 of 0
+PASS pixelDataAtPoint(2)[1] is within 5 of 128
+PASS pixelDataAtPoint(2)[2] is within 5 of 0
+PASS pixelDataAtPoint(2)[3] is within 5 of 255
+PASS pixelDataAtPoint(3)[0] is within 5 of 0
+PASS pixelDataAtPoint(3)[1] is within 5 of 0
+PASS pixelDataAtPoint(3)[2] is within 5 of 255
+PASS pixelDataAtPoint(3)[3] is within 5 of 255
+solid on alpha
+PASS pixelDataAtPoint(0)[0] is within 5 of 128
+PASS pixelDataAtPoint(0)[1] is within 5 of 0
+PASS pixelDataAtPoint(0)[2] is within 5 of 127
+PASS pixelDataAtPoint(0)[3] is within 5 of 255
+PASS pixelDataAtPoint(1)[0] is within 5 of 128
+PASS pixelDataAtPoint(1)[1] is within 5 of 128
+PASS pixelDataAtPoint(1)[2] is within 5 of 127
+PASS pixelDataAtPoint(1)[3] is within 5 of 255
+PASS pixelDataAtPoint(2)[0] is within 5 of 0
+PASS pixelDataAtPoint(2)[1] is within 5 of 64
+PASS pixelDataAtPoint(2)[2] is within 5 of 127
+PASS pixelDataAtPoint(2)[3] is within 5 of 255
+PASS pixelDataAtPoint(3)[0] is within 5 of 0
+PASS pixelDataAtPoint(3)[1] is within 5 of 0
+PASS pixelDataAtPoint(3)[2] is within 5 of 255
+PASS pixelDataAtPoint(3)[3] is within 5 of 255
+alpha on solid
+PASS pixelDataAtPoint(0)[0] is within 5 of 255
+PASS pixelDataAtPoint(0)[1] is within 5 of 0
+PASS pixelDataAtPoint(0)[2] is within 5 of 0
+PASS pixelDataAtPoint(0)[3] is within 5 of 255
+PASS pixelDataAtPoint(1)[0] is within 5 of 255
+PASS pixelDataAtPoint(1)[1] is within 5 of 255
+PASS pixelDataAtPoint(1)[2] is within 5 of 0
+PASS pixelDataAtPoint(1)[3] is within 5 of 255
+PASS pixelDataAtPoint(2)[0] is within 5 of 0
+PASS pixelDataAtPoint(2)[1] is within 5 of 128
+PASS pixelDataAtPoint(2)[2] is within 5 of 0
+PASS pixelDataAtPoint(2)[3] is within 5 of 255
+PASS pixelDataAtPoint(3)[0] is within 5 of 0
+PASS pixelDataAtPoint(3)[1] is within 5 of 0
+PASS pixelDataAtPoint(3)[2] is within 5 of 255
+PASS pixelDataAtPoint(3)[3] is within 5 of 255
+alpha on alpha
+PASS pixelDataAtPoint(0)[0] is within 5 of 171
+PASS pixelDataAtPoint(0)[1] is within 5 of 0
+PASS pixelDataAtPoint(0)[2] is within 5 of 84
+PASS pixelDataAtPoint(0)[3] is within 5 of 191
+PASS pixelDataAtPoint(1)[0] is within 5 of 171
+PASS pixelDataAtPoint(1)[1] is within 5 of 171
+PASS pixelDataAtPoint(1)[2] is within 5 of 84
+PASS pixelDataAtPoint(1)[3] is within 5 of 191
+PASS pixelDataAtPoint(2)[0] is within 5 of 0
+PASS pixelDataAtPoint(2)[1] is within 5 of 85
+PASS pixelDataAtPoint(2)[2] is within 5 of 84
+PASS pixelDataAtPoint(2)[3] is within 5 of 191
+PASS pixelDataAtPoint(3)[0] is within 5 of 0
+PASS pixelDataAtPoint(3)[1] is within 5 of 0
+PASS pixelDataAtPoint(3)[2] is within 5 of 255
+PASS pixelDataAtPoint(3)[3] is within 5 of 191
+
</ins><span class="cx"> Testing blend mode &quot;multiply&quot;
</span><span class="cx"> solid on solid
</span><span class="cx"> PASS pixelDataAtPoint(0)[0] is within 5 of 0
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvascanvasblendsolidexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/canvas-blend-solid-expected.txt (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/canvas-blend-solid-expected.txt        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/LayoutTests/fast/canvas/canvas-blend-solid-expected.txt        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -73,6 +73,76 @@
</span><span class="cx"> PASS pixelDataAtPoint(3)[2] is within 5 of 255
</span><span class="cx"> PASS pixelDataAtPoint(3)[3] is within 5 of 191
</span><span class="cx"> 
</span><ins>+Testing blend mode &quot;normal&quot;
+solid on solid
+PASS pixelDataAtPoint(0)[0] is within 5 of 255
+PASS pixelDataAtPoint(0)[1] is within 5 of 0
+PASS pixelDataAtPoint(0)[2] is within 5 of 0
+PASS pixelDataAtPoint(0)[3] is within 5 of 255
+PASS pixelDataAtPoint(1)[0] is within 5 of 255
+PASS pixelDataAtPoint(1)[1] is within 5 of 255
+PASS pixelDataAtPoint(1)[2] is within 5 of 0
+PASS pixelDataAtPoint(1)[3] is within 5 of 255
+PASS pixelDataAtPoint(2)[0] is within 5 of 0
+PASS pixelDataAtPoint(2)[1] is within 5 of 128
+PASS pixelDataAtPoint(2)[2] is within 5 of 0
+PASS pixelDataAtPoint(2)[3] is within 5 of 255
+PASS pixelDataAtPoint(3)[0] is within 5 of 0
+PASS pixelDataAtPoint(3)[1] is within 5 of 0
+PASS pixelDataAtPoint(3)[2] is within 5 of 255
+PASS pixelDataAtPoint(3)[3] is within 5 of 255
+solid on alpha
+PASS pixelDataAtPoint(0)[0] is within 5 of 128
+PASS pixelDataAtPoint(0)[1] is within 5 of 0
+PASS pixelDataAtPoint(0)[2] is within 5 of 127
+PASS pixelDataAtPoint(0)[3] is within 5 of 255
+PASS pixelDataAtPoint(1)[0] is within 5 of 128
+PASS pixelDataAtPoint(1)[1] is within 5 of 128
+PASS pixelDataAtPoint(1)[2] is within 5 of 127
+PASS pixelDataAtPoint(1)[3] is within 5 of 255
+PASS pixelDataAtPoint(2)[0] is within 5 of 0
+PASS pixelDataAtPoint(2)[1] is within 5 of 64
+PASS pixelDataAtPoint(2)[2] is within 5 of 127
+PASS pixelDataAtPoint(2)[3] is within 5 of 255
+PASS pixelDataAtPoint(3)[0] is within 5 of 0
+PASS pixelDataAtPoint(3)[1] is within 5 of 0
+PASS pixelDataAtPoint(3)[2] is within 5 of 255
+PASS pixelDataAtPoint(3)[3] is within 5 of 255
+alpha on solid
+PASS pixelDataAtPoint(0)[0] is within 5 of 255
+PASS pixelDataAtPoint(0)[1] is within 5 of 0
+PASS pixelDataAtPoint(0)[2] is within 5 of 0
+PASS pixelDataAtPoint(0)[3] is within 5 of 255
+PASS pixelDataAtPoint(1)[0] is within 5 of 255
+PASS pixelDataAtPoint(1)[1] is within 5 of 255
+PASS pixelDataAtPoint(1)[2] is within 5 of 0
+PASS pixelDataAtPoint(1)[3] is within 5 of 255
+PASS pixelDataAtPoint(2)[0] is within 5 of 0
+PASS pixelDataAtPoint(2)[1] is within 5 of 128
+PASS pixelDataAtPoint(2)[2] is within 5 of 0
+PASS pixelDataAtPoint(2)[3] is within 5 of 255
+PASS pixelDataAtPoint(3)[0] is within 5 of 0
+PASS pixelDataAtPoint(3)[1] is within 5 of 0
+PASS pixelDataAtPoint(3)[2] is within 5 of 255
+PASS pixelDataAtPoint(3)[3] is within 5 of 255
+alpha on alpha
+PASS pixelDataAtPoint(0)[0] is within 5 of 171
+PASS pixelDataAtPoint(0)[1] is within 5 of 0
+PASS pixelDataAtPoint(0)[2] is within 5 of 84
+PASS pixelDataAtPoint(0)[3] is within 5 of 191
+PASS pixelDataAtPoint(1)[0] is within 5 of 171
+PASS pixelDataAtPoint(1)[1] is within 5 of 171
+PASS pixelDataAtPoint(1)[2] is within 5 of 84
+PASS pixelDataAtPoint(1)[3] is within 5 of 191
+PASS pixelDataAtPoint(2)[0] is within 5 of 0
+PASS pixelDataAtPoint(2)[1] is within 5 of 85
+PASS pixelDataAtPoint(2)[2] is within 5 of 84
+PASS pixelDataAtPoint(2)[3] is within 5 of 191
+PASS pixelDataAtPoint(3)[0] is within 5 of 0
+PASS pixelDataAtPoint(3)[1] is within 5 of 0
+PASS pixelDataAtPoint(3)[2] is within 5 of 255
+PASS pixelDataAtPoint(3)[3] is within 5 of 191
+
</ins><span class="cx"> Testing blend mode &quot;multiply&quot;
</span><span class="cx"> solid on solid
</span><span class="cx"> PASS pixelDataAtPoint(0)[0] is within 5 of 0
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvasscripttestscanvasblendimagejs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/script-tests/canvas-blend-image.js (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/script-tests/canvas-blend-image.js        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/LayoutTests/fast/canvas/script-tests/canvas-blend-image.js        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -26,101 +26,107 @@
</span><span class="cx"> // [blendMode, expectations solid on solid, expectations solid on alpha, expectations alpha on solid, expectations alpha on alpha]
</span><span class="cx"> [
</span><span class="cx">   ['source-over',
</span><del>-         [[255, 0, 0, 255],[255, 255, 0, 255],[0, 128, 0, 255],[0, 0, 255, 255]],
-         [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
-         [[255, 0, 0, 255],[255, 255, 0, 255],[0, 128, 0, 255],[0, 0, 255, 255]],
-         [[171, 0, 84, 191],[171, 171, 84, 191],[0, 85, 84, 191],[0, 0, 255, 191]]
</del><ins>+     [[255, 0, 0, 255],[255, 255, 0, 255],[0, 128, 0, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
+     [[255, 0, 0, 255],[255, 255, 0, 255],[0, 128, 0, 255],[0, 0, 255, 255]],
+     [[171, 0, 84, 191],[171, 171, 84, 191],[0, 85, 84, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><ins>+  ['normal',
+     [[255, 0, 0, 255],[255, 255, 0, 255],[0, 128, 0, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
+     [[255, 0, 0, 255],[255, 255, 0, 255],[0, 128, 0, 255],[0, 0, 255, 255]],
+     [[171, 0, 84, 191],[171, 171, 84, 191],[0, 85, 84, 191],[0, 0, 255, 191]]
+  ],
</ins><span class="cx">   ['multiply',
</span><del>-         [[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 255, 255]],
-         [[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
-         [[128, 0, 0, 255],[128, 128, 0, 255],[0, 64, 0, 255],[0, 0, 255, 255]],
-         [[85, 0, 84, 191],[85, 85, 84, 191],[0, 43, 84, 191],[0, 0, 255, 191]]
</del><ins>+     [[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 255, 255]],
+     [[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
+     [[128, 0, 0, 255],[128, 128, 0, 255],[0, 64, 0, 255],[0, 0, 255, 255]],
+     [[85, 0, 84, 191],[85, 85, 84, 191],[0, 43, 84, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['screen',
</span><del>-         [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 255, 255]],
-         [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 255, 255]],
-         [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 255, 255]],
-         [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 255, 191]]
</del><ins>+     [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 255, 255]],
+     [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 255, 255]],
+     [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 255, 255]],
+     [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['overlay',
</span><del>-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
-         [[85, 0, 170, 191],[85, 85, 170, 191],[0, 43, 170, 191],[0, 0, 255, 191]]
</del><ins>+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
+     [[85, 0, 170, 191],[85, 85, 170, 191],[0, 43, 170, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['darken',
</span><del>-         [[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 255, 255]],
-         [[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
-         [[128, 0, 0, 255],[128, 128, 0, 255],[0, 64, 0, 255],[0, 0, 255, 255]],
-         [[85, 0, 84, 191],[85, 85, 84, 191],[0, 43, 84, 191],[0, 0, 255, 191]]
</del><ins>+     [[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 255, 255]],
+     [[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
+     [[128, 0, 0, 255],[128, 128, 0, 255],[0, 64, 0, 255],[0, 0, 255, 255]],
+     [[85, 0, 84, 191],[85, 85, 84, 191],[0, 43, 84, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['lighten',
</span><del>-         [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 255, 255]],
-         [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 255, 255]],
-         [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 255, 255]],
-         [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 255, 191]]
</del><ins>+     [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 255, 255]],
+     [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 255, 255]],
+     [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 255, 255]],
+     [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['color-dodge',
</span><del>-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
-         [[85, 0, 170, 191],[85, 85, 170, 191],[0, 43, 170, 191],[0, 0, 255, 191]]
</del><ins>+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
+     [[85, 0, 170, 191],[85, 85, 170, 191],[0, 43, 170, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['color-burn',
</span><del>-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[128, 0, 127, 255],[128, 128, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
-         [[85, 0, 170, 191],[85, 85, 170, 191],[0, 0, 170, 191],[0, 0, 255, 191]]
</del><ins>+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
+     [[85, 0, 170, 191],[85, 85, 170, 191],[0, 0, 170, 191],[0, 0, 255, 191]]
</ins><span class="cx"> 
</span><span class="cx">   ],
</span><span class="cx">   ['hard-light',
</span><del>-         [[255, 0, 0, 255],[255, 255, 0, 255],[0, 1, 0, 255],[0, 0, 255, 255]],
-         [[128, 0, 127, 255],[128, 128, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
-         [[255, 0, 0, 255],[255, 255, 0, 255],[0, 65, 0, 255],[0, 0, 255, 255]],
-         [[171, 0, 84, 191],[171, 171, 84, 191],[0, 43, 84, 191],[0, 0, 255, 191]]
</del><ins>+     [[255, 0, 0, 255],[255, 255, 0, 255],[0, 1, 0, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
+     [[255, 0, 0, 255],[255, 255, 0, 255],[0, 65, 0, 255],[0, 0, 255, 255]],
+     [[171, 0, 84, 191],[171, 171, 84, 191],[0, 43, 84, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['soft-light',
</span><del>-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
-         [[85, 0, 170, 191],[85, 85, 170, 191],[0, 43, 170, 191],[0, 0, 255, 191]]
</del><ins>+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
+     [[85, 0, 170, 191],[85, 85, 170, 191],[0, 43, 170, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['difference',
</span><del>-         [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 0, 255]],
-         [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 127, 255]],
-         [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 128, 255]],
-         [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 171, 191]]
</del><ins>+     [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 0, 255]],
+     [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 127, 255]],
+     [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 128, 255]],
+     [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 171, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['exclusion',
</span><del>-         [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 0, 255]],
-         [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 127, 255]],
-         [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 128, 255]],
-         [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 171, 191]]
</del><ins>+     [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 0, 255]],
+     [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 127, 255]],
+     [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 128, 255]],
+     [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 171, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['hue',
</span><del>-         [[93, 0, 0, 255],[31, 31, 0, 255],[0, 46, 0, 255],[0, 0, 255, 255]],
-         [[49, 0, 127, 255],[16, 16, 127, 255],[0, 25, 127, 255],[0, 0, 255, 255]],
-         [[175, 0, 0, 255],[144, 144, 0, 255],[0, 88, 0, 255],[0, 0, 255, 255]],
-         [[116, 0, 84, 191],[96, 96, 84, 191],[0, 58, 84, 191],[0, 0, 255, 191]]
</del><ins>+     [[93, 0, 0, 255],[31, 31, 0, 255],[0, 46, 0, 255],[0, 0, 255, 255]],
+     [[49, 0, 127, 255],[16, 16, 127, 255],[0, 25, 127, 255],[0, 0, 255, 255]],
+     [[175, 0, 0, 255],[144, 144, 0, 255],[0, 88, 0, 255],[0, 0, 255, 255]],
+     [[116, 0, 84, 191],[96, 96, 84, 191],[0, 58, 84, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['saturation',
</span><del>-         [[0, 0, 255, 255],[0, 0, 255, 255],[14, 14, 142, 255],[0, 0, 255, 255]],
-         [[0, 0, 255, 255],[0, 0, 255, 255],[7, 7, 198, 255],[0, 0, 255, 255]],
-         [[128, 0, 127, 255],[128, 128, 127, 255],[7, 71, 70, 255],[0, 0, 255, 255]],
-         [[85, 0, 167, 191],[85, 85, 167, 191],[0, 48, 130, 191],[0, 0, 255, 191]]
</del><ins>+     [[0, 0, 255, 255],[0, 0, 255, 255],[14, 14, 142, 255],[0, 0, 255, 255]],
+     [[0, 0, 255, 255],[0, 0, 255, 255],[7, 7, 198, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[7, 71, 70, 255],[0, 0, 255, 255]],
+     [[85, 0, 167, 191],[85, 85, 167, 191],[0, 48, 130, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['color',
</span><del>-         [[93, 0, 0, 255],[31, 31, 0, 255],[0, 47, 0, 255],[0, 0, 255, 255]],
-         [[49, 0, 127, 255],[16, 16, 127, 255],[0, 24, 127, 255],[0, 0, 255, 255]],
-         [[175, 0, 0, 255],[144, 144, 0, 255],[0, 88, 0, 255],[0, 0, 255, 255]],
-         [[116, 0, 84, 191],[96, 96, 84, 191],[0, 58, 84, 191],[0, 0, 255, 191]]
</del><ins>+     [[93, 0, 0, 255],[31, 31, 0, 255],[0, 47, 0, 255],[0, 0, 255, 255]],
+     [[49, 0, 127, 255],[16, 16, 127, 255],[0, 24, 127, 255],[0, 0, 255, 255]],
+     [[175, 0, 0, 255],[144, 144, 0, 255],[0, 88, 0, 255],[0, 0, 255, 255]],
+     [[116, 0, 84, 191],[96, 96, 84, 191],[0, 58, 84, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['luminosity',
</span><del>-         [[55, 55, 255, 255],[224, 224, 255, 255],[54, 54, 255, 255],[0, 0, 255, 255]],
-         [[28, 28, 255, 255],[112, 112, 255, 255],[27, 27, 255, 255],[0, 0, 255, 255]],
-         [[155, 27, 127, 255],[239, 239, 127, 255],[26, 90, 127, 255],[0, 0, 255, 255]],
-         [[104, 19, 167, 191],[158, 158, 167, 191],[16, 58, 167, 191],[0, 0, 255, 191]]
</del><ins>+     [[55, 55, 255, 255],[224, 224, 255, 255],[54, 54, 255, 255],[0, 0, 255, 255]],
+     [[28, 28, 255, 255],[112, 112, 255, 255],[27, 27, 255, 255],[0, 0, 255, 255]],
+     [[155, 27, 127, 255],[239, 239, 127, 255],[26, 90, 127, 255],[0, 0, 255, 255]],
+     [[104, 19, 167, 191],[158, 158, 167, 191],[16, 58, 167, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ]];
</span><span class="cx"> 
</span><span class="cx"> // [Scenario, alpha on background, alpha on foreground]
</span><span class="lines">@@ -153,25 +159,25 @@
</span><span class="cx"> function prepareTestScenario(sigma) {
</span><span class="cx">   // Check each blend mode individually.
</span><span class="cx">   for (var i = 0; i &lt; blendModes.length; i++) {
</span><del>-        debug('Testing blend mode &quot;' + blendModes[i][0] + '&quot;');
-        for (var j = 0; j &lt; testScenario.length; j++) {
-          ctx.clearRect(0,0,200,200);
-          ctx.save();
-          
-          // Draw backdrop.
-          ctx.fillStyle = 'rgba(0, 0, 255, ' + testScenario[j][1] + ')';
-          ctx.fillRect(0,0,200,200);
-          
-          // Apply blend mode.
-          ctx.globalCompositeOperation = blendModes[i][0];
-          ctx.globalAlpha = testScenario[j][2];
-          ctx.drawImage(img, 0, 0);
-          
-          checkBlendModeResult(blendModes[i][0], testScenario[j][0], blendModes[i][j+1], sigma);
-          ctx.restore();                                  
-          }
-        debug('');
-        }
</del><ins>+    debug('Testing blend mode &quot;' + blendModes[i][0] + '&quot;');
+    for (var j = 0; j &lt; testScenario.length; j++) {
+      ctx.clearRect(0,0,200,200);
+      ctx.save();
+      
+      // Draw backdrop.
+      ctx.fillStyle = 'rgba(0, 0, 255, ' + testScenario[j][1] + ')';
+      ctx.fillRect(0,0,200,200);
+      
+      // Apply blend mode.
+      ctx.globalCompositeOperation = blendModes[i][0];
+      ctx.globalAlpha = testScenario[j][2];
+      ctx.drawImage(img, 0, 0);
+      
+      checkBlendModeResult(blendModes[i][0], testScenario[j][0], blendModes[i][j+1], sigma);
+      ctx.restore();                                  
+      }
+    debug('');
+    }
</ins><span class="cx">   }
</span><span class="cx"> 
</span><span class="cx"> // Run test and allow variation of results.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcanvasscripttestscanvasblendsolidjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/canvas/script-tests/canvas-blend-solid.js (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/canvas/script-tests/canvas-blend-solid.js        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/LayoutTests/fast/canvas/script-tests/canvas-blend-solid.js        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -27,101 +27,107 @@
</span><span class="cx"> // [blendMode, expectations solid on solid, expectations solid on alpha, expectations alpha on solid, expectations alpha on alpha]
</span><span class="cx"> [
</span><span class="cx">   ['source-over',
</span><del>-         [[255, 0, 0, 255],[255, 255, 0, 255],[0, 128, 0, 255],[0, 0, 255, 255]],
-         [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
-         [[255, 0, 0, 255],[255, 255, 0, 255],[0, 128, 0, 255],[0, 0, 255, 255]],
-         [[171, 0, 84, 191],[171, 171, 84, 191],[0, 85, 84, 191],[0, 0, 255, 191]]
</del><ins>+     [[255, 0, 0, 255],[255, 255, 0, 255],[0, 128, 0, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
+     [[255, 0, 0, 255],[255, 255, 0, 255],[0, 128, 0, 255],[0, 0, 255, 255]],
+     [[171, 0, 84, 191],[171, 171, 84, 191],[0, 85, 84, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><ins>+  ['normal',
+     [[255, 0, 0, 255],[255, 255, 0, 255],[0, 128, 0, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
+     [[255, 0, 0, 255],[255, 255, 0, 255],[0, 128, 0, 255],[0, 0, 255, 255]],
+     [[171, 0, 84, 191],[171, 171, 84, 191],[0, 85, 84, 191],[0, 0, 255, 191]]
+  ],
</ins><span class="cx">   ['multiply',
</span><del>-         [[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 255, 255]],
-         [[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
-         [[128, 0, 0, 255],[128, 128, 0, 255],[0, 64, 0, 255],[0, 0, 255, 255]],
-         [[85, 0, 84, 191],[85, 85, 84, 191],[0, 43, 84, 191],[0, 0, 255, 191]]
</del><ins>+     [[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 255, 255]],
+     [[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
+     [[128, 0, 0, 255],[128, 128, 0, 255],[0, 64, 0, 255],[0, 0, 255, 255]],
+     [[85, 0, 84, 191],[85, 85, 84, 191],[0, 43, 84, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['screen',
</span><del>-         [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 255, 255]],
-         [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 255, 255]],
-         [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 255, 255]],
-         [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 255, 191]]
</del><ins>+     [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 255, 255]],
+     [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 255, 255]],
+     [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 255, 255]],
+     [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['overlay',
</span><del>-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
-         [[85, 0, 170, 191],[85, 85, 170, 191],[0, 43, 170, 191],[0, 0, 255, 191]]
</del><ins>+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
+     [[85, 0, 170, 191],[85, 85, 170, 191],[0, 43, 170, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['darken',
</span><del>-         [[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 255, 255]],
-         [[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
-         [[128, 0, 0, 255],[128, 128, 0, 255],[0, 64, 0, 255],[0, 0, 255, 255]],
-         [[85, 0, 84, 191],[85, 85, 84, 191],[0, 43, 84, 191],[0, 0, 255, 191]]
</del><ins>+     [[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 0, 255],[0, 0, 255, 255]],
+     [[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
+     [[128, 0, 0, 255],[128, 128, 0, 255],[0, 64, 0, 255],[0, 0, 255, 255]],
+     [[85, 0, 84, 191],[85, 85, 84, 191],[0, 43, 84, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['lighten',
</span><del>-         [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 255, 255]],
-         [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 255, 255]],
-         [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 255, 255]],
-         [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 255, 191]]
</del><ins>+     [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 255, 255]],
+     [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 255, 255]],
+     [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 255, 255]],
+     [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['color-dodge',
</span><del>-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
-         [[85, 0, 170, 191],[85, 85, 170, 191],[0, 43, 170, 191],[0, 0, 255, 191]]
</del><ins>+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
+     [[85, 0, 170, 191],[85, 85, 170, 191],[0, 43, 170, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['color-burn',
</span><del>-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[128, 0, 127, 255],[128, 128, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
-         [[85, 0, 170, 191],[85, 85, 170, 191],[0, 0, 170, 191],[0, 0, 255, 191]]
</del><ins>+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
+     [[85, 0, 170, 191],[85, 85, 170, 191],[0, 0, 170, 191],[0, 0, 255, 191]]
</ins><span class="cx"> 
</span><span class="cx">   ],
</span><span class="cx">   ['hard-light',
</span><del>-         [[255, 0, 0, 255],[255, 255, 0, 255],[0, 1, 0, 255],[0, 0, 255, 255]],
-         [[128, 0, 127, 255],[128, 128, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
-         [[255, 0, 0, 255],[255, 255, 0, 255],[0, 65, 0, 255],[0, 0, 255, 255]],
-         [[171, 0, 84, 191],[171, 171, 84, 191],[0, 43, 84, 191],[0, 0, 255, 191]]
</del><ins>+     [[255, 0, 0, 255],[255, 255, 0, 255],[0, 1, 0, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[0, 0, 127, 255],[0, 0, 255, 255]],
+     [[255, 0, 0, 255],[255, 255, 0, 255],[0, 65, 0, 255],[0, 0, 255, 255]],
+     [[171, 0, 84, 191],[171, 171, 84, 191],[0, 43, 84, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['soft-light',
</span><del>-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
-         [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
-         [[85, 0, 170, 191],[85, 85, 170, 191],[0, 43, 170, 191],[0, 0, 255, 191]]
</del><ins>+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[0, 64, 127, 255],[0, 0, 255, 255]],
+     [[85, 0, 170, 191],[85, 85, 170, 191],[0, 43, 170, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['difference',
</span><del>-         [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 0, 255]],
-         [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 127, 255]],
-         [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 128, 255]],
-         [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 171, 191]]
</del><ins>+     [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 0, 255]],
+     [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 127, 255]],
+     [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 128, 255]],
+     [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 171, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['exclusion',
</span><del>-         [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 0, 255]],
-         [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 127, 255]],
-         [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 128, 255]],
-         [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 171, 191]]
</del><ins>+     [[255, 0, 255, 255],[255, 255, 255, 255],[0, 128, 255, 255],[0, 0, 0, 255]],
+     [[128, 0, 255, 255],[128, 128, 255, 255],[0, 64, 255, 255],[0, 0, 127, 255]],
+     [[255, 0, 127, 255],[255, 255, 127, 255],[0, 128, 127, 255],[0, 0, 128, 255]],
+     [[171, 0, 170, 191],[171, 171, 170, 191],[0, 85, 170, 191],[0, 0, 171, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['hue',
</span><del>-         [[93, 0, 0, 255],[31, 31, 0, 255],[0, 46, 0, 255],[0, 0, 255, 255]],
-         [[49, 0, 127, 255],[16, 16, 127, 255],[0, 25, 127, 255],[0, 0, 255, 255]],
-         [[175, 0, 0, 255],[144, 144, 0, 255],[0, 88, 0, 255],[0, 0, 255, 255]],
-         [[116, 0, 84, 191],[96, 96, 84, 191],[0, 58, 84, 191],[0, 0, 255, 191]]
</del><ins>+     [[93, 0, 0, 255],[31, 31, 0, 255],[0, 46, 0, 255],[0, 0, 255, 255]],
+     [[49, 0, 127, 255],[16, 16, 127, 255],[0, 25, 127, 255],[0, 0, 255, 255]],
+     [[175, 0, 0, 255],[144, 144, 0, 255],[0, 88, 0, 255],[0, 0, 255, 255]],
+     [[116, 0, 84, 191],[96, 96, 84, 191],[0, 58, 84, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['saturation',
</span><del>-         [[0, 0, 255, 255],[0, 0, 255, 255],[14, 14, 142, 255],[0, 0, 255, 255]],
-         [[0, 0, 255, 255],[0, 0, 255, 255],[7, 7, 198, 255],[0, 0, 255, 255]],
-         [[128, 0, 127, 255],[128, 128, 127, 255],[7, 71, 70, 255],[0, 0, 255, 255]],
-         [[85, 0, 167, 191],[85, 85, 167, 191],[0, 48, 130, 191],[0, 0, 255, 191]]
</del><ins>+     [[0, 0, 255, 255],[0, 0, 255, 255],[14, 14, 142, 255],[0, 0, 255, 255]],
+     [[0, 0, 255, 255],[0, 0, 255, 255],[7, 7, 198, 255],[0, 0, 255, 255]],
+     [[128, 0, 127, 255],[128, 128, 127, 255],[7, 71, 70, 255],[0, 0, 255, 255]],
+     [[85, 0, 167, 191],[85, 85, 167, 191],[0, 48, 130, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['color',
</span><del>-         [[93, 0, 0, 255],[31, 31, 0, 255],[0, 47, 0, 255],[0, 0, 255, 255]],
-         [[49, 0, 127, 255],[16, 16, 127, 255],[0, 24, 127, 255],[0, 0, 255, 255]],
-         [[175, 0, 0, 255],[144, 144, 0, 255],[0, 88, 0, 255],[0, 0, 255, 255]],
-         [[116, 0, 84, 191],[96, 96, 84, 191],[0, 58, 84, 191],[0, 0, 255, 191]]
</del><ins>+     [[93, 0, 0, 255],[31, 31, 0, 255],[0, 47, 0, 255],[0, 0, 255, 255]],
+     [[49, 0, 127, 255],[16, 16, 127, 255],[0, 24, 127, 255],[0, 0, 255, 255]],
+     [[175, 0, 0, 255],[144, 144, 0, 255],[0, 88, 0, 255],[0, 0, 255, 255]],
+     [[116, 0, 84, 191],[96, 96, 84, 191],[0, 58, 84, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ],
</span><span class="cx">   ['luminosity',
</span><del>-         [[55, 55, 255, 255],[224, 224, 255, 255],[54, 54, 255, 255],[0, 0, 255, 255]],
-         [[28, 28, 255, 255],[112, 112, 255, 255],[27, 27, 255, 255],[0, 0, 255, 255]],
-         [[155, 27, 127, 255],[239, 239, 127, 255],[26, 90, 127, 255],[0, 0, 255, 255]],
-         [[104, 19, 167, 191],[158, 158, 167, 191],[16, 58, 167, 191],[0, 0, 255, 191]]
</del><ins>+     [[55, 55, 255, 255],[224, 224, 255, 255],[54, 54, 255, 255],[0, 0, 255, 255]],
+     [[28, 28, 255, 255],[112, 112, 255, 255],[27, 27, 255, 255],[0, 0, 255, 255]],
+     [[155, 27, 127, 255],[239, 239, 127, 255],[26, 90, 127, 255],[0, 0, 255, 255]],
+     [[104, 19, 167, 191],[158, 158, 167, 191],[16, 58, 167, 191],[0, 0, 255, 191]]
</ins><span class="cx">   ]];
</span><span class="cx"> 
</span><span class="cx"> // [Scenario, alpha on background, alpha on foreground]
</span><span class="lines">@@ -154,34 +160,34 @@
</span><span class="cx"> function prepareTestScenario(sigma) {
</span><span class="cx">   // Check each blend mode individually.
</span><span class="cx">   for (var i = 0; i &lt; blendModes.length; i++) {
</span><del>-        debug('Testing blend mode &quot;' + blendModes[i][0] + '&quot;');
-        for (var j = 0; j &lt; testScenario.length; j++) {
-          ctx.globalCompositeOperation = 'clear';
-          ctx.fillRect(0,0,200,200);
-          ctx.globalCompositeOperation = 'source-over';
-          ctx.save();
-          
-          // Draw backdrop.
-          ctx.fillStyle = 'rgba(0, 0, 255, ' + testScenario[j][1] + ')';
-          ctx.fillRect(0,0,200,200);
-          
-          // Apply blend mode.
-          ctx.globalCompositeOperation = blendModes[i][0];
-          ctx.globalAlpha = testScenario[j][2];
-          ctx.fillStyle = &quot;red&quot;;
-          ctx.fillRect(0,0,100,100);
-          ctx.fillStyle = &quot;yellow&quot;;
-          ctx.fillRect(100,0,100,100);
-          ctx.fillStyle = &quot;green&quot;;
-          ctx.fillRect(100,100,100,100);
-          ctx.fillStyle = &quot;blue&quot;;
-          ctx.fillRect(0,100,100,100);
-          ctx.restore();
-          
-          checkBlendModeResult(blendModes[i][0], testScenario[j][0], blendModes[i][j+1], sigma);
-          ctx.restore();                                  
-          }
-        debug('');
</del><ins>+    debug('Testing blend mode &quot;' + blendModes[i][0] + '&quot;');
+    for (var j = 0; j &lt; testScenario.length; j++) {
+      ctx.globalCompositeOperation = 'clear';
+      ctx.fillRect(0,0,200,200);
+      ctx.globalCompositeOperation = 'source-over';
+      ctx.save();
+      
+      // Draw backdrop.
+      ctx.fillStyle = 'rgba(0, 0, 255, ' + testScenario[j][1] + ')';
+      ctx.fillRect(0,0,200,200);
+      
+      // Apply blend mode.
+      ctx.globalCompositeOperation = blendModes[i][0];
+      ctx.globalAlpha = testScenario[j][2];
+      ctx.fillStyle = &quot;red&quot;;
+      ctx.fillRect(0,0,100,100);
+      ctx.fillStyle = &quot;yellow&quot;;
+      ctx.fillRect(100,0,100,100);
+      ctx.fillStyle = &quot;green&quot;;
+      ctx.fillRect(100,100,100,100);
+      ctx.fillStyle = &quot;blue&quot;;
+      ctx.fillRect(0,100,100,100);
+      ctx.restore();
+      
+      checkBlendModeResult(blendModes[i][0], testScenario[j][0], blendModes[i][j+1], sigma);
+      ctx.restore();                                  
+      }
+    debug('');
</ins><span class="cx">   }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacsvgW3CSVG11filtersblend01bexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-blend-01-b-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacsvgW3CSVG11filtersblend01bexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-blend-01-b-expected.txt (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-blend-01-b-expected.txt        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-blend-01-b-expected.txt        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -6,23 +6,23 @@
</span><span class="cx">       RenderSVGImage {image} at (120,15) size 300x294
</span><span class="cx">       RenderSVGHiddenContainer {defs} at (0,0) size 0x0
</span><span class="cx">         RenderSVGResourceFilter {filter} [id=&quot;BlendNormal&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
</span><del>-          [feBlend mode=&quot;NORMAL&quot;]
</del><ins>+          [feBlend mode=&quot;normal&quot;]
</ins><span class="cx">             [SourceGraphic]
</span><span class="cx">             [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
</span><span class="cx">         RenderSVGResourceFilter {filter} [id=&quot;BlendMultiply&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
</span><del>-          [feBlend mode=&quot;MULTIPLY&quot;]
</del><ins>+          [feBlend mode=&quot;multiply&quot;]
</ins><span class="cx">             [SourceGraphic]
</span><span class="cx">             [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
</span><span class="cx">         RenderSVGResourceFilter {filter} [id=&quot;BlendScreen&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
</span><del>-          [feBlend mode=&quot;SCREEN&quot;]
</del><ins>+          [feBlend mode=&quot;screen&quot;]
</ins><span class="cx">             [SourceGraphic]
</span><span class="cx">             [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
</span><span class="cx">         RenderSVGResourceFilter {filter} [id=&quot;BlendDarken&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
</span><del>-          [feBlend mode=&quot;DARKEN&quot;]
</del><ins>+          [feBlend mode=&quot;darken&quot;]
</ins><span class="cx">             [SourceGraphic]
</span><span class="cx">             [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
</span><span class="cx">         RenderSVGResourceFilter {filter} [id=&quot;BlendLighten&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
</span><del>-          [feBlend mode=&quot;LIGHTEN&quot;]
</del><ins>+          [feBlend mode=&quot;lighten&quot;]
</ins><span class="cx">             [SourceGraphic]
</span><span class="cx">             [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
</span><span class="cx">       RenderSVGRect {rect} at (90,30) size 360x30 [opacity=0.50] [fill={[type=SOLID] [color=#0000FF]}] [x=30.00] [y=10.00] [width=120.00] [height=10.00]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacsvgfiltersfeBlendallblendmodesexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/mac/svg/filters/feBlend-all-blendmodes-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/mac/svg/filters/feBlend-all-blendmodes-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformmacsvgfiltersfeBlendallblendmodesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/svg/filters/feBlend-all-blendmodes-expected.txt (0 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/svg/filters/feBlend-all-blendmodes-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/svg/filters/feBlend-all-blendmodes-expected.txt        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -0,0 +1,106 @@
</span><ins>+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderSVGRoot {svg} at (0,0) size 400x100
+    RenderSVGResourceFilter {filter} [id=&quot;f0&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;normal&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
+      [filter=&quot;f0&quot;] RenderSVGResourceFilter {filter} at (0,0) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f1&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;multiply&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (50,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=50.00] [y=0.00] [width=50.00] [height=50.00]
+      [filter=&quot;f1&quot;] RenderSVGResourceFilter {filter} at (50,0) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f2&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;screen&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (100,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=100.00] [y=0.00] [width=50.00] [height=50.00]
+      [filter=&quot;f2&quot;] RenderSVGResourceFilter {filter} at (100,0) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f3&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;darken&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (150,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=150.00] [y=0.00] [width=50.00] [height=50.00]
+      [filter=&quot;f3&quot;] RenderSVGResourceFilter {filter} at (150,0) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f4&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;lighten&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (200,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=200.00] [y=0.00] [width=50.00] [height=50.00]
+      [filter=&quot;f4&quot;] RenderSVGResourceFilter {filter} at (200,0) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f5&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;overlay&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (250,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=250.00] [y=0.00] [width=50.00] [height=50.00]
+      [filter=&quot;f5&quot;] RenderSVGResourceFilter {filter} at (250,0) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f6&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;color-dodge&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (300,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=300.00] [y=0.00] [width=50.00] [height=50.00]
+      [filter=&quot;f6&quot;] RenderSVGResourceFilter {filter} at (300,0) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f7&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;color-burn&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (350,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=350.00] [y=0.00] [width=50.00] [height=50.00]
+      [filter=&quot;f7&quot;] RenderSVGResourceFilter {filter} at (350,0) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f8&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;hard-light&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
+      [filter=&quot;f8&quot;] RenderSVGResourceFilter {filter} at (0,0) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f9&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;soft-light&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (50,50) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=50.00] [y=50.00] [width=50.00] [height=50.00]
+      [filter=&quot;f9&quot;] RenderSVGResourceFilter {filter} at (50,50) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f10&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;difference&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (100,50) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=100.00] [y=50.00] [width=50.00] [height=50.00]
+      [filter=&quot;f10&quot;] RenderSVGResourceFilter {filter} at (100,50) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f11&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;exclusion&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (150,50) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=150.00] [y=50.00] [width=50.00] [height=50.00]
+      [filter=&quot;f11&quot;] RenderSVGResourceFilter {filter} at (150,50) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f12&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;hue&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (200,50) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=200.00] [y=50.00] [width=50.00] [height=50.00]
+      [filter=&quot;f12&quot;] RenderSVGResourceFilter {filter} at (200,50) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f13&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;saturation&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (250,50) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=250.00] [y=50.00] [width=50.00] [height=50.00]
+      [filter=&quot;f13&quot;] RenderSVGResourceFilter {filter} at (250,50) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f14&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;color&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (300,50) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=300.00] [y=50.00] [width=50.00] [height=50.00]
+      [filter=&quot;f14&quot;] RenderSVGResourceFilter {filter} at (300,50) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f15&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;luminosity&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (350,50) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=350.00] [y=50.00] [width=50.00] [height=50.00]
+      [filter=&quot;f15&quot;] RenderSVGResourceFilter {filter} at (350,50) size 50x50
+    RenderSVGResourceFilter {filter} [id=&quot;f16&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
+      [feBlend mode=&quot;normal&quot;]
+        [feFlood flood-color=&quot;#FF0000&quot; flood-opacity=&quot;0.50&quot;]
+        [feFlood flood-color=&quot;#00FF00&quot; flood-opacity=&quot;0.50&quot;]
+    RenderSVGRect {rect} at (0,50) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=50.00] [width=50.00] [height=50.00]
+      [filter=&quot;f16&quot;] RenderSVGResourceFilter {filter} at (0,50) size 50x50
</ins></span></pre></div>
<a id="trunkLayoutTestssvgcsspathgradientstrokeshadowexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/css/path-gradient-stroke-shadow-expected.txt (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/path-gradient-stroke-shadow-expected.txt        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/LayoutTests/svg/css/path-gradient-stroke-shadow-expected.txt        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx">         RenderSVGGradientStop {stop} [offset=0.00] [color=#FF0000]
</span><span class="cx">         RenderSVGGradientStop {stop} [offset=1.00] [color=#0000FF]
</span><span class="cx">       RenderSVGResourceFilter {filter} [id=&quot;shadow&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
</span><del>-        [feBlend mode=&quot;NORMAL&quot;]
</del><ins>+        [feBlend mode=&quot;normal&quot;]
</ins><span class="cx">           [SourceGraphic]
</span><span class="cx">           [feGaussianBlur stdDeviation=&quot;10.00, 10.00&quot;]
</span><span class="cx">             [feOffset dx=&quot;75.00&quot; dy=&quot;75.00&quot;]
</span></span></pre></div>
<a id="trunkLayoutTestssvgcssrectgradientstrokeshadowexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/css/rect-gradient-stroke-shadow-expected.txt (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/rect-gradient-stroke-shadow-expected.txt        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/LayoutTests/svg/css/rect-gradient-stroke-shadow-expected.txt        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx">         RenderSVGGradientStop {stop} [offset=0.00] [color=#FF0000]
</span><span class="cx">         RenderSVGGradientStop {stop} [offset=1.00] [color=#0000FF]
</span><span class="cx">       RenderSVGResourceFilter {filter} [id=&quot;shadow&quot;] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
</span><del>-        [feBlend mode=&quot;NORMAL&quot;]
</del><ins>+        [feBlend mode=&quot;normal&quot;]
</ins><span class="cx">           [SourceGraphic]
</span><span class="cx">           [feGaussianBlur stdDeviation=&quot;10.00, 10.00&quot;]
</span><span class="cx">             [feOffset dx=&quot;75.00&quot; dy=&quot;75.00&quot;]
</span></span></pre></div>
<a id="trunkLayoutTestssvgfiltersfeBlendallblendmodessvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/filters/feBlend-all-blendmodes.svg (0 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/filters/feBlend-all-blendmodes.svg                                (rev 0)
+++ trunk/LayoutTests/svg/filters/feBlend-all-blendmodes.svg        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; width=&quot;100%&quot; height=&quot;100%&quot;&gt;
+&lt;script&gt;
+    &lt;![CDATA[
+var blendModes = [&quot;normal&quot;, &quot;multiply&quot;, &quot;screen&quot;, &quot;darken&quot;, &quot;lighten&quot;, &quot;overlay&quot;, &quot;color-dodge&quot;, &quot;color-burn&quot;, &quot;hard-light&quot;, &quot;soft-light&quot;, &quot;difference&quot;, &quot;exclusion&quot;, &quot;hue&quot;, &quot;saturation&quot;, &quot;color&quot;, &quot;luminosity&quot;];
+var svgElement = document.rootElement;
+var svgns = 'http://www.w3.org/2000/svg';
+for (var i = 0; i &lt;= blendModes.length; i++) {
+    var filter = document.createElementNS(svgns, 'filter');
+    filter.setAttribute('id', 'f'+i);
+    filter.setAttribute('x', '0%');
+    filter.setAttribute('y', '0%');
+    filter.setAttribute('width', '100%');
+    filter.setAttribute('height', '100%');
+    var floodA = document.createElementNS(svgns, 'feFlood');
+    floodA.setAttribute('result', 'a');
+    floodA.setAttribute('flood-color', 'rgb(255,0,0)');
+    floodA.setAttribute('flood-opacity', '0.5');
+    var floodB = document.createElementNS(svgns, 'feFlood');
+    floodB.setAttribute('result', 'b');
+    floodB.setAttribute('flood-color', 'rgb(0,255,0)');
+    floodB.setAttribute('flood-opacity', '0.5');
+    var blend = document.createElementNS(svgns, 'feBlend');
+    blend.setAttribute('in', 'a');
+    blend.setAttribute('in2', 'b');
+    blend.setAttribute('mode', blendModes[i]);
+    filter.appendChild(floodA);
+    filter.appendChild(floodB);
+    filter.appendChild(blend);
+    svgElement.appendChild(filter);
+    var rect =  document.createElementNS(svgns, 'rect');
+    rect.setAttribute('x', (i%8)*50);
+    rect.setAttribute('y', (i &gt; 8 ? 50: 0));
+    rect.setAttribute('width', '50');
+    rect.setAttribute('height', '50');
+    rect.setAttribute('filter', 'url(#f'+i+')');
+    svgElement.appendChild(rect);
+}]]&gt;
+&lt;/script&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/Source/WebCore/ChangeLog        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -1,3 +1,70 @@
</span><ins>+2014-06-25  Dirk Schulze  &lt;krit@webkit.org&gt;
+
+        Add all blend modes to feBlend
+
+        feBlend should support all blend modes from CSS and Canvas
+        https://bugs.webkit.org/show_bug.cgi?id=134296
+
+        Reviewed by Dean Jackson.
+
+        Add all blend modes to &lt;feBlend&gt; (the SVG filter primitive) that are also
+        supported by HTML Canvas and CSS.
+
+        In addition, add &quot;normal&quot; blend mode to HTML Canvas as requested by the
+        CSS Compositing and Blending specification. (Referenced from HTML Canvas.)
+        With this change, SVG, CSS and Canvas truly share the same blend modes and
+        even the same keywords. This is much easier to for web authors.
+
+        http://www.w3.org/TR/2014/CR-compositing-1-20140220/#ltblendmodegt
+
+        Test: svg/filters/feBlend-all-blendmodes.svg
+
+        * platform/graphics/GraphicsTypes.cpp: Reorder blend mode text streams to match
+            enumeration order. Add a new function to parse blend modes independent of
+            compositing modes. Add a string &quot;normal&quot; that is supported by CSS, feBlend and
+            HTML Canvas now.
+        (WebCore::parseBlendMode):
+        (WebCore::parseCompositeAndBlendOperator):
+        * platform/graphics/GraphicsTypes.h: Reorder BlendMode enumeration values to match
+         the SVG JS enumeration for blend modes.
+        * platform/graphics/cpu/arm/filters/FEBlendNEON.h: Move all software code that is no
+            longer required by the software path but still used by NEON here.
+        (WebCore::FEBlend::platformApplySoftware):
+        (WebCore::FEBlend::platformApplyNEON):
+        * platform/graphics/filters/FEBlend.cpp:
+            Use drawImageBuffer() to blend the results of previous filter primitives. This
+            allows removing more than 60% of the code.
+        (WebCore::FEBlend::FEBlend):
+        (WebCore::FEBlend::create):
+        (WebCore::FEBlend::blendMode):
+        (WebCore::FEBlend::setBlendMode):
+        (WebCore::FEBlend::platformApplySoftware):
+        (WebCore::FEBlend::dump):
+        (WebCore::FEBlend::externalRepresentation):
+        (WebCore::feBlendNormal): Deleted.
+        (WebCore::feBlendMultiply): Deleted.
+        (WebCore::feBlendScreen): Deleted.
+        (WebCore::feBlendDarken): Deleted.
+        (WebCore::feBlendLighten): Deleted.
+        (WebCore::feBlendUnknown): Deleted.
+        (WebCore::platformApply): Deleted.
+        (WebCore::FEBlend::platformApplyGeneric): Deleted.
+        (WebCore::operator&lt;&lt;): Deleted.
+        * platform/graphics/filters/FEBlend.h:
+        * svg/SVGAnimatedEnumeration.cpp: Use the global BlendMode enumeration.
+        (WebCore::enumerationValueForTargetAttribute):
+        * svg/SVGFEBlendElement.cpp:
+        (WebCore::SVGFEBlendElement::SVGFEBlendElement): Use the global BlendMode enumeration.
+            No new enumeration values added or exposed to SVG DOM as requested by SVG WG.
+        (WebCore::SVGFEBlendElement::parseAttribute):
+        * svg/SVGFEBlendElement.h: Replace BlendModeType with global BlendMode enumeration. Remove
+            blend mode parsing code and use the code in GraphicsTypes instead.
+        (WebCore::SVGPropertyTraits&lt;BlendMode&gt;::highestEnumValue):
+        (WebCore::SVGPropertyTraits&lt;BlendMode&gt;::toString):
+        (WebCore::SVGPropertyTraits&lt;BlendModeType&gt;::highestEnumValue): Deleted.
+        (WebCore::SVGPropertyTraits&lt;BlendModeType&gt;::toString): Deleted.
+        (WebCore::SVGPropertyTraits&lt;BlendModeType&gt;::fromString): Deleted.
+
</ins><span class="cx"> 2014-06-25  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed iOS build fix after r170425.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsTypescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsTypes.cpp (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsTypes.cpp        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/Source/WebCore/platform/graphics/GraphicsTypes.cpp        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2006 Apple Inc.  All rights reserved.
</span><span class="cx">  * Copyright (C) 2012 Rik Cabanier (cabanier@adobe.com)
</span><ins>+ * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -49,11 +50,12 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> static const char* const blendOperatorNames[] = {
</span><ins>+    &quot;normal&quot;,
</ins><span class="cx">     &quot;multiply&quot;,
</span><span class="cx">     &quot;screen&quot;,
</span><del>-    &quot;overlay&quot;,
</del><span class="cx">     &quot;darken&quot;,
</span><span class="cx">     &quot;lighten&quot;,
</span><ins>+    &quot;overlay&quot;,
</ins><span class="cx">     &quot;color-dodge&quot;,
</span><span class="cx">     &quot;color-burn&quot;,
</span><span class="cx">     &quot;hard-light&quot;,
</span><span class="lines">@@ -68,6 +70,18 @@
</span><span class="cx"> const int numCompositeOperatorNames = WTF_ARRAY_LENGTH(compositeOperatorNames);
</span><span class="cx"> const int numBlendOperatorNames = WTF_ARRAY_LENGTH(blendOperatorNames);
</span><span class="cx"> 
</span><ins>+bool parseBlendMode(const String&amp; s, BlendMode&amp; blendMode)
+{
+    for (int i = 0; i &lt; numBlendOperatorNames; i++) {
+        if (s == blendOperatorNames[i]) {
+            blendMode = static_cast&lt;BlendMode&gt;(i+1);
+            return true;
+        }
+    }
+    
+    return false;
+}
+
</ins><span class="cx"> bool parseCompositeAndBlendOperator(const String&amp; s, CompositeOperator&amp; op, BlendMode&amp; blendOp)
</span><span class="cx"> {
</span><span class="cx">     for (int i = 0; i &lt; numCompositeOperatorNames; i++) {
</span><span class="lines">@@ -78,13 +92,10 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     
</span><del>-    for (int i = 0; i &lt; numBlendOperatorNames; i++) {
-        if (s == blendOperatorNames[i]) {
-            blendOp = static_cast&lt;BlendMode&gt;(i+1);
-            // For now, blending will always assume source-over. This will be fixed in the future
-            op = CompositeSourceOver;
-            return true;
-        }
</del><ins>+    if (parseBlendMode(s, blendOp)) {
+        // For now, blending will always assume source-over. This will be fixed in the future
+        op = CompositeSourceOver;
+        return true;
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return false;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsTypesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsTypes.h (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsTypes.h        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/Source/WebCore/platform/graphics/GraphicsTypes.h        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -48,12 +48,12 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     enum BlendMode {
</span><del>-        BlendModeNormal,
</del><ins>+        BlendModeNormal = 1, // Start with 1 to match SVG's blendmode enumeration.
</ins><span class="cx">         BlendModeMultiply,
</span><span class="cx">         BlendModeScreen,
</span><del>-        BlendModeOverlay,
</del><span class="cx">         BlendModeDarken,
</span><span class="cx">         BlendModeLighten,
</span><ins>+        BlendModeOverlay,
</ins><span class="cx">         BlendModeColorDodge,
</span><span class="cx">         BlendModeColorBurn,
</span><span class="cx">         BlendModeHardLight,
</span><span class="lines">@@ -83,6 +83,7 @@
</span><span class="cx">     enum TextAlign { StartTextAlign, EndTextAlign, LeftTextAlign, CenterTextAlign, RightTextAlign };
</span><span class="cx"> 
</span><span class="cx">     String compositeOperatorName(CompositeOperator, BlendMode);
</span><ins>+    bool parseBlendMode(const String&amp;, BlendMode&amp;);
</ins><span class="cx">     bool parseCompositeAndBlendOperator(const String&amp;, CompositeOperator&amp;, BlendMode&amp;);
</span><span class="cx"> 
</span><span class="cx">     String lineCapName(LineCap);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscpuarmfiltersFEBlendNEONh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cpu/arm/filters/FEBlendNEON.h (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cpu/arm/filters/FEBlendNEON.h        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/Source/WebCore/platform/graphics/cpu/arm/filters/FEBlendNEON.h        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2012 University of Szeged
</span><span class="cx">  * Copyright (C) 2012 Gabor Rapcsanyi
</span><ins>+ * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -105,6 +106,39 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+void FEBlend::platformApplySoftware()
+{
+    FilterEffect* in = inputEffect(0);
+    FilterEffect* in2 = inputEffect(1);
+
+    Uint8ClampedArray* dstPixelArray = createPremultipliedImageResult();
+    if (!dstPixelArray)
+        return;
+
+    IntRect effectADrawingRect = requestedRegionOfInputImageData(in-&gt;absolutePaintRect());
+    RefPtr&lt;Uint8ClampedArray&gt; srcPixelArrayA = in-&gt;asPremultipliedImage(effectADrawingRect);
+
+    IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2-&gt;absolutePaintRect());
+    RefPtr&lt;Uint8ClampedArray&gt; srcPixelArrayB = in2-&gt;asPremultipliedImage(effectBDrawingRect);
+
+    unsigned pixelArrayLength = srcPixelArrayA-&gt;length();
+    ASSERT(pixelArrayLength == srcPixelArrayB-&gt;length());
+
+    if (pixelArrayLength &gt;= 8) {
+        platformApplyNEON(srcPixelArrayA-&gt;data(), srcPixelArrayB-&gt;data(), dstPixelArray-&gt;data(), pixelArrayLength);
+        return
+    }
+    // If there is just one pixel we expand it to two.
+    ASSERT(pixelArrayLength &gt; 0);
+    uint32_t sourceA[2] = {0, 0};
+    uint32_t sourceBAndDest[2] = {0, 0};
+
+    sourceA[0] = reinterpret_cast&lt;uint32_t*&gt;(srcPixelArrayA-&gt;data())[0];
+    sourceBAndDest[0] = reinterpret_cast&lt;uint32_t*&gt;(srcPixelArrayB-&gt;data())[0];
+    platformApplyNEON(reinterpret_cast&lt;uint8_t*&gt;(sourceA), reinterpret_cast&lt;uint8_t*&gt;(sourceBAndDest), reinterpret_cast&lt;uint8_t*&gt;(sourceBAndDest), 8);
+    reinterpret_cast&lt;uint32_t*&gt;(dstPixelArray-&gt;data())[0] = sourceBAndDest[0];
+}
+
</ins><span class="cx"> void FEBlend::platformApplyNEON(unsigned char* srcPixelArrayA, unsigned char* srcPixelArrayB, unsigned char* dstPixelArray,
</span><span class="cx">                                 unsigned colorArrayLength)
</span><span class="cx"> {
</span><span class="lines">@@ -129,22 +163,21 @@
</span><span class="cx"> 
</span><span class="cx">         uint16x8_t result;
</span><span class="cx">         switch (m_mode) {
</span><del>-        case FEBLEND_MODE_NORMAL:
</del><ins>+        case BlendModeNormal:
</ins><span class="cx">             result = FEBlendUtilitiesNEON::normal(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
</span><span class="cx">             break;
</span><del>-        case FEBLEND_MODE_MULTIPLY:
</del><ins>+        case BlendModeMultiply:
</ins><span class="cx">             result = FEBlendUtilitiesNEON::multiply(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
</span><span class="cx">             break;
</span><del>-        case FEBLEND_MODE_SCREEN:
</del><ins>+        case BlendModeScreen:
</ins><span class="cx">             result = FEBlendUtilitiesNEON::screen(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
</span><span class="cx">             break;
</span><del>-        case FEBLEND_MODE_DARKEN:
</del><ins>+        case BlendModeDarken:
</ins><span class="cx">             result = FEBlendUtilitiesNEON::darken(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
</span><span class="cx">             break;
</span><del>-        case FEBLEND_MODE_LIGHTEN:
</del><ins>+        case BlendModeLighten:
</ins><span class="cx">             result = FEBlendUtilitiesNEON::lighten(doubblePixelA, doubblePixelB, alphaA, alphaB, sixteenConst255, sixteenConstOne);
</span><span class="cx">             break;
</span><del>-        case FEBLEND_MODE_UNKNOWN:
</del><span class="cx">         default:
</span><span class="cx">             result = vdupq_n_u16(0);
</span><span class="cx">             break;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFEBlendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FEBlend.cpp (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FEBlend.cpp        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/Source/WebCore/platform/graphics/filters/FEBlend.cpp        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -4,6 +4,7 @@
</span><span class="cx">  * Copyright (C) 2005 Eric Seidel &lt;eric@webkit.org&gt;
</span><span class="cx">  * Copyright (C) 2009 Dirk Schulze &lt;krit@webkit.org&gt;
</span><span class="cx">  * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
</span><ins>+ * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -34,27 +35,25 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;runtime/Uint8ClampedArray.h&gt;
</span><span class="cx"> 
</span><del>-typedef unsigned char (*BlendType)(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char alphaB);
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-FEBlend::FEBlend(Filter* filter, BlendModeType mode)
</del><ins>+FEBlend::FEBlend(Filter* filter, BlendMode mode)
</ins><span class="cx">     : FilterEffect(filter)
</span><span class="cx">     , m_mode(mode)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;FEBlend&gt; FEBlend::create(Filter* filter, BlendModeType mode)
</del><ins>+PassRefPtr&lt;FEBlend&gt; FEBlend::create(Filter* filter, BlendMode mode)
</ins><span class="cx"> {
</span><span class="cx">     return adoptRef(new FEBlend(filter, mode));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-BlendModeType FEBlend::blendMode() const
</del><ins>+BlendMode FEBlend::blendMode() const
</ins><span class="cx"> {
</span><span class="cx">     return m_mode;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool FEBlend::setBlendMode(BlendModeType mode)
</del><ins>+bool FEBlend::setBlendMode(BlendMode mode)
</ins><span class="cx"> {
</span><span class="cx">     if (m_mode == mode)
</span><span class="cx">         return false;
</span><span class="lines">@@ -62,153 +61,37 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline unsigned char feBlendNormal(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char)
-{
-    return fastDivideBy255((255 - alphaA) * colorB + colorA * 255);
-}
-
-inline unsigned char feBlendMultiply(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char alphaB)
-{
-    return fastDivideBy255((255 - alphaA) * colorB + (255 - alphaB + colorB) * colorA);
-}
-
-inline unsigned char feBlendScreen(unsigned char colorA, unsigned char colorB, unsigned char, unsigned char)
-{
-    return fastDivideBy255((colorB + colorA) * 255 - colorA * colorB);
-}
-
-inline unsigned char feBlendDarken(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char alphaB)
-{
-    return fastDivideBy255(std::min((255 - alphaA) * colorB + colorA * 255, (255 - alphaB) * colorA + colorB * 255));
-}
-
-inline unsigned char feBlendLighten(unsigned char colorA, unsigned char colorB, unsigned char alphaA, unsigned char alphaB)
-{
-    return fastDivideBy255(std::max((255 - alphaA) * colorB + colorA * 255, (255 - alphaB) * colorA + colorB * 255));
-}
-
-inline unsigned char feBlendUnknown(unsigned char, unsigned char, unsigned char, unsigned char)
-{
-    return 0;
-}
-
-template&lt;BlendType BlendFunction&gt;
-static void platformApply(unsigned char* sourcePixelA, unsigned char* sourcePixelB,
-                          unsigned char* destinationPixel, unsigned pixelArrayLength)
-{
-    unsigned len = pixelArrayLength / 4;
-    for (unsigned pixelOffset = 0; pixelOffset &lt; len; pixelOffset++) {
-        unsigned char alphaA = sourcePixelA[3];
-        unsigned char alphaB = sourcePixelB[3];
-        destinationPixel[0] = BlendFunction(sourcePixelA[0], sourcePixelB[0], alphaA, alphaB);
-        destinationPixel[1] = BlendFunction(sourcePixelA[1], sourcePixelB[1], alphaA, alphaB);
-        destinationPixel[2] = BlendFunction(sourcePixelA[2], sourcePixelB[2], alphaA, alphaB);
-        destinationPixel[3] = 255 - fastDivideBy255((255 - alphaA) * (255 - alphaB));
-        sourcePixelA += 4;
-        sourcePixelB += 4;
-        destinationPixel += 4;
-    }
-}
-
-void FEBlend::platformApplyGeneric(unsigned char* sourcePixelA, unsigned char* sourcePixelB,
-                                   unsigned char* destinationPixel, unsigned pixelArrayLength)
-{
-    switch (m_mode) {
-    case FEBLEND_MODE_NORMAL:
-        platformApply&lt;feBlendNormal&gt;(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
-        break;
-    case FEBLEND_MODE_MULTIPLY:
-        platformApply&lt;feBlendMultiply&gt;(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
-        break;
-    case FEBLEND_MODE_SCREEN:
-        platformApply&lt;feBlendScreen&gt;(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
-        break;
-    case FEBLEND_MODE_DARKEN:
-        platformApply&lt;feBlendDarken&gt;(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
-        break;
-    case FEBLEND_MODE_LIGHTEN:
-        platformApply&lt;feBlendLighten&gt;(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
-        break;
-    case FEBLEND_MODE_UNKNOWN:
-        platformApply&lt;feBlendUnknown&gt;(sourcePixelA, sourcePixelB, destinationPixel, pixelArrayLength);
-        break;
-    }
-}
-
</del><ins>+#if !HAVE(ARM_NEON_INTRINSICS)
</ins><span class="cx"> void FEBlend::platformApplySoftware()
</span><span class="cx"> {
</span><span class="cx">     FilterEffect* in = inputEffect(0);
</span><span class="cx">     FilterEffect* in2 = inputEffect(1);
</span><span class="cx"> 
</span><del>-    ASSERT(m_mode &gt; FEBLEND_MODE_UNKNOWN);
-    ASSERT(m_mode &lt;= FEBLEND_MODE_LIGHTEN);
-
-    Uint8ClampedArray* dstPixelArray = createPremultipliedImageResult();
-    if (!dstPixelArray)
</del><ins>+    ImageBuffer* resultImage = createImageBufferResult();
+    if (!resultImage)
</ins><span class="cx">         return;
</span><ins>+    GraphicsContext* filterContext = resultImage-&gt;context();
</ins><span class="cx"> 
</span><del>-    IntRect effectADrawingRect = requestedRegionOfInputImageData(in-&gt;absolutePaintRect());
-    RefPtr&lt;Uint8ClampedArray&gt; srcPixelArrayA = in-&gt;asPremultipliedImage(effectADrawingRect);
</del><ins>+    ImageBuffer* imageBuffer = in-&gt;asImageBuffer();
+    ImageBuffer* imageBuffer2 = in2-&gt;asImageBuffer();
+    ASSERT(imageBuffer);
+    ASSERT(imageBuffer2);
</ins><span class="cx"> 
</span><del>-    IntRect effectBDrawingRect = requestedRegionOfInputImageData(in2-&gt;absolutePaintRect());
-    RefPtr&lt;Uint8ClampedArray&gt; srcPixelArrayB = in2-&gt;asPremultipliedImage(effectBDrawingRect);
-
-    unsigned pixelArrayLength = srcPixelArrayA-&gt;length();
-    ASSERT(pixelArrayLength == srcPixelArrayB-&gt;length());
-
-#if HAVE(ARM_NEON_INTRINSICS)
-    if (pixelArrayLength &gt;= 8)
-        platformApplyNEON(srcPixelArrayA-&gt;data(), srcPixelArrayB-&gt;data(), dstPixelArray-&gt;data(), pixelArrayLength);
-    else { // If there is just one pixel we expand it to two.
-        ASSERT(pixelArrayLength &gt; 0);
-        uint32_t sourceA[2] = {0, 0};
-        uint32_t sourceBAndDest[2] = {0, 0};
-
-        sourceA[0] = reinterpret_cast&lt;uint32_t*&gt;(srcPixelArrayA-&gt;data())[0];
-        sourceBAndDest[0] = reinterpret_cast&lt;uint32_t*&gt;(srcPixelArrayB-&gt;data())[0];
-        platformApplyNEON(reinterpret_cast&lt;uint8_t*&gt;(sourceA), reinterpret_cast&lt;uint8_t*&gt;(sourceBAndDest), reinterpret_cast&lt;uint8_t*&gt;(sourceBAndDest), 8);
-        reinterpret_cast&lt;uint32_t*&gt;(dstPixelArray-&gt;data())[0] = sourceBAndDest[0];
-    }
-#else
-    platformApplyGeneric(srcPixelArrayA-&gt;data(), srcPixelArrayB-&gt;data(), dstPixelArray-&gt;data(), pixelArrayLength);
-#endif
</del><ins>+    filterContext-&gt;drawImageBuffer(imageBuffer2, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in2-&gt;absolutePaintRect()));
+    filterContext-&gt;drawImageBuffer(imageBuffer, ColorSpaceDeviceRGB, drawingRegionOfInputImage(in-&gt;absolutePaintRect()), IntRect(IntPoint(), imageBuffer-&gt;logicalSize()), ImagePaintingOptions(CompositeSourceOver, m_mode));
</ins><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> void FEBlend::dump()
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static TextStream&amp; operator&lt;&lt;(TextStream&amp; ts, const BlendModeType&amp; type)
-{
-    switch (type) {
-    case FEBLEND_MODE_UNKNOWN:
-        ts &lt;&lt; &quot;UNKNOWN&quot;;
-        break;
-    case FEBLEND_MODE_NORMAL:
-        ts &lt;&lt; &quot;NORMAL&quot;;
-        break;
-    case FEBLEND_MODE_MULTIPLY:
-        ts &lt;&lt; &quot;MULTIPLY&quot;;
-        break;
-    case FEBLEND_MODE_SCREEN:
-        ts &lt;&lt; &quot;SCREEN&quot;;
-        break;
-    case FEBLEND_MODE_DARKEN:
-        ts &lt;&lt; &quot;DARKEN&quot;;
-        break;
-    case FEBLEND_MODE_LIGHTEN:
-        ts &lt;&lt; &quot;LIGHTEN&quot;;
-        break;
-    }
-    return ts;
-}
-
</del><span class="cx"> TextStream&amp; FEBlend::externalRepresentation(TextStream&amp; ts, int indent) const
</span><span class="cx"> {
</span><span class="cx">     writeIndent(ts, indent);
</span><span class="cx">     ts &lt;&lt; &quot;[feBlend&quot;;
</span><span class="cx">     FilterEffect::externalRepresentation(ts);
</span><del>-    ts &lt;&lt; &quot; mode=\&quot;&quot; &lt;&lt; m_mode &lt;&lt; &quot;\&quot;]\n&quot;;
</del><ins>+    ts &lt;&lt; &quot; mode=\&quot;&quot; &lt;&lt; (m_mode == BlendModeNormal ? &quot;normal&quot; : compositeOperatorName(CompositeSourceOver, m_mode)) &lt;&lt; &quot;\&quot;]\n&quot;;
</ins><span class="cx">     inputEffect(0)-&gt;externalRepresentation(ts, indent + 1);
</span><span class="cx">     inputEffect(1)-&gt;externalRepresentation(ts, indent + 1);
</span><span class="cx">     return ts;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFEBlendh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FEBlend.h (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FEBlend.h        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/Source/WebCore/platform/graphics/filters/FEBlend.h        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -2,6 +2,7 @@
</span><span class="cx">  * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann &lt;zimmermann@kde.org&gt;
</span><span class="cx">  * Copyright (C) 2004, 2005 Rob Buis &lt;buis@kde.org&gt;
</span><span class="cx">  * Copyright (C) 2005 Eric Seidel &lt;eric@webkit.org&gt;
</span><ins>+ * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -29,21 +30,12 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-enum BlendModeType {
-    FEBLEND_MODE_UNKNOWN = 0,
-    FEBLEND_MODE_NORMAL = 1,
-    FEBLEND_MODE_MULTIPLY = 2,
-    FEBLEND_MODE_SCREEN = 3,
-    FEBLEND_MODE_DARKEN = 4,
-    FEBLEND_MODE_LIGHTEN = 5
-};
-
</del><span class="cx"> class FEBlend : public FilterEffect {
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;FEBlend&gt; create(Filter*, BlendModeType);
</del><ins>+    static PassRefPtr&lt;FEBlend&gt; create(Filter*, BlendMode);
</ins><span class="cx"> 
</span><del>-    BlendModeType blendMode() const;
-    bool setBlendMode(BlendModeType);
</del><ins>+    BlendMode blendMode() const;
+    bool setBlendMode(BlendMode);
</ins><span class="cx"> 
</span><span class="cx">     void platformApplyGeneric(unsigned char* srcPixelArrayA, unsigned char* srcPixelArrayB, unsigned char* dstPixelArray,
</span><span class="cx">                            unsigned colorArrayLength);
</span><span class="lines">@@ -55,9 +47,9 @@
</span><span class="cx">     virtual TextStream&amp; externalRepresentation(TextStream&amp;, int indention) const;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    FEBlend(Filter*, BlendModeType);
</del><ins>+    FEBlend(Filter*, BlendMode);
</ins><span class="cx"> 
</span><del>-    BlendModeType m_mode;
</del><ins>+    BlendMode m_mode;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGAnimatedEnumerationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGAnimatedEnumeration.cpp (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGAnimatedEnumeration.cpp        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/Source/WebCore/svg/SVGAnimatedEnumeration.cpp        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -86,8 +86,11 @@
</span><span class="cx">         return SVGPropertyTraits&lt;ComponentTransferType&gt;::fromString(value);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (attrName == SVGNames::modeAttr)
-        return SVGPropertyTraits&lt;BlendModeType&gt;::fromString(value);
</del><ins>+    if (attrName == SVGNames::modeAttr) {
+        BlendMode mode = BlendModeNormal;
+        parseBlendMode(value, mode);
+        return mode;
+    }
</ins><span class="cx">     if (attrName == SVGNames::stitchTilesAttr)
</span><span class="cx">         return SVGPropertyTraits&lt;SVGStitchOptions&gt;::fromString(value);
</span><span class="cx">     if (attrName == SVGNames::xChannelSelectorAttr)
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFEBlendElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFEBlendElement.cpp (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFEBlendElement.cpp        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/Source/WebCore/svg/SVGFEBlendElement.cpp        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann &lt;zimmermann@kde.org&gt;
</span><span class="cx">  * Copyright (C) 2004, 2005, 2006 Rob Buis &lt;buis@kde.org&gt;
</span><ins>+ * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -35,7 +36,7 @@
</span><span class="cx"> // Animated property definitions
</span><span class="cx"> DEFINE_ANIMATED_STRING(SVGFEBlendElement, SVGNames::inAttr, In1, in1)
</span><span class="cx"> DEFINE_ANIMATED_STRING(SVGFEBlendElement, SVGNames::in2Attr, In2, in2)
</span><del>-DEFINE_ANIMATED_ENUMERATION(SVGFEBlendElement, SVGNames::modeAttr, Mode, mode, BlendModeType)
</del><ins>+DEFINE_ANIMATED_ENUMERATION(SVGFEBlendElement, SVGNames::modeAttr, Mode, mode, BlendMode)
</ins><span class="cx"> 
</span><span class="cx"> BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFEBlendElement)
</span><span class="cx">     REGISTER_LOCAL_ANIMATED_PROPERTY(in1)
</span><span class="lines">@@ -46,7 +47,7 @@
</span><span class="cx"> 
</span><span class="cx"> inline SVGFEBlendElement::SVGFEBlendElement(const QualifiedName&amp; tagName, Document&amp; document)
</span><span class="cx">     : SVGFilterPrimitiveStandardAttributes(tagName, document)
</span><del>-    , m_mode(FEBLEND_MODE_NORMAL)
</del><ins>+    , m_mode(BlendModeNormal)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(hasTagName(SVGNames::feBlendTag));
</span><span class="cx">     registerAnimatedPropertiesForSVGFEBlendElement();
</span><span class="lines">@@ -76,9 +77,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (name == SVGNames::modeAttr) {
</span><del>-        BlendModeType propertyValue = SVGPropertyTraits&lt;BlendModeType&gt;::fromString(value);
-        if (propertyValue &gt; 0)
-            setModeBaseValue(propertyValue);
</del><ins>+        BlendMode mode = BlendModeNormal;
+        if (parseBlendMode(value, mode))
+            setModeBaseValue(mode);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFEBlendElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFEBlendElement.h (170432 => 170433)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFEBlendElement.h        2014-06-25 17:34:52 UTC (rev 170432)
+++ trunk/Source/WebCore/svg/SVGFEBlendElement.h        2014-06-25 19:03:47 UTC (rev 170433)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann &lt;zimmermann@kde.org&gt;
</span><span class="cx">  * Copyright (C) 2004, 2005, 2006 Rob Buis &lt;buis@kde.org&gt;
</span><ins>+ * Copyright (C) 2014 Adobe Systems Incorporated. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -29,44 +30,26 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> template&lt;&gt;
</span><del>-struct SVGPropertyTraits&lt;BlendModeType&gt; {
-    static unsigned highestEnumValue() { return FEBLEND_MODE_LIGHTEN; }
</del><ins>+struct SVGPropertyTraits&lt;BlendMode&gt; {
+    static unsigned highestEnumValue() { return BlendModeLighten; }
</ins><span class="cx"> 
</span><del>-    static String toString(BlendModeType type)
</del><ins>+    static String toString(BlendMode type)
</ins><span class="cx">     {
</span><span class="cx">         switch (type) {
</span><del>-        case FEBLEND_MODE_UNKNOWN:
-            return emptyString();
-        case FEBLEND_MODE_NORMAL:
</del><ins>+        case BlendModeNormal:
</ins><span class="cx">             return &quot;normal&quot;;
</span><del>-        case FEBLEND_MODE_MULTIPLY:
</del><ins>+        case BlendModeMultiply:
</ins><span class="cx">             return &quot;multiply&quot;;
</span><del>-        case FEBLEND_MODE_SCREEN:
</del><ins>+        case BlendModeScreen:
</ins><span class="cx">             return &quot;screen&quot;;
</span><del>-        case FEBLEND_MODE_DARKEN:
</del><ins>+        case BlendModeDarken:
</ins><span class="cx">             return &quot;darken&quot;;
</span><del>-        case FEBLEND_MODE_LIGHTEN:
</del><ins>+        case BlendModeLighten:
</ins><span class="cx">             return &quot;lighten&quot;;
</span><ins>+        default:
+            return emptyString();
</ins><span class="cx">         }
</span><del>-
-        ASSERT_NOT_REACHED();
-        return emptyString();
</del><span class="cx">     }
</span><del>-
-    static BlendModeType fromString(const String&amp; value)
-    {
-        if (value == &quot;normal&quot;)
-            return FEBLEND_MODE_NORMAL;
-        if (value == &quot;multiply&quot;)
-            return FEBLEND_MODE_MULTIPLY;
-        if (value == &quot;screen&quot;)
-            return FEBLEND_MODE_SCREEN;
-        if (value == &quot;darken&quot;)
-            return FEBLEND_MODE_DARKEN;
-        if (value == &quot;lighten&quot;)
-            return FEBLEND_MODE_LIGHTEN;
-        return FEBLEND_MODE_UNKNOWN;
-    }
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class SVGFEBlendElement final : public SVGFilterPrimitiveStandardAttributes {
</span><span class="lines">@@ -85,7 +68,7 @@
</span><span class="cx">     BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFEBlendElement)
</span><span class="cx">         DECLARE_ANIMATED_STRING(In1, in1)
</span><span class="cx">         DECLARE_ANIMATED_STRING(In2, in2)
</span><del>-        DECLARE_ANIMATED_ENUMERATION(Mode, mode, BlendModeType)
</del><ins>+        DECLARE_ANIMATED_ENUMERATION(Mode, mode, BlendMode)
</ins><span class="cx">     END_DECLARE_ANIMATED_PROPERTIES
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>