<!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>[172656] 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/172656">172656</a></dd>
<dt>Author</dt> <dd>zalan@apple.com</dd>
<dt>Date</dt> <dd>2014-08-15 15:43:50 -0700 (Fri, 15 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION: Parts of the route/route options windows are invisible at maps.google.com
https://bugs.webkit.org/show_bug.cgi?id=135977
&lt;rdar://problem/17961698&gt;

Reviewed by Andreas Kling.

When the style change requires both layout and repaint, the style diff is set to
'layout is needed' (and masks the repaint change) as normally layout is followed by a repaint.
However, in compositing context, layout may not be followed by repaint, so when the style diff
indicates layout, we need to figure out whether it implies repaint too.
This logic should eventually be moved from RenderElement to RenderLayerModelObject/RenderLayer.
-tracked here: webkit.org/b/135990

Source/WebCore:

Test: compositing/cliprect-and-position-change-on-compositing-layer.html

* rendering/RenderElement.cpp:
(WebCore::RenderElement::setNeedsPositionedMovementLayout):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayerRepaint):
(WebCore::RenderStyle::diffRequiresLayerRepaint):
(WebCore::RenderStyle::diffRequiresRepaint): Deleted.
* rendering/style/RenderStyle.h:
* rendering/style/RenderStyleConstants.h:

LayoutTests:

