<!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>[208314] 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/208314">208314</a></dd>
<dt>Author</dt> <dd>simon.fraser@apple.com</dd>
<dt>Date</dt> <dd>2016-11-02 17:19:54 -0700 (Wed, 02 Nov 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION (<a href="http://trac.webkit.org/projects/webkit/changeset/208025">r208025</a>) GraphicsContext state stack assertions loading webkit.org
https://bugs.webkit.org/show_bug.cgi?id=164350
rdar://problem/29053414

Reviewed by Dean Jackson.

Source/WebCore:

After <a href="http://trac.webkit.org/projects/webkit/changeset/208025">r208025</a> it as possible for KeyframeAnimation::animate() to produce a RenderStyle
with a non-1 opacity, but without the explicit z-index that triggers stacking context.
This confused the RenderLayer paintWithTransparency code, triggering mismsatched GraphicsContext
save/restores.

This occurred when the runningOrFillingForwards state was mis-computed. keyframeAnim-&gt;animate()
can spit out a new style when in the StartWaitTimer sometimes, so &quot;!keyframeAnim-&gt;waitingToStart() &amp;&amp; !keyframeAnim-&gt;postActive()&quot;
gave the wrong answser.

Rather than depend on the super-confusing animation state, use a bool out param from animate() to say
when it actually produced a new style, and when true, do the setZIndex(0).

Test: animations/stacking-during-opacity-animation.html

* page/animation/AnimationBase.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimation::blendProperties): Log after blending so the log shows the blended style.
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::animate):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::animate):
* page/animation/ImplicitAnimation.h:
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::animate):
* page/animation/KeyframeAnimation.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::restore):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayer::drawLayerContents): No functional change, but created scope for the
GraphicsContext so that it didn't outlive the CGContextRestoreGState(context).
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::beginTransparencyLayers): New assertion that catches the problem earlier.

LayoutTests:

Test was reduced from webkit.org.

