<!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>[190816] 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/190816">190816</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-10-09 12:59:12 -0700 (Fri, 09 Oct 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Dynamic background color changes do not update until a layout is forced
https://bugs.webkit.org/show_bug.cgi?id=131623
Source/WebCore:
Compute correct repaint rect for decorated RenderSVGRoots.
The current implementation of clippedOverflowRectForRepaint() uses the
generic repaint-rect calculations in SVGRenderSupport. Those in turn make
use of repaintRectInLocalCoordinates(), which for RenderSVGRoot is the
union of the painted children (w/ some expansion). If there're no children,
or they do not fill the entire content box, then a repaint would not
repaint the correct parts.
Fix by calculating the union of the border-box and the SVG content
when the SVG root is decorated (has background/border/etc.)
Adapted from a Chromium patch by fs@opera.com
https://src.chromium.org/viewvc/blink?revision=170890&view=revision
Patch by Antoine Quint <graouts@apple.com> on 2015-10-09
Reviewed by Darin Adler.
Tests: svg/repaint/add-background-property-on-root.html
svg/repaint/add-border-property-on-root.html
svg/repaint/add-outline-property-on-root.html
svg/repaint/change-background-color.html
svg/repaint/remove-background-property-on-root.html
svg/repaint/remove-border-property-on-root.html
svg/repaint/remove-outline-property-on-root.html
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):
(WebCore::RenderSVGRoot::styleDidChange):
(WebCore::RenderSVGRoot::clippedOverflowRectForRepaint):
LayoutTests:
Add some new tests checking that dynamically updating the "background",
"border" and "outline" CSS properties repaint correctly and rebase a few
existing tests that yield the same rendered results but slightly different
DRT output.
Patch by Antoine Quint <graouts@apple.com> on 2015-10-09
Reviewed by Darin Adler.
* platform/mac/fast/repaint/moving-shadow-on-container-expected.txt:
* platform/mac/svg/custom/simple-text-double-shadow-expected.txt:
* svg/css/composite-shadow-example-expected.txt:
* svg/css/composite-shadow-with-opacity-expected.txt:
* svg/repaint/add-background-property-on-root-expected.html: Added.
* svg/repaint/add-background-property-on-root.html: Added.
* svg/repaint/add-border-property-on-root-expected.html: Added.
* svg/repaint/add-border-property-on-root.html: Added.
* svg/repaint/add-outline-property-on-root-expected.html: Added.
* svg/repaint/add-outline-property-on-root.html: Added.
* svg/repaint/change-background-color-expected.html: Added.
* svg/repaint/change-background-color.html: Added.
* svg/repaint/remove-background-property-on-root-expected.html: Added.
* svg/repaint/remove-background-property-on-root.html: Added.
* svg/repaint/remove-border-property-on-root-expected.html: Added.
* svg/repaint/remove-border-property-on-root.html: Added.
* svg/repaint/remove-outline-property-on-root-expected.html: Added.
* svg/repaint/remove-outline-property-on-root.html: Added.
* svg/repaint/repaint-webkit-svg-shadow-expected.txt:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacfastrepaintmovingshadowoncontainerexpectedtxt">trunk/LayoutTests/platform/mac/fast/repaint/moving-shadow-on-container-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacsvgcustomsimpletextdoubleshadowexpectedtxt">trunk/LayoutTests/platform/mac/svg/custom/simple-text-double-shadow-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcsscompositeshadowexampleexpectedtxt">trunk/LayoutTests/svg/css/composite-shadow-example-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgcsscompositeshadowwithopacityexpectedtxt">trunk/LayoutTests/svg/css/composite-shadow-with-opacity-expected.txt</a></li>
<li><a href="#trunkLayoutTestssvgrepaintrepaintwebkitsvgshadowexpectedtxt">trunk/LayoutTests/svg/repaint/repaint-webkit-svg-shadow-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgRenderSVGRootcpp">trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvgrepaintaddbackgroundpropertyonrootexpectedhtml">trunk/LayoutTests/svg/repaint/add-background-property-on-root-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgrepaintaddbackgroundpropertyonroothtml">trunk/LayoutTests/svg/repaint/add-background-property-on-root.html</a></li>
<li><a href="#trunkLayoutTestssvgrepaintaddborderpropertyonrootexpectedhtml">trunk/LayoutTests/svg/repaint/add-border-property-on-root-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgrepaintaddborderpropertyonroothtml">trunk/LayoutTests/svg/repaint/add-border-property-on-root.html</a></li>
<li><a href="#trunkLayoutTestssvgrepaintaddoutlinepropertyonrootexpectedhtml">trunk/LayoutTests/svg/repaint/add-outline-property-on-root-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgrepaintaddoutlinepropertyonroothtml">trunk/LayoutTests/svg/repaint/add-outline-property-on-root.html</a></li>
<li><a href="#trunkLayoutTestssvgrepaintchangebackgroundcolorexpectedhtml">trunk/LayoutTests/svg/repaint/change-background-color-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgrepaintchangebackgroundcolorhtml">trunk/LayoutTests/svg/repaint/change-background-color.html</a></li>
<li><a href="#trunkLayoutTestssvgrepaintremovebackgroundpropertyonrootexpectedhtml">trunk/LayoutTests/svg/repaint/remove-background-property-on-root-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgrepaintremovebackgroundpropertyonroothtml">trunk/LayoutTests/svg/repaint/remove-background-property-on-root.html</a></li>
<li><a href="#trunkLayoutTestssvgrepaintremoveborderpropertyonrootexpectedhtml">trunk/LayoutTests/svg/repaint/remove-border-property-on-root-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgrepaintremoveborderpropertyonroothtml">trunk/LayoutTests/svg/repaint/remove-border-property-on-root.html</a></li>
<li><a href="#trunkLayoutTestssvgrepaintremoveoutlinepropertyonrootexpectedhtml">trunk/LayoutTests/svg/repaint/remove-outline-property-on-root-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgrepaintremoveoutlinepropertyonroothtml">trunk/LayoutTests/svg/repaint/remove-outline-property-on-root.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (190815 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-10-09 19:58:42 UTC (rev 190815)
+++ trunk/LayoutTests/ChangeLog        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2015-10-09 Antoine Quint <graouts@apple.com>
+
+ Dynamic background color changes do not update until a layout is forced
+ https://bugs.webkit.org/show_bug.cgi?id=131623
+
+ Add some new tests checking that dynamically updating the "background",
+ "border" and "outline" CSS properties repaint correctly and rebase a few
+ existing tests that yield the same rendered results but slightly different
+ DRT output.
+
+ Reviewed by Darin Adler.
+
+ * platform/mac/fast/repaint/moving-shadow-on-container-expected.txt:
+ * platform/mac/svg/custom/simple-text-double-shadow-expected.txt:
+ * svg/css/composite-shadow-example-expected.txt:
+ * svg/css/composite-shadow-with-opacity-expected.txt:
+ * svg/repaint/add-background-property-on-root-expected.html: Added.
+ * svg/repaint/add-background-property-on-root.html: Added.
+ * svg/repaint/add-border-property-on-root-expected.html: Added.
+ * svg/repaint/add-border-property-on-root.html: Added.
+ * svg/repaint/add-outline-property-on-root-expected.html: Added.
+ * svg/repaint/add-outline-property-on-root.html: Added.
+ * svg/repaint/change-background-color-expected.html: Added.
+ * svg/repaint/change-background-color.html: Added.
+ * svg/repaint/remove-background-property-on-root-expected.html: Added.
+ * svg/repaint/remove-background-property-on-root.html: Added.
+ * svg/repaint/remove-border-property-on-root-expected.html: Added.
+ * svg/repaint/remove-border-property-on-root.html: Added.
+ * svg/repaint/remove-outline-property-on-root-expected.html: Added.
+ * svg/repaint/remove-outline-property-on-root.html: Added.
+ * svg/repaint/repaint-webkit-svg-shadow-expected.txt:
+
</ins><span class="cx"> 2015-10-06 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><span class="cx"> Add some missing iOS results.
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacfastrepaintmovingshadowoncontainerexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/fast/repaint/moving-shadow-on-container-expected.txt (190815 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/fast/repaint/moving-shadow-on-container-expected.txt        2015-10-09 19:58:42 UTC (rev 190815)
+++ trunk/LayoutTests/platform/mac/fast/repaint/moving-shadow-on-container-expected.txt        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> layer at (0,0) size 785x616
</span><span class="cx"> RenderBlock {HTML} at (0,0) size 785x616
</span><span class="cx"> RenderBody {BODY} at (8,8) size 769x600
</span><del>- RenderSVGRoot {svg} at (8,8) size 496x201
</del><ins>+ RenderSVGRoot {svg} at (8,8) size 472x177
</ins><span class="cx"> RenderSVGPath {path} at (8,8) size 80x70 [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
</span><span class="cx"> RenderSVGPath {path} at (198,44) size 132x129 [transform={m=((1.00,0.00)(0.00,1.00)) t=(250.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
</span><span class="cx"> RenderSVGPath {path} at (347,44) size 121x126 [transform={m=((1.00,0.00)(0.00,1.00)) t=(400.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00] [dash array={20.00}]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.53081e-15 25 L -29.3893 40.4509 L -23.7764 7.72542 L -47.5528 -15.4508 L -14.6946 -20.2254 L -9.18485e-15 -50 L 14.6946 -20.2254 L 47.5528 -15.4508 L 23.7764 7.72542 L 29.3893 40.4509 Z"]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacsvgcustomsimpletextdoubleshadowexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/svg/custom/simple-text-double-shadow-expected.txt (190815 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/svg/custom/simple-text-double-shadow-expected.txt        2015-10-09 19:58:42 UTC (rev 190815)
+++ trunk/LayoutTests/platform/mac/svg/custom/simple-text-double-shadow-expected.txt        2015-10-09 19:59:12 UTC (rev 190816)
</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><span class="cx"> layer at (0,0) size 800x600
</span><del>- RenderSVGRoot {svg} at (20,26) size 480x294
</del><ins>+ RenderSVGRoot {svg} at (20,26) size 380x194
</ins><span class="cx"> RenderSVGText {text} at (20,26) size 221x18 contains 1 chunk(s)
</span><span class="cx"> RenderSVGInlineText {#text} at (0,0) size 221x18
</span><span class="cx"> chunk 1 text run 1 at (20.00,40.00) startOffset 0 endOffset 34 width 220.84: "This text should appear only twice"
</span></span></pre></div>
<a id="trunkLayoutTestssvgcsscompositeshadowexampleexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/css/composite-shadow-example-expected.txt (190815 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/composite-shadow-example-expected.txt        2015-10-09 19:58:42 UTC (rev 190815)
+++ trunk/LayoutTests/svg/css/composite-shadow-example-expected.txt        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> layer at (0,0) size 785x616
</span><span class="cx"> RenderBlock {HTML} at (0,0) size 785x616
</span><span class="cx"> RenderBody {BODY} at (8,8) size 769x600
</span><del>- RenderSVGRoot {svg} at (32,28) size 472x186
</del><ins>+ RenderSVGRoot {svg} at (36,32) size 444x158
</ins><span class="cx"> RenderSVGContainer {g} at (36,32) size 164x158
</span><span class="cx"> RenderSVGPath {path} at (38,34) size 150x144 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
</span><span class="cx"> RenderSVGContainer {g} at (196,42) size 146x143
</span></span></pre></div>
<a id="trunkLayoutTestssvgcsscompositeshadowwithopacityexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/css/composite-shadow-with-opacity-expected.txt (190815 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/css/composite-shadow-with-opacity-expected.txt        2015-10-09 19:58:42 UTC (rev 190815)
+++ trunk/LayoutTests/svg/css/composite-shadow-with-opacity-expected.txt        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> RenderBlock {HTML} at (0,0) size 785x616
</span><span class="cx"> RenderBody {BODY} at (8,8) size 769x600
</span><span class="cx"> layer at (8,8) size 769x600
</span><del>- RenderSVGRoot {svg} at (32,28) size 472x186 [opacity=0.50]
</del><ins>+ RenderSVGRoot {svg} at (36,32) size 444x158 [opacity=0.50]
</ins><span class="cx"> RenderSVGContainer {g} at (36,32) size 164x158
</span><span class="cx"> RenderSVGPath {path} at (38,34) size 150x144 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M 1.83697e-15 30 L -35.2671 48.541 L -28.5317 9.27051 L -57.0634 -18.541 L -17.6336 -24.2705 L -1.10218e-14 -60 L 17.6336 -24.2705 L 57.0634 -18.541 L 28.5317 9.27051 L 35.2671 48.541 Z"]
</span><span class="cx"> RenderSVGContainer {g} at (196,42) size 146x143
</span></span></pre></div>
<a id="trunkLayoutTestssvgrepaintaddbackgroundpropertyonrootexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/repaint/add-background-property-on-root-expected.html (0 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/repaint/add-background-property-on-root-expected.html         (rev 0)
+++ trunk/LayoutTests/svg/repaint/add-background-property-on-root-expected.html        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background: red">
+ <svg width="100" height="100" style="background: green"></svg>
+</div>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgrepaintaddbackgroundpropertyonroothtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/repaint/add-background-property-on-root.html (0 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/repaint/add-background-property-on-root.html         (rev 0)
+++ trunk/LayoutTests/svg/repaint/add-background-property-on-root.html        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+<!DOCTYPE html>
+<script>
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+window.onload = function() {
+ requestAnimationFrame(function() {
+ document.querySelector("svg").style.background = "green";
+ if (window.testRunner)
+ window.testRunner.notifyDone();
+ });
+};
+</script>
+<div style="width: 100px; height: 100px; background: red">
+ <svg width="100" height="100"></svg>
+</div>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgrepaintaddborderpropertyonrootexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/repaint/add-border-property-on-root-expected.html (0 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/repaint/add-border-property-on-root-expected.html         (rev 0)
+++ trunk/LayoutTests/svg/repaint/add-border-property-on-root-expected.html        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+<!DOCTYPE html>
+<svg width="100" height="100" style="position: absolute; border: 10px solid green"></svg>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgrepaintaddborderpropertyonroothtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/repaint/add-border-property-on-root.html (0 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/repaint/add-border-property-on-root.html         (rev 0)
+++ trunk/LayoutTests/svg/repaint/add-border-property-on-root.html        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+<!DOCTYPE html>
+<script>
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+window.onload = function() {
+ requestAnimationFrame(function() {
+ document.querySelector("svg").style.border = "10px solid green";
+ if (window.testRunner)
+ window.testRunner.notifyDone();
+ });
+};
+</script>
+<svg width="100" height="100" style="position: absolute"></svg>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgrepaintaddoutlinepropertyonrootexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/repaint/add-outline-property-on-root-expected.html (0 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/repaint/add-outline-property-on-root-expected.html         (rev 0)
+++ trunk/LayoutTests/svg/repaint/add-outline-property-on-root-expected.html        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+<!DOCTYPE html>
+<svg width="100" height="100" style="outline: 10px solid green"><rect width="100" height="100" fill="blue"/></svg>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgrepaintaddoutlinepropertyonroothtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/repaint/add-outline-property-on-root.html (0 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/repaint/add-outline-property-on-root.html         (rev 0)
+++ trunk/LayoutTests/svg/repaint/add-outline-property-on-root.html        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+<!DOCTYPE html>
+<script>
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+window.onload = function() {
+ requestAnimationFrame(function() {
+ document.querySelector("svg").style.outline = "10px solid green";
+ if (window.testRunner)
+ window.testRunner.notifyDone();
+ });
+};
+</script>
+<svg width="100" height="100">
+ <rect width="100" height="100" fill="blue"/>
+</svg>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgrepaintchangebackgroundcolorexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/repaint/change-background-color-expected.html (0 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/repaint/change-background-color-expected.html         (rev 0)
+++ trunk/LayoutTests/svg/repaint/change-background-color-expected.html        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+<!DOCTYPE HTML>
+<svg width="200px" height="100px" viewBox="0 0 100 100" style="background-color: green"></svg>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgrepaintchangebackgroundcolorhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/repaint/change-background-color.html (0 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/repaint/change-background-color.html         (rev 0)
+++ trunk/LayoutTests/svg/repaint/change-background-color.html        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+<!DOCTYPE HTML>
+<script>
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+window.onload = function() {
+ requestAnimationFrame(function() {
+ document.querySelector("svg").style.backgroundColor = "green";
+ if (window.testRunner)
+ window.testRunner.notifyDone();
+ });
+};
+</script>
+<svg width="200px" height="100px" viewBox="0 0 100 100" style="background-color: red"></svg>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgrepaintremovebackgroundpropertyonrootexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/repaint/remove-background-property-on-root-expected.html (0 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/repaint/remove-background-property-on-root-expected.html         (rev 0)
+++ trunk/LayoutTests/svg/repaint/remove-background-property-on-root-expected.html        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+<!DOCTYPE html>
+<div style="width: 100px; height: 100px; background: green"></div>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgrepaintremovebackgroundpropertyonroothtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/repaint/remove-background-property-on-root.html (0 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/repaint/remove-background-property-on-root.html         (rev 0)
+++ trunk/LayoutTests/svg/repaint/remove-background-property-on-root.html        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+<!DOCTYPE html>
+<script>
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+window.onload = function() {
+ requestAnimationFrame(function() {
+ document.querySelector("svg").style.removeProperty("background");
+ if (window.testRunner)
+ window.testRunner.notifyDone();
+ });
+};
+</script>
+<div style="width: 100px; height: 100px; background: green">
+ <svg style="background: red" width="100" height="100"></svg>
+</div>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgrepaintremoveborderpropertyonrootexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/repaint/remove-border-property-on-root-expected.html (0 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/repaint/remove-border-property-on-root-expected.html         (rev 0)
+++ trunk/LayoutTests/svg/repaint/remove-border-property-on-root-expected.html        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+<!DOCTYPE html>
+<svg style="position: absolute" width="100" height="100"></svg>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgrepaintremoveborderpropertyonroothtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/repaint/remove-border-property-on-root.html (0 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/repaint/remove-border-property-on-root.html         (rev 0)
+++ trunk/LayoutTests/svg/repaint/remove-border-property-on-root.html        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+<!DOCTYPE html>
+<script>
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+window.onload = function() {
+ requestAnimationFrame(function() {
+ document.querySelector("svg").style.removeProperty("border");
+ if (window.testRunner)
+ window.testRunner.notifyDone();
+ });
+};
+</script>
+<svg style="border: 10px solid red; position: absolute" width="100" height="100"></svg>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgrepaintremoveoutlinepropertyonrootexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/repaint/remove-outline-property-on-root-expected.html (0 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/repaint/remove-outline-property-on-root-expected.html         (rev 0)
+++ trunk/LayoutTests/svg/repaint/remove-outline-property-on-root-expected.html        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+<!DOCTYPE html>
+<svg width="100" height="100"><rect width="100" height="100" fill="green"/></svg>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgrepaintremoveoutlinepropertyonroothtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/repaint/remove-outline-property-on-root.html (0 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/repaint/remove-outline-property-on-root.html         (rev 0)
+++ trunk/LayoutTests/svg/repaint/remove-outline-property-on-root.html        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+<!DOCTYPE html>
+<script>
+if (window.testRunner)
+ testRunner.waitUntilDone();
+
+window.onload = function() {
+ requestAnimationFrame(function() {
+ document.querySelector("svg").style.removeProperty("outline");
+ if (window.testRunner)
+ window.testRunner.notifyDone();
+ });
+};
+</script>
+<svg style="outline: 10px solid red" width="100" height="100">
+ <rect width="100" height="100" fill="green"/>
+</svg>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgrepaintrepaintwebkitsvgshadowexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/svg/repaint/repaint-webkit-svg-shadow-expected.txt (190815 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/repaint/repaint-webkit-svg-shadow-expected.txt        2015-10-09 19:58:42 UTC (rev 190815)
+++ trunk/LayoutTests/svg/repaint/repaint-webkit-svg-shadow-expected.txt        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> layer at (0,0) size 800x600
</span><span class="cx"> RenderView at (0,0) size 800x600
</span><span class="cx"> layer at (0,0) size 800x600
</span><del>- RenderSVGRoot {svg} at (120,0) size 450x520
</del><ins>+ RenderSVGRoot {svg} at (120,0) size 250x320
</ins><span class="cx"> RenderSVGRect {rect} at (150,100) size 120x120 [transform={m=((1.00,0.00)(0.00,1.00)) t=(150.00,50.00)}] [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=50.00] [width=20.00] [height=20.00]
</span><span class="cx"> RenderSVGRect {rect} at (120,0) size 120x120 [fill={[type=SOLID] [color=#000000]}] [x=120.00] [y=0.00] [width=20.00] [height=20.00]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (190815 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-09 19:58:42 UTC (rev 190815)
+++ trunk/Source/WebCore/ChangeLog        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2015-10-09 Antoine Quint <graouts@apple.com>
+
+ Dynamic background color changes do not update until a layout is forced
+ https://bugs.webkit.org/show_bug.cgi?id=131623
+
+ Compute correct repaint rect for decorated RenderSVGRoots.
+
+ The current implementation of clippedOverflowRectForRepaint() uses the
+ generic repaint-rect calculations in SVGRenderSupport. Those in turn make
+ use of repaintRectInLocalCoordinates(), which for RenderSVGRoot is the
+ union of the painted children (w/ some expansion). If there're no children,
+ or they do not fill the entire content box, then a repaint would not
+ repaint the correct parts.
+ Fix by calculating the union of the border-box and the SVG content
+ when the SVG root is decorated (has background/border/etc.)
+
+ Adapted from a Chromium patch by fs@opera.com
+ https://src.chromium.org/viewvc/blink?revision=170890&view=revision
+
+ Reviewed by Darin Adler.
+
+ Tests: svg/repaint/add-background-property-on-root.html
+ svg/repaint/add-border-property-on-root.html
+ svg/repaint/add-outline-property-on-root.html
+ svg/repaint/change-background-color.html
+ svg/repaint/remove-background-property-on-root.html
+ svg/repaint/remove-border-property-on-root.html
+ svg/repaint/remove-outline-property-on-root.html
+
+ * rendering/svg/RenderSVGRoot.cpp:
+ (WebCore::RenderSVGRoot::layout):
+ (WebCore::RenderSVGRoot::styleDidChange):
+ (WebCore::RenderSVGRoot::clippedOverflowRectForRepaint):
+
</ins><span class="cx"> 2015-10-09 Simon Fraser <simon.fraser@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS WK2] Fix assertion in ViewportConfiguration::setDefaultConfiguration seen in testing
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgRenderSVGRootcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp (190815 => 190816)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp        2015-10-09 19:58:42 UTC (rev 190815)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp        2015-10-09 19:59:12 UTC (rev 190816)
</span><span class="lines">@@ -300,6 +300,11 @@
</span><span class="cx"> {
</span><span class="cx"> if (diff == StyleDifferenceLayout)
</span><span class="cx"> setNeedsBoundariesUpdate();
</span><ins>+
+ // Box decorations may have appeared/disappeared - recompute status.
+ if (diff == StyleDifferenceRepaint)
+ m_hasBoxDecorations = hasBoxDecorationStyle();
+
</ins><span class="cx"> RenderReplaced::styleDidChange(diff, oldStyle);
</span><span class="cx"> SVGResourcesCache::clientStyleChanged(*this, diff, style());
</span><span class="cx"> }
</span><span class="lines">@@ -342,7 +347,17 @@
</span><span class="cx">
</span><span class="cx"> LayoutRect RenderSVGRoot::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const
</span><span class="cx"> {
</span><del>- return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer);
</del><ins>+ if (style().visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent())
+ return LayoutRect();
+
+ FloatRect contentRepaintRect = m_localToBorderBoxTransform.mapRect(repaintRectInLocalCoordinates());
+ contentRepaintRect.intersect(snappedIntRect(borderBoxRect()));
+
+ LayoutRect repaintRect = enclosingLayoutRect(contentRepaintRect);
+ if (m_hasBoxDecorations || hasRenderOverflow())
+ repaintRect.unite(unionRect(localSelectionRect(false), visualOverflowRect()));
+
+ return RenderReplaced::computeRectForRepaint(enclosingIntRect(repaintRect), repaintContainer);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> FloatRect RenderSVGRoot::computeFloatRectForRepaint(const FloatRect& repaintRect, const RenderLayerModelObject* repaintContainer, bool fixed) const
</span></span></pre>
</div>
</div>
</body>
</html>