* compositing/cliprect-and-position-change-on-compositing-layer-expected.html: Added.
* compositing/cliprect-and-position-change-on-compositing-layer.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="#trunkSourceWebCorerenderingRenderElementcpp">trunk/Source/WebCore/rendering/RenderElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStylecpp">trunk/Source/WebCore/rendering/style/RenderStyle.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleh">trunk/Source/WebCore/rendering/style/RenderStyle.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleConstantsh">trunk/Source/WebCore/rendering/style/RenderStyleConstants.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscompositingcliprectandpositionchangeoncompositinglayerexpectedhtml">trunk/LayoutTests/compositing/cliprect-and-position-change-on-compositing-layer-expected.html</a></li>
<li><a href="#trunkLayoutTestscompositingcliprectandpositionchangeoncompositinglayerhtml">trunk/LayoutTests/compositing/cliprect-and-position-change-on-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 (172655 => 172656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-08-15 22:40:33 UTC (rev 172655)
+++ trunk/LayoutTests/ChangeLog        2014-08-15 22:43:50 UTC (rev 172656)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2014-08-15  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        REGRESSION: Parts of the route/route options windows are invisible at maps.google.com
+        https://bugs.webkit.org/show_bug.cgi?id=135977
+        &lt;rdar://problem/17961698&gt;
+
+        Reviewed by Andreas Kling.
+
+        When the style change requires both layout and repaint, the style diff is set to
+        'layout is needed' (and masks the repaint change) as normally layout is followed by a repaint.
+        However, in compositing context, layout may not be followed by repaint, so when the style diff
+        indicates layout, we need to figure out whether it implies repaint too.
+        This logic should eventually be moved from RenderElement to RenderLayerModelObject/RenderLayer.
+        -tracked here: webkit.org/b/135990
+
+        * compositing/cliprect-and-position-change-on-compositing-layer-expected.html: Added.
+        * compositing/cliprect-and-position-change-on-compositing-layer.html: Added.
+
</ins><span class="cx"> 2014-08-15  Dirk Schulze  &lt;krit@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Turn r/rx/ry to presentation attributes
</span></span></pre></div>
<a id="trunkLayoutTestscompositingcliprectandpositionchangeoncompositinglayerexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/compositing/cliprect-and-position-change-on-compositing-layer-expected.html (0 => 172656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/compositing/cliprect-and-position-change-on-compositing-layer-expected.html                                (rev 0)
+++ trunk/LayoutTests/compositing/cliprect-and-position-change-on-compositing-layer-expected.html        2014-08-15 22:43:50 UTC (rev 172656)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;This test that compositing layers get repainted properly when cliprect is applied with position change.&lt;/title&gt;
+&lt;style&gt;
+  #foo {
+    position: absolute;
+    top: 1px;
+    left: 0px;
+    width: 100px;
+    height: 100px;
+    background-color: green;
+    -webkit-transform: translateZ(0);
+}
+&lt;/style&gt;
+&lt;/head&gt; 
+&lt;body&gt;     
+&lt;div id=foo&gt;&lt;/div&gt;      
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscompositingcliprectandpositionchangeoncompositinglayerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/compositing/cliprect-and-position-change-on-compositing-layer.html (0 => 172656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/compositing/cliprect-and-position-change-on-compositing-layer.html                                (rev 0)
+++ trunk/LayoutTests/compositing/cliprect-and-position-change-on-compositing-layer.html        2014-08-15 22:43:50 UTC (rev 172656)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;This test that compositing layers get repainted properly when cliprect is applied with position change.&lt;/title&gt;
+&lt;style&gt;
+  #foo {
+    position: absolute;
+    top: 0px;
+    left: 0px;
+    width: 100px;
+    height: 100px;
+    background-color: green;
+    clip: rect(70px, 102px, 102px, -1px);
+    -webkit-transform: translateZ(0);
+}
+&lt;/style&gt;
+&lt;/head&gt; 
+&lt;body&gt;     
+&lt;div id=foo&gt;&lt;/div&gt;      
+&lt;script&gt;
+  if (window.testRunner)
+    testRunner.waitUntilDone();
+
+  setTimeout(function() { 
+    var box = document.getElementById(&quot;foo&quot;);
+    box.style.clip = &quot;rect(0px, 102px, 202px, 0px)&quot;;
+    box.style.top = &quot;1px&quot;;
+    box.offsetHeight;
+    
+  if (window.testRunner)
+    testRunner.notifyDone();
+  }, 0);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (172655 => 172656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-08-15 22:40:33 UTC (rev 172655)
+++ trunk/Source/WebCore/ChangeLog        2014-08-15 22:43:50 UTC (rev 172656)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2014-08-15  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        REGRESSION: Parts of the route/route options windows are invisible at maps.google.com
+        https://bugs.webkit.org/show_bug.cgi?id=135977
+        &lt;rdar://problem/17961698&gt;
+
+        Reviewed by Andreas Kling.
+
+        When the style change requires both layout and repaint, the style diff is set to
+        'layout is needed' (and masks the repaint change) as normally layout is followed by a repaint.
+        However, in compositing context, layout may not be followed by repaint, so when the style diff
+        indicates layout, we need to figure out whether it implies repaint too.
+        This logic should eventually be moved from RenderElement to RenderLayerModelObject/RenderLayer.
+        -tracked here: webkit.org/b/135990
+
+        Test: compositing/cliprect-and-position-change-on-compositing-layer.html
+
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::setNeedsPositionedMovementLayout):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::changeRequiresLayerRepaint):
+        (WebCore::RenderStyle::diffRequiresLayerRepaint):
+        (WebCore::RenderStyle::diffRequiresRepaint): Deleted.
+        * rendering/style/RenderStyle.h:
+        * rendering/style/RenderStyleConstants.h:
+
</ins><span class="cx"> 2014-08-15  Brian J. Burg  &lt;burg@cs.washington.edu&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: rewrite CodeGeneratorInspector to be modular and testable
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (172655 => 172656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.cpp        2014-08-15 22:40:33 UTC (rev 172655)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp        2014-08-15 22:43:50 UTC (rev 172656)
</span><span class="lines">@@ -1028,7 +1028,7 @@
</span><span class="cx">     setNeedsPositionedMovementLayoutBit(true);
</span><span class="cx">     markContainingBlocksForLayout();
</span><span class="cx">     if (hasLayer()) {
</span><del>-        if (oldStyle &amp;&amp; style().diffRequiresRepaint(oldStyle))
</del><ins>+        if (oldStyle &amp;&amp; style().diffRequiresLayerRepaint(*oldStyle, toRenderLayerModelObject(this)-&gt;layer()-&gt;isComposited()))
</ins><span class="cx">             setLayerNeedsFullRepaint();
</span><span class="cx">         else
</span><span class="cx">             setLayerNeedsFullRepaintForPositionedMovementLayout();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStylecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (172655 => 172656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2014-08-15 22:40:33 UTC (rev 172655)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp        2014-08-15 22:43:50 UTC (rev 172656)
</span><span class="lines">@@ -679,9 +679,10 @@
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     if (position() != StaticPosition) {
</span><del>-        if (visual-&gt;clip != other-&gt;visual-&gt;clip
-            || visual-&gt;hasClip != other-&gt;visual-&gt;hasClip)
</del><ins>+        if (visual-&gt;clip != other-&gt;visual-&gt;clip || visual-&gt;hasClip != other-&gt;visual-&gt;hasClip) {
+            changedContextSensitiveProperties |= ContextSensitivePropertyClipRect;
</ins><span class="cx">             return true;
</span><ins>+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_COMPOSITING)
</span><span class="lines">@@ -810,10 +811,17 @@
</span><span class="cx">     return StyleDifferenceEqual;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderStyle::diffRequiresRepaint(const RenderStyle* style) const
</del><ins>+bool RenderStyle::diffRequiresLayerRepaint(const RenderStyle&amp; style, bool isComposited) const
</ins><span class="cx"> {
</span><span class="cx">     unsigned changedContextSensitiveProperties = 0;
</span><del>-    return changeRequiresRepaint(style, changedContextSensitiveProperties);
</del><ins>+
+    if (changeRequiresRepaint(&amp;style, changedContextSensitiveProperties))
+        return true;
+
+    if (isComposited &amp;&amp; changeRequiresLayerRepaint(&amp;style, changedContextSensitiveProperties))
+        return changedContextSensitiveProperties &amp; ContextSensitivePropertyClipRect;
+
+    return false;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderStyle::setClip(Length top, Length right, Length bottom, Length left)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (172655 => 172656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2014-08-15 22:40:33 UTC (rev 172655)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2014-08-15 22:43:50 UTC (rev 172656)
</span><span class="lines">@@ -1757,7 +1757,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     StyleDifference diff(const RenderStyle*, unsigned&amp; changedContextSensitiveProperties) const;
</span><del>-    bool diffRequiresRepaint(const RenderStyle*) const;
</del><ins>+    bool diffRequiresLayerRepaint(const RenderStyle&amp;, bool isComposited) const;
</ins><span class="cx"> 
</span><span class="cx">     bool isDisplayReplacedType() const { return isDisplayReplacedType(display()); }
</span><span class="cx">     bool isDisplayInlineType() const { return isDisplayInlineType(display()); }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleConstantsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (172655 => 172656)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h        2014-08-15 22:40:33 UTC (rev 172655)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h        2014-08-15 22:43:50 UTC (rev 172656)
</span><span class="lines">@@ -64,7 +64,8 @@
</span><span class="cx">     ContextSensitivePropertyNone = 0,
</span><span class="cx">     ContextSensitivePropertyTransform = (1 &lt;&lt; 0),
</span><span class="cx">     ContextSensitivePropertyOpacity = (1 &lt;&lt; 1),
</span><del>-    ContextSensitivePropertyFilter = (1 &lt;&lt; 2)
</del><ins>+    ContextSensitivePropertyFilter = (1 &lt;&lt; 2),
+    ContextSensitivePropertyClipRect = (1 &lt;&lt; 3)
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> // Static pseudo styles. Dynamic ones are produced on the fly.
</span></span></pre>
</div>
</div>

</body>
</html>