* animations/stacking-during-opacity-animation-expected.txt: Added.
* animations/stacking-during-opacity-animation.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepageanimationAnimationBaseh">trunk/Source/WebCore/page/animation/AnimationBase.h</a></li>
<li><a href="#trunkSourceWebCorepageanimationCSSPropertyAnimationcpp">trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationCompositeAnimationcpp">trunk/Source/WebCore/page/animation/CompositeAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationImplicitAnimationcpp">trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationImplicitAnimationh">trunk/Source/WebCore/page/animation/ImplicitAnimation.h</a></li>
<li><a href="#trunkSourceWebCorepageanimationKeyframeAnimationcpp">trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationKeyframeAnimationh">trunk/Source/WebCore/page/animation/KeyframeAnimation.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContextcpp">trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoamm">trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsanimationsstackingduringopacityanimationexpectedtxt">trunk/LayoutTests/animations/stacking-during-opacity-animation-expected.txt</a></li>
<li><a href="#trunkLayoutTestsanimationsstackingduringopacityanimationhtml">trunk/LayoutTests/animations/stacking-during-opacity-animation.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (208313 => 208314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-11-03 00:05:12 UTC (rev 208313)
+++ trunk/LayoutTests/ChangeLog        2016-11-03 00:19:54 UTC (rev 208314)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-11-02  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        REGRESSION (r208025) GraphicsContext state stack assertions loading webkit.org
+        https://bugs.webkit.org/show_bug.cgi?id=164350
+        rdar://problem/29053414
+
+        Reviewed by Dean Jackson.
+
+        Test was reduced from webkit.org.
+
+        * animations/stacking-during-opacity-animation-expected.txt: Added.
+        * animations/stacking-during-opacity-animation.html: Added.
+
</ins><span class="cx"> 2016-11-02  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] [WebGL] Multisample resolve step may operate on stale data
</span></span></pre></div>
<a id="trunkLayoutTestsanimationsstackingduringopacityanimationexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/animations/stacking-during-opacity-animation-expected.txt (0 => 208314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/animations/stacking-during-opacity-animation-expected.txt                                (rev 0)
+++ trunk/LayoutTests/animations/stacking-during-opacity-animation-expected.txt        2016-11-03 00:19:54 UTC (rev 208314)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+This test should not crash or assert.
</ins></span></pre></div>
<a id="trunkLayoutTestsanimationsstackingduringopacityanimationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/animations/stacking-during-opacity-animation.html (0 => 208314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/animations/stacking-during-opacity-animation.html                                (rev 0)
+++ trunk/LayoutTests/animations/stacking-during-opacity-animation.html        2016-11-03 00:19:54 UTC (rev 208314)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+    .background-image {
+        position: relative;
+        margin-top: -1px;
+        height: 0;
+        padding-bottom: 80%;
+        opacity: 0.1;
+    }
+
+    .tile {
+        animation: fade-in 0.4s;
+    }
+
+    @keyframes fade-in {
+        from { opacity: 0; }
+        to   { opacity: 1; }
+    }
+
+&lt;/style&gt;
+&lt;script&gt;
+    if (window.testRunner)
+        testRunner.dumpAsText();
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+    &lt;div class=&quot;tile&quot;&gt;
+        &lt;div class=&quot;background-image&quot;&gt;&lt;/div&gt;
+        &lt;p&gt;This test should not crash or assert.&lt;/p&gt;
+    &lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208313 => 208314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-03 00:05:12 UTC (rev 208313)
+++ trunk/Source/WebCore/ChangeLog        2016-11-03 00:19:54 UTC (rev 208314)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2016-11-02  Simon Fraser  &lt;simon.fraser@apple.com&gt;
+
+        REGRESSION (r208025) GraphicsContext state stack assertions loading webkit.org
+        https://bugs.webkit.org/show_bug.cgi?id=164350
+        rdar://problem/29053414
+
+        Reviewed by Dean Jackson.
+
+        After r208025 it as possible for KeyframeAnimation::animate() to produce a RenderStyle
+        with a non-1 opacity, but without the explicit z-index that triggers stacking context.
+        This confused the RenderLayer paintWithTransparency code, triggering mismsatched GraphicsContext
+        save/restores.
+
+        This occurred when the runningOrFillingForwards state was mis-computed. keyframeAnim-&gt;animate()
+        can spit out a new style when in the StartWaitTimer sometimes, so &quot;!keyframeAnim-&gt;waitingToStart() &amp;&amp; !keyframeAnim-&gt;postActive()&quot;
+        gave the wrong answser.
+
+        Rather than depend on the super-confusing animation state, use a bool out param from animate() to say
+        when it actually produced a new style, and when true, do the setZIndex(0).
+
+        Test: animations/stacking-during-opacity-animation.html
+
+        * page/animation/AnimationBase.h:
+        * page/animation/CSSPropertyAnimation.cpp:
+        (WebCore::CSSPropertyAnimation::blendProperties): Log after blending so the log shows the blended style.
+        * page/animation/CompositeAnimation.cpp:
+        (WebCore::CompositeAnimation::animate):
+        * page/animation/ImplicitAnimation.cpp:
+        (WebCore::ImplicitAnimation::animate):
+        * page/animation/ImplicitAnimation.h:
+        * page/animation/KeyframeAnimation.cpp:
+        (WebCore::KeyframeAnimation::animate):
+        * page/animation/KeyframeAnimation.h:
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContext::restore):
+        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
+        (PlatformCALayer::drawLayerContents): No functional change, but created scope for the
+        GraphicsContext so that it didn't outlive the CGContextRestoreGState(context).
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::beginTransparencyLayers): New assertion that catches the problem earlier.
+
</ins><span class="cx"> 2016-11-02  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] [WebGL] Multisample resolve step may operate on stale data
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationAnimationBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/AnimationBase.h (208313 => 208314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/AnimationBase.h        2016-11-03 00:05:12 UTC (rev 208313)
+++ trunk/Source/WebCore/page/animation/AnimationBase.h        2016-11-03 00:19:54 UTC (rev 208314)
</span><span class="lines">@@ -136,7 +136,7 @@
</span><span class="cx">     double progress(double scale = 1, double offset = 0, const TimingFunction* = nullptr) const;
</span><span class="cx"> 
</span><span class="cx">     // Returns true if the animation state changed.
</span><del>-    virtual bool animate(CompositeAnimation*, RenderElement*, const RenderStyle* /*currentStyle*/, const RenderStyle* /*targetStyle*/, std::unique_ptr&lt;RenderStyle&gt;&amp; /*animatedStyle*/) = 0;
</del><ins>+    virtual bool animate(CompositeAnimation*, RenderElement*, const RenderStyle* /*currentStyle*/, const RenderStyle* /*targetStyle*/, std::unique_ptr&lt;RenderStyle&gt;&amp; /*animatedStyle*/, bool&amp; didBlendStyle) = 0;
</ins><span class="cx">     virtual void getAnimatedStyle(std::unique_ptr&lt;RenderStyle&gt;&amp; /*animatedStyle*/) = 0;
</span><span class="cx"> 
</span><span class="cx">     virtual bool computeExtentOfTransformAnimation(LayoutRect&amp;) const = 0;
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCSSPropertyAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (208313 => 208314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2016-11-03 00:05:12 UTC (rev 208313)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2016-11-03 00:19:54 UTC (rev 208314)
</span><span class="lines">@@ -1576,10 +1576,10 @@
</span><span class="cx"> 
</span><span class="cx">     AnimationPropertyWrapperBase* wrapper = CSSPropertyAnimationWrapperMap::singleton().wrapperForProperty(prop);
</span><span class="cx">     if (wrapper) {
</span><ins>+        wrapper-&gt;blend(anim, dst, a, b, progress);
</ins><span class="cx"> #if !LOG_DISABLED
</span><span class="cx">         wrapper-&gt;logBlend(a, b, dst, progress);
</span><span class="cx"> #endif
</span><del>-        wrapper-&gt;blend(anim, dst, a, b, progress);
</del><span class="cx">         return !wrapper-&gt;animationIsAccelerated() || !anim-&gt;isAccelerated();
</span><span class="cx">     }
</span><span class="cx">     return false;
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCompositeAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CompositeAnimation.cpp (208313 => 208314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CompositeAnimation.cpp        2016-11-03 00:05:12 UTC (rev 208313)
+++ trunk/Source/WebCore/page/animation/CompositeAnimation.cpp        2016-11-03 00:19:54 UTC (rev 208314)
</span><span class="lines">@@ -299,10 +299,12 @@
</span><span class="cx">         // to fill in a RenderStyle*&amp; only if needed.
</span><span class="cx">         bool checkForStackingContext = false;
</span><span class="cx">         for (auto&amp; transition : m_transitions.values()) {
</span><del>-            if (transition-&gt;animate(this, &amp;renderer, currentStyle, &amp;targetStyle, blendedStyle))
</del><ins>+            bool didBlendStyle = false;
+            if (transition-&gt;animate(this, &amp;renderer, currentStyle, &amp;targetStyle, blendedStyle, didBlendStyle))
</ins><span class="cx">                 animationStateChanged = true;
</span><span class="cx"> 
</span><del>-            checkForStackingContext |= WillChangeData::propertyCreatesStackingContext(transition-&gt;animatingProperty());
</del><ins>+            if (didBlendStyle)
+                checkForStackingContext |= WillChangeData::propertyCreatesStackingContext(transition-&gt;animatingProperty());
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (blendedStyle &amp;&amp; checkForStackingContext) {
</span><span class="lines">@@ -327,11 +329,11 @@
</span><span class="cx">     for (auto&amp; name : m_keyframeAnimationOrderMap) {
</span><span class="cx">         RefPtr&lt;KeyframeAnimation&gt; keyframeAnim = m_keyframeAnimations.get(name);
</span><span class="cx">         if (keyframeAnim) {
</span><del>-            if (keyframeAnim-&gt;animate(this, &amp;renderer, currentStyle, &amp;targetStyle, blendedStyle))
</del><ins>+            bool didBlendStyle = false;
+            if (keyframeAnim-&gt;animate(this, &amp;renderer, currentStyle, &amp;targetStyle, blendedStyle, didBlendStyle))
</ins><span class="cx">                 animationStateChanged = true;
</span><span class="cx"> 
</span><del>-            bool runningOrFillingForwards = !keyframeAnim-&gt;waitingToStart() &amp;&amp; !keyframeAnim-&gt;postActive();
-            forceStackingContext |= runningOrFillingForwards &amp;&amp; keyframeAnim-&gt;triggersStackingContext();
</del><ins>+            forceStackingContext |= didBlendStyle &amp;&amp; keyframeAnim-&gt;triggersStackingContext();
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationImplicitAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp (208313 => 208314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp        2016-11-03 00:05:12 UTC (rev 208313)
+++ trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp        2016-11-03 00:19:54 UTC (rev 208314)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">     return m_object-&gt;document().hasListenerType(inListenerType);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool ImplicitAnimation::animate(CompositeAnimation*, RenderElement*, const RenderStyle*, const RenderStyle* targetStyle, std::unique_ptr&lt;RenderStyle&gt;&amp; animatedStyle)
</del><ins>+bool ImplicitAnimation::animate(CompositeAnimation*, RenderElement*, const RenderStyle*, const RenderStyle* targetStyle, std::unique_ptr&lt;RenderStyle&gt;&amp; animatedStyle, bool&amp; didBlendStyle)
</ins><span class="cx"> {
</span><span class="cx">     // If we get this far and the animation is done, it means we are cleaning up a just finished animation.
</span><span class="cx">     // So just return. Everything is already all cleaned up.
</span><span class="lines">@@ -85,6 +85,8 @@
</span><span class="cx"> 
</span><span class="cx">     // Fire the start timeout if needed
</span><span class="cx">     fireAnimationEventsIfNeeded();
</span><ins>+    
+    didBlendStyle = true;
</ins><span class="cx">     return state() != oldState;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationImplicitAnimationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/ImplicitAnimation.h (208313 => 208314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/ImplicitAnimation.h        2016-11-03 00:05:12 UTC (rev 208313)
+++ trunk/Source/WebCore/page/animation/ImplicitAnimation.h        2016-11-03 00:19:54 UTC (rev 208314)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">     void pauseAnimation(double timeOffset) override;
</span><span class="cx">     void endAnimation() override;
</span><span class="cx"> 
</span><del>-    bool animate(CompositeAnimation*, RenderElement*, const RenderStyle* currentStyle, const RenderStyle* targetStyle, std::unique_ptr&lt;RenderStyle&gt;&amp; animatedStyle) override;
</del><ins>+    bool animate(CompositeAnimation*, RenderElement*, const RenderStyle* currentStyle, const RenderStyle* targetStyle, std::unique_ptr&lt;RenderStyle&gt;&amp; animatedStyle, bool&amp; didBlendStyle) override;
</ins><span class="cx">     void getAnimatedStyle(std::unique_ptr&lt;RenderStyle&gt;&amp; animatedStyle) override;
</span><span class="cx">     void reset(const RenderStyle* to);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationKeyframeAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp (208313 => 208314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp        2016-11-03 00:05:12 UTC (rev 208313)
+++ trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp        2016-11-03 00:19:54 UTC (rev 208314)
</span><span class="lines">@@ -124,7 +124,7 @@
</span><span class="cx">     prog = progress(scale, offset, prevKeyframe.timingFunction(name()));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool KeyframeAnimation::animate(CompositeAnimation* compositeAnimation, RenderElement*, const RenderStyle*, const RenderStyle* targetStyle, std::unique_ptr&lt;RenderStyle&gt;&amp; animatedStyle)
</del><ins>+bool KeyframeAnimation::animate(CompositeAnimation* compositeAnimation, RenderElement*, const RenderStyle*, const RenderStyle* targetStyle, std::unique_ptr&lt;RenderStyle&gt;&amp; animatedStyle, bool&amp; didBlendStyle)
</ins><span class="cx"> {
</span><span class="cx">     // Fire the start timeout if needed
</span><span class="cx">     fireAnimationEventsIfNeeded();
</span><span class="lines">@@ -179,6 +179,7 @@
</span><span class="cx">         CSSPropertyAnimation::blendProperties(this, propertyID, animatedStyle.get(), fromStyle, toStyle, progress);
</span><span class="cx">     }
</span><span class="cx">     
</span><ins>+    didBlendStyle = true;
</ins><span class="cx">     return state() != oldState;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationKeyframeAnimationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/KeyframeAnimation.h (208313 => 208314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/KeyframeAnimation.h        2016-11-03 00:05:12 UTC (rev 208313)
+++ trunk/Source/WebCore/page/animation/KeyframeAnimation.h        2016-11-03 00:19:54 UTC (rev 208314)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">         return adoptRef(*new KeyframeAnimation(animation, renderer, compositeAnimation, unanimatedStyle));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool animate(CompositeAnimation*, RenderElement*, const RenderStyle* currentStyle, const RenderStyle* targetStyle, std::unique_ptr&lt;RenderStyle&gt;&amp; animatedStyle) override;
</del><ins>+    bool animate(CompositeAnimation*, RenderElement*, const RenderStyle* currentStyle, const RenderStyle* targetStyle, std::unique_ptr&lt;RenderStyle&gt;&amp; animatedStyle, bool&amp; didBlendStyle) override;
</ins><span class="cx">     void getAnimatedStyle(std::unique_ptr&lt;RenderStyle&gt;&amp;) override;
</span><span class="cx"> 
</span><span class="cx">     bool computeExtentOfTransformAnimation(LayoutRect&amp;) const override;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp (208313 => 208314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp        2016-11-03 00:05:12 UTC (rev 208313)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp        2016-11-03 00:19:54 UTC (rev 208314)
</span><span class="lines">@@ -367,6 +367,7 @@
</span><span class="cx">         LOG_ERROR(&quot;ERROR void GraphicsContext::restore() stack is empty&quot;);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><ins>+
</ins><span class="cx">     m_state = m_stack.last();
</span><span class="cx">     m_stack.removeLast();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (208313 => 208314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm        2016-11-03 00:05:12 UTC (rev 208313)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm        2016-11-03 00:19:54 UTC (rev 208314)
</span><span class="lines">@@ -1067,46 +1067,48 @@
</span><span class="cx">     [NSGraphicsContext setCurrentContext:layerContext];
</span><span class="cx"> #endif
</span><span class="cx">     
</span><del>-    GraphicsContext graphicsContext(context);
-    graphicsContext.setIsCALayerContext(true);
-    graphicsContext.setIsAcceleratedContext(platformCALayer-&gt;acceleratesDrawing());
-    
-    if (!layerContents-&gt;platformCALayerContentsOpaque()) {
-        // Turn off font smoothing to improve the appearance of text rendered onto a transparent background.
-        graphicsContext.setShouldSmoothFonts(false);
-    }
-    
</del><ins>+    {
+        GraphicsContext graphicsContext(context);
+        graphicsContext.setIsCALayerContext(true);
+        graphicsContext.setIsAcceleratedContext(platformCALayer-&gt;acceleratesDrawing());
+        
+        if (!layerContents-&gt;platformCALayerContentsOpaque()) {
+            // Turn off font smoothing to improve the appearance of text rendered onto a transparent background.
+            graphicsContext.setShouldSmoothFonts(false);
+        }
+        
</ins><span class="cx"> #if PLATFORM(MAC)
</span><del>-    // It's important to get the clip from the context, because it may be significantly
-    // smaller than the layer bounds (e.g. tiled layers)
-    ThemeMac::setFocusRingClipRect(CGContextGetClipBoundingBox(context));
</del><ins>+        // It's important to get the clip from the context, because it may be significantly
+        // smaller than the layer bounds (e.g. tiled layers)
+        ThemeMac::setFocusRingClipRect(CGContextGetClipBoundingBox(context));
</ins><span class="cx"> #endif
</span><del>-    
-    for (const auto&amp; rect : dirtyRects) {
-        GraphicsContextStateSaver stateSaver(graphicsContext);
-        graphicsContext.clip(rect);
</del><span class="cx">         
</span><del>-        layerContents-&gt;platformCALayerPaintContents(platformCALayer, graphicsContext, rect);
-    }
-    
</del><ins>+        for (const auto&amp; rect : dirtyRects) {
+            GraphicsContextStateSaver stateSaver(graphicsContext);
+            graphicsContext.clip(rect);
+            
+            layerContents-&gt;platformCALayerPaintContents(platformCALayer, graphicsContext, rect);
+        }
+        
</ins><span class="cx"> #if PLATFORM(IOS)
</span><del>-    fontAntialiasingState.restore();
</del><ins>+        fontAntialiasingState.restore();
</ins><span class="cx"> #else
</span><del>-    ThemeMac::setFocusRingClipRect(FloatRect());
-    
-    [NSGraphicsContext restoreGraphicsState];
</del><ins>+        ThemeMac::setFocusRingClipRect(FloatRect());
+        
+        [NSGraphicsContext restoreGraphicsState];
</ins><span class="cx"> #endif
</span><del>-    
</del><ins>+    }
+
+    CGContextRestoreGState(context);
+
</ins><span class="cx">     // Re-fetch the layer owner, since &lt;rdar://problem/9125151&gt; indicates that it might have been destroyed during painting.
</span><span class="cx">     layerContents = platformCALayer-&gt;owner();
</span><span class="cx">     ASSERT(layerContents);
</span><span class="cx">     
</span><del>-    CGContextRestoreGState(context);
-    
</del><span class="cx">     // Always update the repaint count so that it's accurate even if the count itself is not shown. This will be useful
</span><span class="cx">     // for the Web Inspector feeding this information through the LayerTreeAgent.
</span><span class="cx">     int repaintCount = layerContents-&gt;platformCALayerIncrementRepaintCount(platformCALayer);
</span><del>-    
</del><ins>+
</ins><span class="cx">     if (!platformCALayer-&gt;usesTiledBackingLayer() &amp;&amp; layerContents &amp;&amp; layerContents-&gt;platformCALayerShowRepaintCounter(platformCALayer))
</span><span class="cx">         drawRepaintIndicator(context, platformCALayer, repaintCount, nullptr);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (208313 => 208314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2016-11-03 00:05:12 UTC (rev 208313)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2016-11-03 00:19:54 UTC (rev 208314)
</span><span class="lines">@@ -1809,6 +1809,7 @@
</span><span class="cx">         ancestor-&gt;beginTransparencyLayers(context, paintingInfo, dirtyRect);
</span><span class="cx">     
</span><span class="cx">     if (paintsWithTransparency(paintingInfo.paintBehavior)) {
</span><ins>+        ASSERT(isStackingContext());
</ins><span class="cx">         m_usedTransparency = true;
</span><span class="cx">         context.save();
</span><span class="cx">         LayoutRect adjustedClipRect = paintingExtent(*this, paintingInfo.rootLayer, dirtyRect, paintingInfo.paintBehavior);
</span></span></pre>
</div>
</div>

</body>
</html>