<!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>[163955] 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/163955">163955</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-02-12 04:40:08 -0800 (Wed, 12 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[CSS Element Blending] Implement the software path of -webkit-blend-mode with Core Graphics.
https://bugs.webkit.org/show_bug.cgi?id=99119

Patch by Mihai Tica &lt;mitica@adobe.com&gt; on 2014-02-12
Reviewed by Simon Fraser.

Source/WebCore:

This patch adds support for -webkit-blend-mode with Core Graphics.
The layer promotion code that forced compositing when blending was detected has been removed.
Remaining work for the software path is to detect and implement isolation of the blending operation:
as stated in the spec, blending should be limited to the parent stacking context.

Tests: css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer.html
       css3/compositing/blend-mode-parent-of-composited-blended-has-layer.html
       css3/compositing/blend-mode-simple-composited.html
       css3/compositing/blend-mode-with-composited-descendant-should-have-layer.html

* inspector/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer): Remove CompositingReasonBlending.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::beginTransparencyLayers): Set the blendMode on the GraphicsContext.
* rendering/RenderLayer.h: paintsWithTransparency should return true when a blendMode is set.
* rendering/RenderLayerCompositor.cpp: Remove promotion code when a blendMode is detected.
(WebCore::RenderLayerCompositor::requiresCompositingLayer): Remove CompositingReasonBlending reason.
(WebCore::RenderLayerCompositor::requiresOwnBackingStore): Remove CompositingReasonBlending reason.
(WebCore::RenderLayerCompositor::reasonsForCompositing): Remove CompositingReasonBlending reason.
(WebCore::RenderLayerCompositor::logReasonsForCompositing): Remove CompositingReasonBlending reason.
* rendering/RenderLayerCompositor.h:
- Remove the requiresCompositingForBlending method
- Remove the CompositingReasonBlending from the CompositingReasons enum.

LayoutTests:

