<!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>[180852] releases/WebKitGTK/webkit-2.8</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/180852">180852</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-03-01 00:24:55 -0800 (Sun, 01 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/180643">r180643</a> - Horizontal and vertical lines are clipped completely if clip-path is included in the tag but the referenced element is defined later.
https://bugs.webkit.org/show_bug.cgi?id=141776.

Reviewed by Dean Jackson.
Source/WebCore:

Tests: svg/clip-path/clip-path-line-use-before-defined-expected.svg
       svg/clip-path/clip-path-line-use-before-defined.svg

* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::applyClippingToContext): Ensure the renderer
is added to m_clipper if it does not exist. The same renderer might have been
added to m_clipper in resourceBoundingBox().

(WebCore::RenderSVGResourceClipper::addRendererToClipper): Add the renderer to
m_clipper if it does not exist. Return the associated ClipperData.

(WebCore::RenderSVGResourceClipper::resourceBoundingBox): If the clipper is
referenced before it is defined, add the renderer to m_clipper. While doing the
layout() for the clipper, we can check if m_clipper has values or not. If it does
have, we are going to mark the clipper for client invalidation which is done by
the SVG root.

* rendering/svg/RenderSVGResourceClipper.h:
* rendering/svg/RenderSVGResourceContainer.h:
(WebCore::RenderSVGResourceContainer::selfNeedsClientInvalidation): Define a
new function selfNeedsClientInvalidation() which controls marking the clipper
for client invalidation. In RenderSVGResourceClipper, override it so it checks
m_clipper to force clients validation even if it the first time we do layout
for this clipper.

* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::layout): Call the virtual function
selfNeedsClientInvalidation() to check whether we need to mark the clipper for
client invalidation.

* svg/SVGElement.cpp: Delete unneeded header file.

LayoutTests:

New test cases for SVG lines which are clipped to a &lt;clipPath&gt;. The &lt;clipPath&gt;
is referenced before it is defined.