* css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer-expected.txt: Copied from LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer-expected.txt.
* css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer.html: Test if having an overlapping composited sibling forces compositing of a blended element.
* css3/compositing/blend-mode-layers.html: Update to test both the software and the hardware path.
* css3/compositing/blend-mode-parent-of-composited-blended-has-layer-expected.txt: Renamed from LayoutTests/css3/compositing/should-have-compositing-layer-expected.txt.
* css3/compositing/blend-mode-parent-of-composited-blended-has-layer.html: Test if the parent of an accelerated element with -webkit-blend-mode is promoted.
* css3/compositing/blend-mode-reflection.html: Update to test both the software and the hardware path.
* css3/compositing/blend-mode-should-not-have-compositing-layer.html: Removed.
* css3/compositing/blend-mode-simple-composited.html: Test all the blend modes for the hardware path.
* css3/compositing/blend-mode-with-composited-descendant-should-have-layer-expected.txt: Renamed from LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer-expected.txt.
* css3/compositing/blend-mode-with-composited-descendant-should-have-layer.html: Test to ensure that an element with -webkit-blend-mode and a composited descendant is also accelerated.
* css3/compositing/should-have-compositing-layer.html: Removed.
* platform/mac/css3/compositing/blend-mode-layers-expected.png:
* platform/mac/css3/compositing/blend-mode-layers-expected.txt:
* platform/mac/css3/compositing/blend-mode-overflow-expected.png:
* platform/mac/css3/compositing/blend-mode-overflow-expected.txt: Added.
* platform/mac/css3/compositing/blend-mode-reflection-expected.png:
* platform/mac/css3/compositing/blend-mode-reflection-expected.txt:
* platform/mac/css3/compositing/blend-mode-simple-composited-expected.png: Added.
* platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt: Added.
* platform/mac/css3/compositing/blend-mode-simple-expected.png:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestscss3compositingblendmodelayershtml">trunk/LayoutTests/css3/compositing/blend-mode-layers.html</a></li>
<li><a href="#trunkLayoutTestscss3compositingblendmodereflectionhtml">trunk/LayoutTests/css3/compositing/blend-mode-reflection.html</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3compositingblendmodelayersexpectedpng">trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-layers-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3compositingblendmodelayersexpectedtxt">trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-layers-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3compositingblendmodeoverflowexpectedpng">trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-overflow-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3compositingblendmodereflectionexpectedpng">trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-reflection-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3compositingblendmodereflectionexpectedtxt">trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-reflection-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3compositingblendmodesimpleexpectedpng">trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-simple-expected.png</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorLayerTreeAgentcpp">trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerh">trunk/Source/WebCore/rendering/RenderLayer.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorcpp">trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayerCompositorh">trunk/Source/WebCore/rendering/RenderLayerCompositor.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscss3compositingblendmodeblendedelementoverlappingcompositedsiblingshouldhavecompositinglayerexpectedtxt">trunk/LayoutTests/css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3compositingblendmodeblendedelementoverlappingcompositedsiblingshouldhavecompositinglayerhtml">trunk/LayoutTests/css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer.html</a></li>
<li><a href="#trunkLayoutTestscss3compositingblendmodeparentofcompositedblendedhaslayerexpectedtxt">trunk/LayoutTests/css3/compositing/blend-mode-parent-of-composited-blended-has-layer-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3compositingblendmodeparentofcompositedblendedhaslayerhtml">trunk/LayoutTests/css3/compositing/blend-mode-parent-of-composited-blended-has-layer.html</a></li>
<li><a href="#trunkLayoutTestscss3compositingblendmodesimplecompositedhtml">trunk/LayoutTests/css3/compositing/blend-mode-simple-composited.html</a></li>
<li><a href="#trunkLayoutTestscss3compositingblendmodewithcompositeddescendantshouldhavelayerexpectedtxt">trunk/LayoutTests/css3/compositing/blend-mode-with-composited-descendant-should-have-layer-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3compositingblendmodewithcompositeddescendantshouldhavelayerhtml">trunk/LayoutTests/css3/compositing/blend-mode-with-composited-descendant-should-have-layer.html</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3compositingblendmodeoverflowexpectedtxt">trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-overflow-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3compositingblendmodesimplecompositedexpectedpng">trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-simple-composited-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3compositingblendmodesimplecompositedexpectedtxt">trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscss3compositingblendmodeshouldnothavecompositinglayerexpectedtxt">trunk/LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3compositingblendmodeshouldnothavecompositinglayerhtml">trunk/LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer.html</a></li>
<li><a href="#trunkLayoutTestscss3compositingshouldhavecompositinglayerexpectedtxt">trunk/LayoutTests/css3/compositing/should-have-compositing-layer-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3compositingshouldhavecompositinglayerhtml">trunk/LayoutTests/css3/compositing/should-have-compositing-layer.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (163954 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-02-12 12:17:41 UTC (rev 163954)
+++ trunk/LayoutTests/ChangeLog        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2014-02-12  Mihai Tica  &lt;mitica@adobe.com&gt;
+
+        [CSS Element Blending] Implement the software path of -webkit-blend-mode with Core Graphics.
+        https://bugs.webkit.org/show_bug.cgi?id=99119
+
+        Reviewed by Simon Fraser.
+
+        * css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer-expected.txt: Copied from LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer-expected.txt.
+        * css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer.html: Test if having an overlapping composited sibling forces compositing of a blended element.
+        * css3/compositing/blend-mode-layers.html: Update to test both the software and the hardware path.
+        * css3/compositing/blend-mode-parent-of-composited-blended-has-layer-expected.txt: Renamed from LayoutTests/css3/compositing/should-have-compositing-layer-expected.txt.
+        * css3/compositing/blend-mode-parent-of-composited-blended-has-layer.html: Test if the parent of an accelerated element with -webkit-blend-mode is promoted.
+        * css3/compositing/blend-mode-reflection.html: Update to test both the software and the hardware path.
+        * css3/compositing/blend-mode-should-not-have-compositing-layer.html: Removed.
+        * css3/compositing/blend-mode-simple-composited.html: Test all the blend modes for the hardware path.
+        * css3/compositing/blend-mode-with-composited-descendant-should-have-layer-expected.txt: Renamed from LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer-expected.txt.
+        * css3/compositing/blend-mode-with-composited-descendant-should-have-layer.html: Test to ensure that an element with -webkit-blend-mode and a composited descendant is also accelerated.
+        * css3/compositing/should-have-compositing-layer.html: Removed.
+        * platform/mac/css3/compositing/blend-mode-layers-expected.png:
+        * platform/mac/css3/compositing/blend-mode-layers-expected.txt:
+        * platform/mac/css3/compositing/blend-mode-overflow-expected.png:
+        * platform/mac/css3/compositing/blend-mode-overflow-expected.txt: Added.
+        * platform/mac/css3/compositing/blend-mode-reflection-expected.png:
+        * platform/mac/css3/compositing/blend-mode-reflection-expected.txt:
+        * platform/mac/css3/compositing/blend-mode-simple-composited-expected.png: Added.
+        * platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt: Added.
+        * platform/mac/css3/compositing/blend-mode-simple-expected.png:
+
</ins><span class="cx"> 2014-02-12  Michał Pakuła vel Rutka  &lt;m.pakula@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed EFL gatdening
</span></span></pre></div>
<a id="trunkLayoutTestscss3compositingblendmodeblendedelementoverlappingcompositedsiblingshouldhavecompositinglayerexpectedtxtfromrev163954trunkLayoutTestscss3compositingblendmodeshouldnothavecompositinglayerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer-expected.txt (from rev 163954, trunk/LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer-expected.txt) (0 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer-expected.txt                                (rev 0)
+++ trunk/LayoutTests/css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer-expected.txt        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 1
+        (GraphicsLayer
+          (bounds 800.00 600.00)
+          (drawsContent 1)
+          (children 2
+            (GraphicsLayer
+              (position 8.00 8.00)
+              (bounds 100.00 100.00)
+            )
+            (GraphicsLayer
+              (position 8.00 78.00)
+              (bounds 100.00 100.00)
+            )
+          )
+        )
+      )
+    )
+  )
+)
+
</ins></span></pre></div>
<a id="trunkLayoutTestscss3compositingblendmodeblendedelementoverlappingcompositedsiblingshouldhavecompositinglayerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer.html (0 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer.html                                (rev 0)
+++ trunk/LayoutTests/css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer.html        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;!DOCTYPE HTML--&gt;
+
+&lt;style&gt;
+    div {
+        width: 100px;
+        height: 100px;
+    }
+
+    .composited_sibling {
+        -webkit-transform: translateZ(0);
+    }
+
+    .blender {
+        margin-top: -30px;
+        -webkit-blend-mode: difference;
+    }
+&lt;/style&gt;
+
+&lt;div class=&quot;composited_sibling&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;blender&quot;&gt;&lt;/div&gt;
+&lt;pre id=&quot;layerTree&quot;&gt;&lt;/pre&gt;
+&lt;script&gt;
+    if (window.testRunner)
+        window.testRunner.dumpAsText();
+
+    var text = document.getElementById(&quot;layerTree&quot;);
+    text.innerHTML = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscss3compositingblendmodelayershtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/compositing/blend-mode-layers.html (163954 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/compositing/blend-mode-layers.html        2014-02-12 12:17:41 UTC (rev 163954)
+++ trunk/LayoutTests/css3/compositing/blend-mode-layers.html        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -46,6 +46,10 @@
</span><span class="cx">             display: block;
</span><span class="cx">             float: left;
</span><span class="cx">         }
</span><ins>+
+        .composited {
+            -webkit-transform: translateZ(0);
+        }
</ins><span class="cx">     &lt;/style&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -57,11 +61,13 @@
</span><span class="cx"> 
</span><span class="cx">         &lt;!-- setting the blendmode will create a new stacking context which causes z-index to change --&gt;
</span><span class="cx">         &lt;li&gt;&lt;div class=&quot;div1&quot;&gt;&lt;div class=&quot;div2&quot; style=&quot;-webkit-blend-mode: multiply&quot;&gt;&lt;div class=&quot;div3&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
</span><ins>+        &lt;li&gt;&lt;div class=&quot;div1&quot;&gt;&lt;div class=&quot;div2 composited&quot; style=&quot;-webkit-blend-mode: multiply&quot;&gt;&lt;div class=&quot;div3&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
</ins><span class="cx"> 
</span><span class="cx">         &lt;!-- just setting slight opacity which causes a stacking context. This also causes z-index to be resolved to the stacking context --&gt;
</span><span class="cx">         &lt;li&gt;&lt;div class=&quot;div1&quot; style=&quot;opacity:.99&quot;&gt;&lt;div class=&quot;div2&quot;&gt;&lt;div class=&quot;div3&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;!-- blending will now only happen upto the stacking context generated by opacity. Z-index is resolved against the stacking context of the div with the blendmode --&gt;
</span><span class="cx">         &lt;li&gt;&lt;div class=&quot;div1&quot; style=&quot;opacity:.99&quot;&gt;&lt;div class=&quot;div2&quot; style=&quot;-webkit-blend-mode: multiply&quot;&gt;&lt;div class=&quot;div3&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
</span><ins>+        &lt;li&gt;&lt;div class=&quot;div1&quot; style=&quot;opacity:.99&quot;&gt;&lt;div class=&quot;div2 composited&quot; style=&quot;-webkit-blend-mode: multiply&quot;&gt;&lt;div class=&quot;div3&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;
</ins><span class="cx">     &lt;/ul&gt;
</span><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestscss3compositingblendmodeparentofcompositedblendedhaslayerexpectedtxtfromrev163954trunkLayoutTestscss3compositingshouldhavecompositinglayerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/css3/compositing/blend-mode-parent-of-composited-blended-has-layer-expected.txt (from rev 163954, trunk/LayoutTests/css3/compositing/should-have-compositing-layer-expected.txt) (0 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/compositing/blend-mode-parent-of-composited-blended-has-layer-expected.txt                                (rev 0)
+++ trunk/LayoutTests/css3/compositing/blend-mode-parent-of-composited-blended-has-layer-expected.txt        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 1
+        (GraphicsLayer
+          (bounds 800.00 600.00)
+          (drawsContent 1)
+          (children 1
+            (GraphicsLayer
+              (position 18.00 10.00)
+              (bounds 100.00 100.00)
+            )
+          )
+        )
+      )
+    )
+  )
+)
+
</ins></span></pre></div>
<a id="trunkLayoutTestscss3compositingblendmodeparentofcompositedblendedhaslayerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/compositing/blend-mode-parent-of-composited-blended-has-layer.html (0 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/compositing/blend-mode-parent-of-composited-blended-has-layer.html                                (rev 0)
+++ trunk/LayoutTests/css3/compositing/blend-mode-parent-of-composited-blended-has-layer.html        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;!-- Test if the parent of a composited layer with mix-blend-mode is promoted. --&gt;
+
+&lt;style&gt;
+    div {
+        width: 100px;
+        height: 100px;
+    }
+    .blender {
+        -webkit-blend-mode: difference;
+        -webkit-transform: translateZ(0);
+        margin: 10px;
+    }
+&lt;/style&gt;
+
+&lt;div&gt;&lt;div class=&quot;blender&quot;&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;pre id=&quot;layerTree&quot;&gt;&lt;/pre&gt;
+&lt;script&gt;
+    if (window.testRunner)
+        window.testRunner.dumpAsText();
+
+    var text = document.getElementById(&quot;layerTree&quot;);
+    text.innerHTML = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscss3compositingblendmodereflectionhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/compositing/blend-mode-reflection.html (163954 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/compositing/blend-mode-reflection.html        2014-02-12 12:17:41 UTC (rev 163954)
+++ trunk/LayoutTests/css3/compositing/blend-mode-reflection.html        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -20,11 +20,16 @@
</span><span class="cx">             display: block;
</span><span class="cx">             float: left;
</span><span class="cx">         }
</span><ins>+
+        .composited {
+            -webkit-transform: translateZ(0);
+        }
</ins><span class="cx">      &lt;/style&gt;
</span><span class="cx">  &lt;/head&gt;
</span><span class="cx"> 
</span><del>-&lt;!-- This file should contain a duck on top of a gradient that has a reflection.
</del><ins>+&lt;!-- This file should contain two images of a duck on top of a gradient with reflection.
</ins><span class="cx"> Both the duck and the reflection should blend.  --&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx">     &lt;ul&gt;&lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: multiply&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;&lt;/ul&gt;
</span><ins>+    &lt;ul&gt;&lt;li&gt;&lt;img class=&quot;composited&quot; style=&quot;-webkit-blend-mode: multiply&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;&lt;/ul&gt;
</ins><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestscss3compositingblendmodeshouldnothavecompositinglayerexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer-expected.txt (163954 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer-expected.txt        2014-02-12 12:17:41 UTC (rev 163954)
+++ trunk/LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer-expected.txt        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -1,30 +0,0 @@
</span><del>-
-(GraphicsLayer
-  (bounds 800.00 600.00)
-  (children 1
-    (GraphicsLayer
-      (bounds 800.00 600.00)
-      (contentsOpaque 1)
-      (children 1
-        (GraphicsLayer
-          (bounds 800.00 600.00)
-          (drawsContent 1)
-          (children 1
-            (GraphicsLayer
-              (position 8.00 8.00)
-              (bounds 784.00 90.00)
-              (opacity 0.50)
-              (drawsContent 1)
-              (children 1
-                (GraphicsLayer
-                  (bounds 160.00 90.00)
-                )
-              )
-            )
-          )
-        )
-      )
-    )
-  )
-)
-
</del></span></pre></div>
<a id="trunkLayoutTestscss3compositingblendmodeshouldnothavecompositinglayerhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer.html (163954 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer.html        2014-02-12 12:17:41 UTC (rev 163954)
+++ trunk/LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer.html        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -1,22 +0,0 @@
</span><del>-&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
-&lt;html&gt;
-&lt;head&gt;
-    &lt;script src=&quot;../../fast/js/resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-    &lt;script&gt;
-        window.addEventListener('load', function() {
-        if (window.testRunner) {
-            testRunner.dumpAsText(false);
-            var text = document.getElementById('text');
-            text.innerHTML = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
-        }
-      });
-    &lt;/script&gt;
-
-    &lt;div style=&quot;opacity: .5&quot;&gt;
-        &lt;img style=&quot;-webkit-blend-mode: multiply;&quot; src=&quot;resources/reference.png&quot;&gt;
-    &lt;/div&gt;
-    &lt;pre id=&quot;text&quot;&gt;&lt;/pre&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestscss3compositingblendmodesimplecompositedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/compositing/blend-mode-simple-composited.html (0 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/compositing/blend-mode-simple-composited.html                                (rev 0)
+++ trunk/LayoutTests/css3/compositing/blend-mode-simple-composited.html        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;head&gt;
+    &lt;script&gt;
+        if (window.testRunner)
+            window.testRunner.overridePreference(&quot;WebKitAcceleratedCompositingEnabled&quot;, &quot;1&quot;);
+    &lt;/script&gt;
+
+    &lt;style&gt;
+      img {
+          width: 130px;
+          height: 130px;
+         -webkit-transform: translateZ(0);
+      }
+
+      li {
+          margin: 5px;
+          width: 130px;
+          height: 130px;
+          background: -webkit-gradient(linear, left top, right top, color-stop(0%,#0ff), color-stop(24%,#00f), color-stop(50%,#f00), color-stop(75%,#ff0), color-stop(100%,#0f0));
+          display: block;
+          float: left;
+      }
+    &lt;/style&gt;
+&lt;/head&gt;
+
+&lt;!-- This file should contain a duck on top of a gradient with every type of blending. --&gt;
+&lt;body&gt;
+    &lt;ul&gt;
+        &lt;!-- Separable blend modes --&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: normal&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: overlay&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: screen&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: overlay&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: darken&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: lighten&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: color-dodge&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: color-burn&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: hard-light&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: soft-light&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: difference&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: exclusion&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+        &lt;!-- Non separable blend modes --&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: hue&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: saturation&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: color&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+        &lt;li&gt;&lt;img style=&quot;-webkit-blend-mode: luminosity&quot; src=&quot;resources/ducky.png&quot;&gt;&lt;/li&gt;
+    &lt;/ul&gt;
+&lt;/body&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscss3compositingblendmodewithcompositeddescendantshouldhavelayerexpectedtxtfromrev163954trunkLayoutTestscss3compositingblendmodeshouldnothavecompositinglayerexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/css3/compositing/blend-mode-with-composited-descendant-should-have-layer-expected.txt (from rev 163954, trunk/LayoutTests/css3/compositing/blend-mode-should-not-have-compositing-layer-expected.txt) (0 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/compositing/blend-mode-with-composited-descendant-should-have-layer-expected.txt                                (rev 0)
+++ trunk/LayoutTests/css3/compositing/blend-mode-with-composited-descendant-should-have-layer-expected.txt        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 1
+        (GraphicsLayer
+          (bounds 800.00 600.00)
+          (drawsContent 1)
+          (children 1
+            (GraphicsLayer
+              (position 8.00 10.00)
+              (bounds 100.00 100.00)
+              (children 1
+                (GraphicsLayer
+                  (position 10.00 0.00)
+                  (bounds 100.00 100.00)
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+
</ins></span></pre></div>
<a id="trunkLayoutTestscss3compositingblendmodewithcompositeddescendantshouldhavelayerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/compositing/blend-mode-with-composited-descendant-should-have-layer.html (0 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/compositing/blend-mode-with-composited-descendant-should-have-layer.html                                (rev 0)
+++ trunk/LayoutTests/css3/compositing/blend-mode-with-composited-descendant-should-have-layer.html        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+&lt;!DOCTYPE HTML&gt;
+&lt;!-- Test if an element with mix-blend-mode having a composited descendant is promoted. --&gt;
+
+&lt;style&gt;
+    div {
+        width: 100px;
+        height: 100px;
+    }
+    .blender {
+        -webkit-blend-mode: difference;
+    }
+    .child {
+        -webkit-transform: translateZ(0);
+        margin: 10px;
+    }
+&lt;/style&gt;
+
+&lt;div class=&quot;blender&quot;&gt;&lt;div class=&quot;child&quot;&gt;&lt;/div&gt;&lt;/div&gt;
+&lt;pre id=&quot;layerTree&quot;&gt;&lt;/pre&gt;
+&lt;script&gt;
+    if (window.testRunner)
+        window.testRunner.dumpAsText();
+
+    var text = document.getElementById(&quot;layerTree&quot;);
+    text.innerHTML = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscss3compositingshouldhavecompositinglayerexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/css3/compositing/should-have-compositing-layer-expected.txt (163954 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/compositing/should-have-compositing-layer-expected.txt        2014-02-12 12:17:41 UTC (rev 163954)
+++ trunk/LayoutTests/css3/compositing/should-have-compositing-layer-expected.txt        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -1,29 +0,0 @@
</span><del>-Test to make sure a blend mode creates a compositing layer. Test is successful of render tree shows compositing
-
-On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
-
-
-PASS content has compositing layers
-
-(GraphicsLayer
-  (bounds 800.00 600.00)
-  (children 1
-    (GraphicsLayer
-      (bounds 800.00 600.00)
-      (contentsOpaque 1)
-      (children 1
-        (GraphicsLayer
-          (bounds 800.00 600.00)
-          (drawsContent 1)
-          (children 1
-            (GraphicsLayer
-              (position 8.00 76.00)
-              (bounds 160.00 90.00)
-            )
-          )
-        )
-      )
-    )
-  )
-)
-
</del></span></pre></div>
<a id="trunkLayoutTestscss3compositingshouldhavecompositinglayerhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/css3/compositing/should-have-compositing-layer.html (163954 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/compositing/should-have-compositing-layer.html        2014-02-12 12:17:41 UTC (rev 163954)
+++ trunk/LayoutTests/css3/compositing/should-have-compositing-layer.html        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -1,30 +0,0 @@
</span><del>-&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
-&lt;/head&gt;
-&lt;script&gt;
-    if (window.testRunner) {
-        testRunner.dumpAsText();
-        testRunner.waitUntilDone();
-    }
-
-    function doTest()
-    {
-        description(&quot;Test to make sure a blend mode creates a compositing layer. Test is successful of render tree shows compositing&quot;);
-        if (window.testRunner) {
-            var layers = window.internals.layerTreeAsText(document);
-            if (layers == &quot;&quot;)
-                testFailed(&quot;no compositing layers&quot;);
-            else
-                testPassed(&quot;content has compositing layers&quot;);
-            document.getElementById(&quot;layertree&quot;).innerText = layers;
-            testRunner.notifyDone();
-        }
-    }
-    
-    window.addEventListener('load', doTest, false);
-
-&lt;/script&gt;
-&lt;img style=&quot;-webkit-blend-mode: multiply;&quot; src=&quot;resources/reference.png&quot;&gt;
-&lt;pre id=&quot;layertree&quot;&gt;&lt;/pre&gt;
</del></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3compositingblendmodelayersexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-layers-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3compositingblendmodelayersexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-layers-expected.txt (163954 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-layers-expected.txt        2014-02-12 12:17:41 UTC (rev 163954)
+++ trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-layers-expected.txt        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> layer at (0,0) size 800x600
</span><span class="cx">   RenderView at (0,0) size 800x600
</span><del>-layer at (0,0) size 800x191
-  RenderBlock {HTML} at (0,0) size 800x191
</del><ins>+layer at (0,0) size 800x366
+  RenderBlock {HTML} at (0,0) size 800x366
</ins><span class="cx">     RenderBody {BODY} at (8,16) size 784x0
</span><span class="cx">       RenderBlock {UL} at (0,0) size 784x0
</span><span class="cx">         RenderBlock (floating) {LI} at (45,5) size 160x50 [bgcolor=#FF00FF]
</span><span class="lines">@@ -9,7 +9,10 @@
</span><span class="cx">         RenderBlock (floating) {LI} at (215,5) size 160x50 [bgcolor=#FF00FF]
</span><span class="cx">           RenderBlock {DIV} at (0,50) size 160x75 [bgcolor=#00FFFF]
</span><span class="cx">         RenderBlock (floating) {LI} at (385,5) size 160x50 [bgcolor=#FF00FF]
</span><ins>+          RenderBlock {DIV} at (0,50) size 160x75 [bgcolor=#00FFFF]
</ins><span class="cx">         RenderBlock (floating) {LI} at (555,5) size 160x50 [bgcolor=#FF00FF]
</span><ins>+        RenderBlock (floating) {LI} at (45,180) size 160x50 [bgcolor=#FF00FF]
+        RenderBlock (floating) {LI} at (215,180) size 160x50 [bgcolor=#FF00FF]
</ins><span class="cx"> layer at (73,31) size 160x160
</span><span class="cx">   RenderBlock (relative positioned) {DIV} at (0,0) size 160x160
</span><span class="cx"> layer at (53,41) size 80x150
</span><span class="lines">@@ -18,8 +21,6 @@
</span><span class="cx">   RenderBlock (relative positioned) {DIV} at (0,0) size 160x160
</span><span class="cx"> layer at (223,41) size 80x150
</span><span class="cx">   RenderBlock (relative positioned) {DIV} at (0,0) size 80x150 [bgcolor=#FFFF00]
</span><del>-layer at (393,71) size 160x75
-  RenderBlock {DIV} at (0,50) size 160x75 [bgcolor=#00FFFF]
</del><span class="cx"> layer at (413,31) size 160x160
</span><span class="cx">   RenderBlock (relative positioned) {DIV} at (0,0) size 160x160
</span><span class="cx"> layer at (393,41) size 80x150
</span><span class="lines">@@ -30,3 +31,15 @@
</span><span class="cx">   RenderBlock (relative positioned) {DIV} at (0,0) size 160x160
</span><span class="cx"> layer at (563,41) size 80x150
</span><span class="cx">   RenderBlock (relative positioned) {DIV} at (0,0) size 80x150 [bgcolor=#FFFF00]
</span><ins>+layer at (53,246) size 160x75
+  RenderBlock {DIV} at (0,50) size 160x75 [bgcolor=#00FFFF]
+layer at (73,206) size 160x160
+  RenderBlock (relative positioned) {DIV} at (0,0) size 160x160
+layer at (53,216) size 80x150
+  RenderBlock (relative positioned) {DIV} at (0,0) size 80x150 [bgcolor=#FFFF00]
+layer at (223,246) size 160x75
+  RenderBlock {DIV} at (0,50) size 160x75 [bgcolor=#00FFFF]
+layer at (243,206) size 160x160
+  RenderBlock (relative positioned) {DIV} at (0,0) size 160x160
+layer at (223,216) size 80x150
+  RenderBlock (relative positioned) {DIV} at (0,0) size 80x150 [bgcolor=#FFFF00]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3compositingblendmodeoverflowexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-overflow-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3compositingblendmodeoverflowexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-overflow-expected.txt (0 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-overflow-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-overflow-expected.txt        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+No blending. Duck should be yellow everywhere.
+Simple blending. Duck should be a horizontal rainbow inside, and blue on overflow.
+Parent is a stacking context. Duck should be a horizontal rainbow inside, and yellow on overflow (since there is no background there to blend with).
+Intermediate parent - no stacking context. Duck should be a vertical gradient inside, and blue on overflow.
+Intermediate parent with grandparent stacking context. Duck should be a vertical gradient inside, and yellow on overflow.
+Intermediate parent has overflow. Duck should be a vertical gradient inside, and overflow is hidden.


+


+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3compositingblendmodereflectionexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-reflection-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3compositingblendmodereflectionexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-reflection-expected.txt (163954 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-reflection-expected.txt        2014-02-12 12:17:41 UTC (rev 163954)
+++ trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-reflection-expected.txt        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -5,5 +5,9 @@
</span><span class="cx">     RenderBody {BODY} at (8,16) size 784x0
</span><span class="cx">       RenderBlock {UL} at (0,0) size 784x0
</span><span class="cx">         RenderBlock (floating) {LI} at (45,5) size 130x260
</span><ins>+      RenderBlock {UL} at (0,0) size 784x0
+        RenderBlock (floating) {LI} at (185,5) size 130x260
</ins><span class="cx"> layer at (53,21) size 130x130
</span><span class="cx">   RenderImage {IMG} at (0,0) size 130x130
</span><ins>+layer at (193,21) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3compositingblendmodesimplecompositedexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-simple-composited-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/css3/compositing/blend-mode-simple-composited-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformmaccss3compositingblendmodesimplecompositedexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt (0 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x576
+  RenderBlock {HTML} at (0,0) size 800x576
+    RenderBody {BODY} at (8,16) size 784x0
+      RenderBlock {UL} at (0,0) size 784x0
+        RenderBlock (floating) {LI} at (45,5) size 130x130
+        RenderBlock (floating) {LI} at (185,5) size 130x130
+        RenderBlock (floating) {LI} at (325,5) size 130x130
+        RenderBlock (floating) {LI} at (465,5) size 130x130
+        RenderBlock (floating) {LI} at (605,5) size 130x130
+        RenderBlock (floating) {LI} at (45,145) size 130x130
+        RenderBlock (floating) {LI} at (185,145) size 130x130
+        RenderBlock (floating) {LI} at (325,145) size 130x130
+        RenderBlock (floating) {LI} at (465,145) size 130x130
+        RenderBlock (floating) {LI} at (605,145) size 130x130
+        RenderBlock (floating) {LI} at (45,285) size 130x130
+        RenderBlock (floating) {LI} at (185,285) size 130x130
+        RenderBlock (floating) {LI} at (325,285) size 130x130
+        RenderBlock (floating) {LI} at (465,285) size 130x130
+        RenderBlock (floating) {LI} at (605,285) size 130x130
+        RenderBlock (floating) {LI} at (45,425) size 130x130
+layer at (53,21) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
+layer at (193,21) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
+layer at (333,21) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
+layer at (473,21) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
+layer at (613,21) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
+layer at (53,161) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
+layer at (193,161) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
+layer at (333,161) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
+layer at (473,161) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
+layer at (613,161) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
+layer at (53,301) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
+layer at (193,301) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
+layer at (333,301) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
+layer at (473,301) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
+layer at (613,301) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
+layer at (53,441) size 130x130
+  RenderImage {IMG} at (0,0) size 130x130
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3compositingblendmodesimpleexpectedpng"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/platform/mac/css3/compositing/blend-mode-simple-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (163954 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-12 12:17:41 UTC (rev 163954)
+++ trunk/Source/WebCore/ChangeLog        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2014-02-12  Mihai Tica  &lt;mitica@adobe.com&gt;
+
+        [CSS Element Blending] Implement the software path of -webkit-blend-mode with Core Graphics.
+        https://bugs.webkit.org/show_bug.cgi?id=99119
+
+        Reviewed by Simon Fraser.
+
+        This patch adds support for -webkit-blend-mode with Core Graphics.
+        The layer promotion code that forced compositing when blending was detected has been removed.
+        Remaining work for the software path is to detect and implement isolation of the blending operation:
+        as stated in the spec, blending should be limited to the parent stacking context.
+
+        Tests: css3/compositing/blend-mode-blended-element-overlapping-composited-sibling-should-have-compositing-layer.html
+               css3/compositing/blend-mode-parent-of-composited-blended-has-layer.html
+               css3/compositing/blend-mode-simple-composited.html
+               css3/compositing/blend-mode-with-composited-descendant-should-have-layer.html
+
+        * inspector/InspectorLayerTreeAgent.cpp:
+        (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer): Remove CompositingReasonBlending.
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::beginTransparencyLayers): Set the blendMode on the GraphicsContext.
+        * rendering/RenderLayer.h: paintsWithTransparency should return true when a blendMode is set.
+        * rendering/RenderLayerCompositor.cpp: Remove promotion code when a blendMode is detected.
+        (WebCore::RenderLayerCompositor::requiresCompositingLayer): Remove CompositingReasonBlending reason.
+        (WebCore::RenderLayerCompositor::requiresOwnBackingStore): Remove CompositingReasonBlending reason.
+        (WebCore::RenderLayerCompositor::reasonsForCompositing): Remove CompositingReasonBlending reason.
+        (WebCore::RenderLayerCompositor::logReasonsForCompositing): Remove CompositingReasonBlending reason.
+        * rendering/RenderLayerCompositor.h:
+        - Remove the requiresCompositingForBlending method
+        - Remove the CompositingReasonBlending from the CompositingReasons enum.
+
</ins><span class="cx"> 2014-02-11  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Subpixel rendering: Switch repaint rect from IntRect to LayoutRect to be able to
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorLayerTreeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp (163954 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp        2014-02-12 12:17:41 UTC (rev 163954)
+++ trunk/Source/WebCore/inspector/InspectorLayerTreeAgent.cpp        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -294,7 +294,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (reasonsBitmask &amp; CompositingReasonFilterWithCompositedDescendants)
</span><span class="cx">         compositingReasons-&gt;setFilterWithCompositedDescendants(true);
</span><del>-            
</del><ins>+
</ins><span class="cx">     if (reasonsBitmask &amp; CompositingReasonBlendingWithCompositedDescendants)
</span><span class="cx">         compositingReasons-&gt;setBlendingWithCompositedDescendants(true);
</span><span class="cx"> 
</span><span class="lines">@@ -306,9 +306,6 @@
</span><span class="cx"> 
</span><span class="cx">     if (reasonsBitmask &amp; CompositingReasonRoot)
</span><span class="cx">         compositingReasons-&gt;setRoot(true);
</span><del>-
-    if (reasonsBitmask &amp; CompositingReasonBlending)
-        compositingReasons-&gt;setBlending(true);
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String InspectorLayerTreeAgent::bind(const RenderLayer* layer)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (163954 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-02-12 12:17:41 UTC (rev 163954)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -1683,7 +1683,19 @@
</span><span class="cx">         context-&gt;save();
</span><span class="cx">         LayoutRect clipRect = paintingExtent(rootLayer, paintDirtyRect, paintBehavior);
</span><span class="cx">         context-&gt;clip(clipRect);
</span><ins>+
+#if ENABLE(CSS_COMPOSITING)
+        if (hasBlendMode())
+            context-&gt;setCompositeOperation(context-&gt;compositeOperation(), m_blendMode);
+#endif
+
</ins><span class="cx">         context-&gt;beginTransparencyLayer(renderer().opacity());
</span><ins>+
+#if ENABLE(CSS_COMPOSITING)
+        if (hasBlendMode())
+            context-&gt;setCompositeOperation(context-&gt;compositeOperation(), BlendModeNormal);
+#endif
+
</ins><span class="cx"> #ifdef REVEAL_TRANSPARENCY_LAYERS
</span><span class="cx">         context-&gt;setFillColor(Color(0.0f, 0.0f, 0.5f, 0.2f), ColorSpaceDeviceRGB);
</span><span class="cx">         context-&gt;fillRect(clipRect);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.h (163954 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.h        2014-02-12 12:17:41 UTC (rev 163954)
+++ trunk/Source/WebCore/rendering/RenderLayer.h        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -798,7 +798,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool paintsWithTransparency(PaintBehavior paintBehavior) const
</span><span class="cx">     {
</span><del>-        return isTransparent() &amp;&amp; ((paintBehavior &amp; PaintBehaviorFlattenCompositingLayers) || !isComposited());
</del><ins>+        return (isTransparent() || hasBlendMode()) &amp;&amp; ((paintBehavior &amp; PaintBehaviorFlattenCompositingLayers) || !isComposited());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool paintsWithTransform(PaintBehavior) const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (163954 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2014-02-12 12:17:41 UTC (rev 163954)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -1989,8 +1989,7 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">         || requiresCompositingForScrolling(*renderer)
</span><span class="cx"> #endif
</span><del>-        || requiresCompositingForOverflowScrolling(*renderer-&gt;layer())
-        || requiresCompositingForBlending(*renderer);
</del><ins>+        || requiresCompositingForOverflowScrolling(*renderer-&gt;layer());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool RenderLayerCompositor::canBeComposited(const RenderLayer&amp; layer) const
</span><span class="lines">@@ -2029,7 +2028,6 @@
</span><span class="cx">         || (canRender3DTransforms() &amp;&amp; renderer.style().backfaceVisibility() == BackfaceVisibilityHidden)
</span><span class="cx">         || requiresCompositingForAnimation(renderer)
</span><span class="cx">         || requiresCompositingForFilters(renderer)
</span><del>-        || requiresCompositingForBlending(renderer)
</del><span class="cx">         || requiresCompositingForPosition(renderer, layer)
</span><span class="cx">         || requiresCompositingForOverflowScrolling(layer)
</span><span class="cx">         || renderer.isTransparent()
</span><span class="lines">@@ -2093,9 +2091,6 @@
</span><span class="cx">     if (requiresCompositingForFilters(*renderer))
</span><span class="cx">         reasons |= CompositingReasonFilters;
</span><span class="cx"> 
</span><del>-    if (requiresCompositingForBlending(*renderer))
-        reasons |= CompositingReasonBlending;
-
</del><span class="cx">     if (requiresCompositingForPosition(*renderer, *renderer-&gt;layer()))
</span><span class="cx">         reasons |= renderer-&gt;style().position() == FixedPosition ? CompositingReasonPositionFixed : CompositingReasonPositionSticky;
</span><span class="cx"> 
</span><span class="lines">@@ -2128,9 +2123,10 @@
</span><span class="cx"> 
</span><span class="cx">         if (renderer-&gt;hasFilter())
</span><span class="cx">             reasons |= CompositingReasonFilterWithCompositedDescendants;
</span><del>-            
</del><ins>+
</ins><span class="cx">         if (renderer-&gt;hasBlendMode())
</span><span class="cx">             reasons |= CompositingReasonBlendingWithCompositedDescendants;
</span><ins>+
</ins><span class="cx">     } else if (renderer-&gt;layer()-&gt;indirectCompositingReason() == RenderLayer::IndirectCompositingForPerspective)
</span><span class="cx">         reasons |= CompositingReasonPerspective;
</span><span class="cx">     else if (renderer-&gt;layer()-&gt;indirectCompositingReason() == RenderLayer::IndirectCompositingForPreserve3D)
</span><span class="lines">@@ -2171,9 +2167,6 @@
</span><span class="cx">     if (reasons &amp; CompositingReasonFilters)
</span><span class="cx">         return &quot;filters&quot;;
</span><span class="cx"> 
</span><del>-    if (reasons &amp; CompositingReasonBlending)
-        return &quot;blending&quot;;
-
</del><span class="cx">     if (reasons &amp; CompositingReasonPositionFixed)
</span><span class="cx">         return &quot;position: fixed&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -2447,16 +2440,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderLayerCompositor::requiresCompositingForBlending(RenderLayerModelObject&amp; renderer) const
-{
-#if ENABLE(CSS_COMPOSITING)
-    return renderer.hasBlendMode();
-#else
-    UNUSED_PARAM(renderer);
-    return false;
-#endif
-}
-
</del><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> static bool isStickyInAcceleratedScrollingLayerOrViewport(const RenderLayer&amp; layer, const RenderLayer** enclosingAcceleratedOverflowLayer = 0)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayerCompositorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (163954 => 163955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h        2014-02-12 12:17:41 UTC (rev 163954)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h        2014-02-12 12:40:08 UTC (rev 163955)
</span><span class="lines">@@ -80,8 +80,7 @@
</span><span class="cx">     CompositingReasonBlendingWithCompositedDescendants      = 1 &lt;&lt; 20,
</span><span class="cx">     CompositingReasonPerspective                            = 1 &lt;&lt; 21,
</span><span class="cx">     CompositingReasonPreserve3D                             = 1 &lt;&lt; 22,
</span><del>-    CompositingReasonRoot                                   = 1 &lt;&lt; 23,
-    CompositingReasonBlending                               = 1 &lt;&lt; 24
</del><ins>+    CompositingReasonRoot                                   = 1 &lt;&lt; 23
</ins><span class="cx"> };
</span><span class="cx"> typedef unsigned CompositingReasons;
</span><span class="cx"> 
</span><span class="lines">@@ -393,7 +392,6 @@
</span><span class="cx">     bool requiresCompositingForPlugin(RenderLayerModelObject&amp;) const;
</span><span class="cx">     bool requiresCompositingForFrame(RenderLayerModelObject&amp;) const;
</span><span class="cx">     bool requiresCompositingForFilters(RenderLayerModelObject&amp;) const;
</span><del>-    bool requiresCompositingForBlending(RenderLayerModelObject&amp;) const;
</del><span class="cx">     bool requiresCompositingForScrollableFrame() const;
</span><span class="cx">     bool requiresCompositingForPosition(RenderLayerModelObject&amp;, const RenderLayer&amp;, RenderLayer::ViewportConstrainedNotCompositedReason* = 0) const;
</span><span class="cx">     bool requiresCompositingForOverflowScrolling(const RenderLayer&amp;) const;
</span></span></pre>
</div>
</div>

</body>
</html>