* svg/clip-path/clip-path-line-use-before-defined-expected.svg: Added.
* svg/clip-path/clip-path-line-use-before-defined.svg: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCorerenderingsvgRenderSVGResourceClippercpp">releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCorerenderingsvgRenderSVGResourceClipperh">releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCorerenderingsvgRenderSVGResourceContainercpp">releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCorerenderingsvgRenderSVGResourceContainerh">releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceContainer.h</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCoresvgSVGElementcpp">releases/WebKitGTK/webkit-2.8/Source/WebCore/svg/SVGElement.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestssvgclippathclippathlineusebeforedefinedexpectedsvg">releases/WebKitGTK/webkit-2.8/LayoutTests/svg/clip-path/clip-path-line-use-before-defined-expected.svg</a></li>
<li><a href="#releasesWebKitGTKwebkit28LayoutTestssvgclippathclippathlineusebeforedefinedsvg">releases/WebKitGTK/webkit-2.8/LayoutTests/svg/clip-path/clip-path-line-use-before-defined.svg</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit28LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog (180851 => 180852)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog        2015-03-01 08:21:13 UTC (rev 180851)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/ChangeLog        2015-03-01 08:24:55 UTC (rev 180852)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2015-02-26  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
+
+        Cleanup RenderSVGResourceClipper class.
+        https://bugs.webkit.org/show_bug.cgi?id=142032.
+
+        Reviewed by Darin Adler.
+
+        * svg/clip-path/clip-path-line-use-before-defined-expected.svg:
+        * svg/clip-path/clip-path-line-use-before-defined.svg: Simplify the test
+        and make separate drawings for different cases.
+
+2015-02-25  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
+
+        Horizontal and vertical lines are clipped completely if clip-path is included in the tag but the referenced element is defined later.
+        https://bugs.webkit.org/show_bug.cgi?id=141776.
+
+        Reviewed by Dean Jackson.
+        
+        New test cases for SVG lines which are clipped to a &lt;clipPath&gt;. The &lt;clipPath&gt;
+        is referenced before it is defined.
+
+        * svg/clip-path/clip-path-line-use-before-defined-expected.svg: Added.
+        * svg/clip-path/clip-path-line-use-before-defined.svg: Added.
+
</ins><span class="cx"> 2015-02-25  Joanmarie Diggs  &lt;jdiggs@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: Implement support for ARIA 1.1 'searchbox' role
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestssvgclippathclippathlineusebeforedefinedexpectedsvg"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/LayoutTests/svg/clip-path/clip-path-line-use-before-defined-expected.svg (0 => 180852)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/svg/clip-path/clip-path-line-use-before-defined-expected.svg                                (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/svg/clip-path/clip-path-line-use-before-defined-expected.svg        2015-03-01 08:24:55 UTC (rev 180852)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
+  &lt;defs&gt;
+    &lt;style&gt;
+      line, path {
+        stroke: black;
+        stroke-width: 3;
+      }
+    &lt;/style&gt;
+    &lt;clipPath id=&quot;clip-circle&quot;&gt;
+      &lt;circle cx=&quot;75&quot; cy=&quot;75&quot; r=&quot;50&quot;/&gt;
+    &lt;/clipPath&gt;
+    &lt;g id=&quot;circle-in-rect&quot;&gt;
+      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;150&quot; height=&quot;150&quot; fill=&quot;lime&quot;/&gt;
+      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;150&quot; height=&quot;150&quot; fill=&quot;white&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+    &lt;/g&gt;
+  &lt;/defs&gt;
+
+  &lt;use xlink:href=&quot;#circle-in-rect&quot; transform=&quot;translate(10, 10)&quot;&gt;
+    &lt;g clip-path=&quot;url(#clip-circle)&quot;&gt;
+      &lt;!-- center lines --&gt;
+      &lt;path d=&quot;M0 75 L150 75&quot;/&gt;
+      &lt;line x1=&quot;75&quot; y1=&quot;0&quot; x2=&quot;75&quot; y2=&quot;150&quot;/&gt;
+    &lt;/g&gt;
+  &lt;/use&gt;
+  
+  &lt;use xlink:href=&quot;#circle-in-rect&quot; transform=&quot;translate(170, 10)&quot;&gt;
+    &lt;g clip-path=&quot;url(#clip-circle)&quot;&gt;
+      &lt;!-- diagonal lines --&gt;
+      &lt;path d=&quot;M0 0 L150 150&quot;/&gt;
+      &lt;line x1=&quot;0&quot; y1=&quot;150&quot; x2=&quot;150&quot; y2=&quot;0&quot;/&gt;
+    &lt;/g&gt;
+  &lt;/use&gt;
+
+  &lt;use xlink:href=&quot;#circle-in-rect&quot; transform=&quot;translate(330, 10)&quot;&gt;
+    &lt;g clip-path=&quot;url(#clip-circle)&quot;&gt;
+      &lt;!-- top and left lines --&gt;
+      &lt;path d=&quot;M0 50 L150 50&quot;/&gt;
+      &lt;line x1=&quot;50&quot; y1=&quot;0&quot; x2=&quot;50&quot; y2=&quot;150&quot;/&gt;
+      &lt;!-- bottom and right lines --&gt;
+      &lt;path d=&quot;M0 100 L150 100&quot;/&gt;
+      &lt;line x1=&quot;100&quot; y1=&quot;0&quot; x2=&quot;100&quot; y2=&quot;150&quot;/&gt;
+    &lt;/g&gt;
+  &lt;/use&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28LayoutTestssvgclippathclippathlineusebeforedefinedsvg"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/LayoutTests/svg/clip-path/clip-path-line-use-before-defined.svg (0 => 180852)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/LayoutTests/svg/clip-path/clip-path-line-use-before-defined.svg                                (rev 0)
+++ releases/WebKitGTK/webkit-2.8/LayoutTests/svg/clip-path/clip-path-line-use-before-defined.svg        2015-03-01 08:24:55 UTC (rev 180852)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
+  &lt;defs&gt;
+    &lt;style&gt;
+      line, path {
+        stroke: black;
+        stroke-width: 3;
+      }
+    &lt;/style&gt;
+    &lt;g id=&quot;circle-in-rect&quot;&gt;
+      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;150&quot; height=&quot;150&quot; fill=&quot;lime&quot;/&gt;
+      &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;150&quot; height=&quot;150&quot; fill=&quot;white&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+    &lt;/g&gt;
+  &lt;/defs&gt;
+
+  &lt;use xlink:href=&quot;#circle-in-rect&quot; transform=&quot;translate(10, 10)&quot;&gt;
+    &lt;!-- center lines --&gt;
+    &lt;path d=&quot;M0 75 L150 75&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+    &lt;line x1=&quot;75&quot; y1=&quot;0&quot; x2=&quot;75&quot; y2=&quot;150&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+  &lt;/use&gt;
+  
+  &lt;use xlink:href=&quot;#circle-in-rect&quot; transform=&quot;translate(170, 10)&quot;&gt;
+    &lt;!-- diagonal lines --&gt;
+    &lt;path d=&quot;M0 0 L150 150&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+    &lt;line x1=&quot;0&quot; y1=&quot;150&quot; x2=&quot;150&quot; y2=&quot;0&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+  &lt;/use&gt;
+
+  &lt;use xlink:href=&quot;#circle-in-rect&quot; transform=&quot;translate(330, 10)&quot;&gt;
+    &lt;!-- top and left lines --&gt;
+    &lt;path d=&quot;M0 50 L150 50&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+    &lt;line x1=&quot;50&quot; y1=&quot;0&quot; x2=&quot;50&quot; y2=&quot;150&quot; clip-path=&quot;url(#clip-circle)&quot;/&gt;
+    &lt;g clip-path=&quot;url(#clip-circle)&quot;&gt;
+      &lt;!-- bottom and right lines --&gt;
+      &lt;path d=&quot;M0 100 L150 100&quot;/&gt;
+      &lt;line x1=&quot;100&quot; y1=&quot;0&quot; x2=&quot;100&quot; y2=&quot;150&quot;/&gt;
+    &lt;/g&gt;
+  &lt;/use&gt;
+  
+  &lt;defs&gt;
+    &lt;clipPath id=&quot;clip-circle&quot;&gt;
+      &lt;circle cx=&quot;75&quot; cy=&quot;75&quot; r=&quot;75&quot; clip-path=&quot;url(#clip-small-circle)&quot;/&gt;
+    &lt;/clipPath&gt;
+    &lt;clipPath id=&quot;clip-small-circle&quot;&gt;
+      &lt;circle cx=&quot;75&quot; cy=&quot;75&quot; r=&quot;50&quot;/&gt;
+    &lt;/clipPath&gt;
+  &lt;/defs&gt;
+&lt;/svg&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog (180851 => 180852)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog        2015-03-01 08:21:13 UTC (rev 180851)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog        2015-03-01 08:24:55 UTC (rev 180852)
</span><span class="lines">@@ -1,3 +1,65 @@
</span><ins>+2015-02-26  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
+
+        Cleanup RenderSVGResourceClipper class.
+        https://bugs.webkit.org/show_bug.cgi?id=142032.
+
+        Reviewed by Darin Adler.
+        
+        This is a follow up for r180643: &lt;http://trac.webkit.org/changeset/180643&gt;.
+        It includes cleanup for RenderSVGResourceClipper class.
+
+        * rendering/svg/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::applyClippingToContext):
+        (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
+        * rendering/svg/RenderSVGResourceClipper.h: Change ClipperData to be a
+        typedef instead of a class and rename it to ClipperMaskImage. The purpose
+        of having it a class even though it includes only one member was because
+        we wanted it to be WTF_MAKE_FAST_ALLOCATED. We do not need to allocate it
+        as a separate object on the heap anymore.
+        
+        (WebCore::RenderSVGResourceClipper::addRendererToClipper): Instead of doing
+        double hash table lookups by calling HashMap::contains() and then HashMap::get(),
+        we can use HashMap::add() instead.
+
+2015-02-25  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
+
+        Horizontal and vertical lines are clipped completely if clip-path is included in the tag but the referenced element is defined later.
+        https://bugs.webkit.org/show_bug.cgi?id=141776.
+
+        Reviewed by Dean Jackson.
+
+        Tests: svg/clip-path/clip-path-line-use-before-defined-expected.svg
+               svg/clip-path/clip-path-line-use-before-defined.svg
+
+        * rendering/svg/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::applyClippingToContext): Ensure the renderer
+        is added to m_clipper if it does not exist. The same renderer might have been 
+        added to m_clipper in resourceBoundingBox().
+        
+        (WebCore::RenderSVGResourceClipper::addRendererToClipper): Add the renderer to
+        m_clipper if it does not exist. Return the associated ClipperData.
+        
+        (WebCore::RenderSVGResourceClipper::resourceBoundingBox): If the clipper is
+        referenced before it is defined, add the renderer to m_clipper. While doing the
+        layout() for the clipper, we can check if m_clipper has values or not. If it does
+        have, we are going to mark the clipper for client invalidation which is done by
+        the SVG root.
+        
+        * rendering/svg/RenderSVGResourceClipper.h:
+        * rendering/svg/RenderSVGResourceContainer.h:
+        (WebCore::RenderSVGResourceContainer::selfNeedsClientInvalidation): Define a 
+        new function selfNeedsClientInvalidation() which controls marking the clipper 
+        for client invalidation. In RenderSVGResourceClipper, override it so it checks
+        m_clipper to force clients validation even if it the first time we do layout
+        for this clipper.
+
+        * rendering/svg/RenderSVGResourceContainer.cpp:
+        (WebCore::RenderSVGResourceContainer::layout): Call the virtual function
+        selfNeedsClientInvalidation() to check whether we need to mark the clipper for
+        client invalidation.
+        
+        * svg/SVGElement.cpp: Delete unneeded header file.
+
</ins><span class="cx"> 2015-02-25  Beth Dakin  &lt;bdakin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r180018 ): Holding a rubber-band in place can get stuck
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCorerenderingsvgRenderSVGResourceClippercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp (180851 => 180852)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp        2015-03-01 08:21:13 UTC (rev 180851)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp        2015-03-01 08:24:55 UTC (rev 180852)
</span><span class="lines">@@ -130,27 +130,22 @@
</span><span class="cx"> bool RenderSVGResourceClipper::applyClippingToContext(RenderElement&amp; renderer, const FloatRect&amp; objectBoundingBox,
</span><span class="cx">                                                       const FloatRect&amp; repaintRect, GraphicsContext* context)
</span><span class="cx"> {
</span><del>-    bool missingClipperData = !m_clipper.contains(&amp;renderer);
-    if (missingClipperData)
-        m_clipper.set(&amp;renderer, std::make_unique&lt;ClipperData&gt;());
</del><ins>+    ClipperMaskImage&amp; clipperMaskImage = addRendererToClipper(renderer);
+    bool shouldCreateClipperMaskImage = !clipperMaskImage;
</ins><span class="cx"> 
</span><del>-    bool shouldCreateClipData = false;
</del><span class="cx">     AffineTransform animatedLocalTransform = clipPathElement().animatedLocalTransform();
</span><del>-    ClipperData* clipperData = m_clipper.get(&amp;renderer);
-    if (!clipperData-&gt;clipMaskImage) {
-        if (pathOnlyClipping(context, animatedLocalTransform, objectBoundingBox))
-            return true;
-        shouldCreateClipData = true;
-    }
</del><span class="cx"> 
</span><ins>+    if (shouldCreateClipperMaskImage &amp;&amp; pathOnlyClipping(context, animatedLocalTransform, objectBoundingBox))
+        return true;
+
</ins><span class="cx">     AffineTransform absoluteTransform;
</span><span class="cx">     SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem(renderer, absoluteTransform);
</span><span class="cx"> 
</span><del>-    if (shouldCreateClipData &amp;&amp; !repaintRect.isEmpty()) {
-        if (!SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, clipperData-&gt;clipMaskImage, ColorSpaceDeviceRGB, Unaccelerated))
</del><ins>+    if (shouldCreateClipperMaskImage &amp;&amp; !repaintRect.isEmpty()) {
+        if (!SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, clipperMaskImage, ColorSpaceDeviceRGB, Unaccelerated))
</ins><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        GraphicsContext* maskContext = clipperData-&gt;clipMaskImage-&gt;context();
</del><ins>+        GraphicsContext* maskContext = clipperMaskImage-&gt;context();
</ins><span class="cx">         ASSERT(maskContext);
</span><span class="cx"> 
</span><span class="cx">         maskContext-&gt;concatCTM(animatedLocalTransform);
</span><span class="lines">@@ -165,28 +160,27 @@
</span><span class="cx">             if (!clipper-&gt;applyClippingToContext(*this, objectBoundingBox, repaintRect, maskContext))
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><del>-            succeeded = drawContentIntoMaskImage(clipperData, objectBoundingBox);
</del><ins>+            succeeded = drawContentIntoMaskImage(clipperMaskImage, objectBoundingBox);
</ins><span class="cx">             // The context restore applies the clipping on non-CG platforms.
</span><span class="cx">         } else
</span><del>-            succeeded = drawContentIntoMaskImage(clipperData, objectBoundingBox);
</del><ins>+            succeeded = drawContentIntoMaskImage(clipperMaskImage, objectBoundingBox);
</ins><span class="cx"> 
</span><span class="cx">         if (!succeeded)
</span><del>-            clipperData-&gt;clipMaskImage.reset();
</del><ins>+            clipperMaskImage.reset();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!clipperData-&gt;clipMaskImage)
</del><ins>+    if (!clipperMaskImage)
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    SVGRenderingContext::clipToImageBuffer(context, absoluteTransform, repaintRect, clipperData-&gt;clipMaskImage, missingClipperData);
</del><ins>+    SVGRenderingContext::clipToImageBuffer(context, absoluteTransform, repaintRect, clipperMaskImage, shouldCreateClipperMaskImage);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool RenderSVGResourceClipper::drawContentIntoMaskImage(ClipperData* clipperData, const FloatRect&amp; objectBoundingBox)
</del><ins>+bool RenderSVGResourceClipper::drawContentIntoMaskImage(const ClipperMaskImage&amp; clipperMaskImage, const FloatRect&amp; objectBoundingBox)
</ins><span class="cx"> {
</span><del>-    ASSERT(clipperData);
-    ASSERT(clipperData-&gt;clipMaskImage);
</del><ins>+    ASSERT(clipperMaskImage);
</ins><span class="cx"> 
</span><del>-    GraphicsContext* maskContext = clipperData-&gt;clipMaskImage-&gt;context();
</del><ins>+    GraphicsContext* maskContext = clipperMaskImage-&gt;context();
</ins><span class="cx">     ASSERT(maskContext);
</span><span class="cx"> 
</span><span class="cx">     AffineTransform maskContentTransformation;
</span><span class="lines">@@ -237,7 +231,7 @@
</span><span class="cx">         // In the case of a &lt;use&gt; element, we obtained its renderere above, to retrieve its clipRule.
</span><span class="cx">         // We have to pass the &lt;use&gt; renderer itself to renderSubtreeToImageBuffer() to apply it's x/y/transform/etc. values when rendering.
</span><span class="cx">         // So if isUseElement is true, refetch the childNode-&gt;renderer(), as renderer got overriden above.
</span><del>-        SVGRenderingContext::renderSubtreeToImageBuffer(clipperData-&gt;clipMaskImage.get(), isUseElement ? *child.renderer() : *renderer, maskContentTransformation);
</del><ins>+        SVGRenderingContext::renderSubtreeToImageBuffer(clipperMaskImage.get(), isUseElement ? *child.renderer() : *renderer, maskContentTransformation);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     view().frameView().setPaintBehavior(oldBehavior);
</span><span class="lines">@@ -261,6 +255,11 @@
</span><span class="cx">     m_clipBoundaries = clipPathElement().animatedLocalTransform().mapRect(m_clipBoundaries);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ClipperMaskImage&amp; RenderSVGResourceClipper::addRendererToClipper(const RenderObject&amp; object)
+{
+    return m_clipper.add(&amp;object, ClipperMaskImage()).iterator-&gt;value;
+}
+
</ins><span class="cx"> bool RenderSVGResourceClipper::hitTestClipContent(const FloatRect&amp; objectBoundingBox, const FloatPoint&amp; nodeAtPoint)
</span><span class="cx"> {
</span><span class="cx">     FloatPoint point = nodeAtPoint;
</span><span class="lines">@@ -294,8 +293,10 @@
</span><span class="cx"> FloatRect RenderSVGResourceClipper::resourceBoundingBox(const RenderObject&amp; object)
</span><span class="cx"> {
</span><span class="cx">     // Resource was not layouted yet. Give back the boundingBox of the object.
</span><del>-    if (selfNeedsLayout())
</del><ins>+    if (selfNeedsLayout()) {
+        addRendererToClipper(object);
</ins><span class="cx">         return object.objectBoundingBox();
</span><ins>+    }
</ins><span class="cx">     
</span><span class="cx">     if (m_clipBoundaries.isEmpty())
</span><span class="cx">         calculateClipContentRepaintRect();
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCorerenderingsvgRenderSVGResourceClipperh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h (180851 => 180852)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h        2015-03-01 08:21:13 UTC (rev 180851)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h        2015-03-01 08:24:55 UTC (rev 180852)
</span><span class="lines">@@ -31,11 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-struct ClipperData {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    std::unique_ptr&lt;ImageBuffer&gt; clipMaskImage;
-};
</del><ins>+typedef std::unique_ptr&lt;ImageBuffer&gt; ClipperMaskImage;
</ins><span class="cx"> 
</span><span class="cx"> class RenderSVGResourceClipper final : public RenderSVGResourceContainer {
</span><span class="cx"> public:
</span><span class="lines">@@ -60,17 +56,21 @@
</span><span class="cx"> 
</span><span class="cx">     SVGUnitTypes::SVGUnitType clipPathUnits() const { return clipPathElement().clipPathUnits(); }
</span><span class="cx"> 
</span><ins>+protected:
+    virtual bool selfNeedsClientInvalidation() const override { return (everHadLayout() || m_clipper.size()) &amp;&amp; selfNeedsLayout(); }
+
</ins><span class="cx"> private:
</span><span class="cx">     void element() const = delete;
</span><span class="cx"> 
</span><span class="cx">     virtual const char* renderName() const override { return &quot;RenderSVGResourceClipper&quot;; }
</span><span class="cx"> 
</span><span class="cx">     bool pathOnlyClipping(GraphicsContext*, const AffineTransform&amp;, const FloatRect&amp;);
</span><del>-    bool drawContentIntoMaskImage(ClipperData*, const FloatRect&amp; objectBoundingBox);
</del><ins>+    bool drawContentIntoMaskImage(const ClipperMaskImage&amp;, const FloatRect&amp; objectBoundingBox);
</ins><span class="cx">     void calculateClipContentRepaintRect();
</span><ins>+    ClipperMaskImage&amp; addRendererToClipper(const RenderObject&amp;);
</ins><span class="cx"> 
</span><span class="cx">     FloatRect m_clipBoundaries;
</span><del>-    HashMap&lt;RenderObject*, std::unique_ptr&lt;ClipperData&gt;&gt; m_clipper;
</del><ins>+    HashMap&lt;const RenderObject*, ClipperMaskImage&gt; m_clipper;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCorerenderingsvgRenderSVGResourceContainercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp (180851 => 180852)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp        2015-03-01 08:21:13 UTC (rev 180851)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceContainer.cpp        2015-03-01 08:24:55 UTC (rev 180852)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> {
</span><span class="cx">     StackStats::LayoutCheckPoint layoutCheckPoint;
</span><span class="cx">     // Invalidate all resources if our layout changed.
</span><del>-    if (everHadLayout() &amp;&amp; selfNeedsLayout())
</del><ins>+    if (selfNeedsClientInvalidation())
</ins><span class="cx">         RenderSVGRoot::addResourceForClientInvalidation(this);
</span><span class="cx"> 
</span><span class="cx">     RenderSVGHiddenContainer::layout();
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCorerenderingsvgRenderSVGResourceContainerh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceContainer.h (180851 => 180852)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceContainer.h        2015-03-01 08:21:13 UTC (rev 180851)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/rendering/svg/RenderSVGResourceContainer.h        2015-03-01 08:24:55 UTC (rev 180852)
</span><span class="lines">@@ -55,6 +55,8 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     // Used from the invalidateClient/invalidateClients methods from classes, inheriting from us.
</span><ins>+    virtual bool selfNeedsClientInvalidation() const { return everHadLayout() &amp;&amp; selfNeedsLayout(); }
+
</ins><span class="cx">     void markAllClientsForInvalidation(InvalidationMode);
</span><span class="cx">     void markAllClientLayersForInvalidation();
</span><span class="cx">     void markClientForInvalidation(RenderObject&amp;, InvalidationMode);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCoresvgSVGElementcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/svg/SVGElement.cpp (180851 => 180852)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/svg/SVGElement.cpp        2015-03-01 08:21:13 UTC (rev 180851)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/svg/SVGElement.cpp        2015-03-01 08:24:55 UTC (rev 180852)
</span><span class="lines">@@ -39,7 +39,6 @@
</span><span class="cx"> #include &quot;HTMLParserIdioms.h&quot;
</span><span class="cx"> #include &quot;RenderObject.h&quot;
</span><span class="cx"> #include &quot;RenderSVGResource.h&quot;
</span><del>-#include &quot;RenderSVGResourceClipper.h&quot;
</del><span class="cx"> #include &quot;RenderSVGResourceFilter.h&quot;
</span><span class="cx"> #include &quot;RenderSVGResourceMasker.h&quot;
</span><span class="cx"> #include &quot;SVGCursorElement.h&quot;
</span></span></pre>
</div>
</div>

</body>
</html>