<!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 <clipPath>. The <clipPath>
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 <sabouhallawa@apple.com>
+
+ 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 <sabouhallawa@apple.com>
+
+ 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 <clipPath>. The <clipPath>
+ 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 <jdiggs@igalia.com>
</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>+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs>
+ <style>
+ line, path {
+ stroke: black;
+ stroke-width: 3;
+ }
+ </style>
+ <clipPath id="clip-circle">
+ <circle cx="75" cy="75" r="50"/>
+ </clipPath>
+ <g id="circle-in-rect">
+ <rect x="0" y="0" width="150" height="150" fill="lime"/>
+ <rect x="0" y="0" width="150" height="150" fill="white" clip-path="url(#clip-circle)"/>
+ </g>
+ </defs>
+
+ <use xlink:href="#circle-in-rect" transform="translate(10, 10)">
+ <g clip-path="url(#clip-circle)">
+ <!-- center lines -->
+ <path d="M0 75 L150 75"/>
+ <line x1="75" y1="0" x2="75" y2="150"/>
+ </g>
+ </use>
+
+ <use xlink:href="#circle-in-rect" transform="translate(170, 10)">
+ <g clip-path="url(#clip-circle)">
+ <!-- diagonal lines -->
+ <path d="M0 0 L150 150"/>
+ <line x1="0" y1="150" x2="150" y2="0"/>
+ </g>
+ </use>
+
+ <use xlink:href="#circle-in-rect" transform="translate(330, 10)">
+ <g clip-path="url(#clip-circle)">
+ <!-- top and left lines -->
+ <path d="M0 50 L150 50"/>
+ <line x1="50" y1="0" x2="50" y2="150"/>
+ <!-- bottom and right lines -->
+ <path d="M0 100 L150 100"/>
+ <line x1="100" y1="0" x2="100" y2="150"/>
+ </g>
+ </use>
+</svg>
</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>+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs>
+ <style>
+ line, path {
+ stroke: black;
+ stroke-width: 3;
+ }
+ </style>
+ <g id="circle-in-rect">
+ <rect x="0" y="0" width="150" height="150" fill="lime"/>
+ <rect x="0" y="0" width="150" height="150" fill="white" clip-path="url(#clip-circle)"/>
+ </g>
+ </defs>
+
+ <use xlink:href="#circle-in-rect" transform="translate(10, 10)">
+ <!-- center lines -->
+ <path d="M0 75 L150 75" clip-path="url(#clip-circle)"/>
+ <line x1="75" y1="0" x2="75" y2="150" clip-path="url(#clip-circle)"/>
+ </use>
+
+ <use xlink:href="#circle-in-rect" transform="translate(170, 10)">
+ <!-- diagonal lines -->
+ <path d="M0 0 L150 150" clip-path="url(#clip-circle)"/>
+ <line x1="0" y1="150" x2="150" y2="0" clip-path="url(#clip-circle)"/>
+ </use>
+
+ <use xlink:href="#circle-in-rect" transform="translate(330, 10)">
+ <!-- top and left lines -->
+ <path d="M0 50 L150 50" clip-path="url(#clip-circle)"/>
+ <line x1="50" y1="0" x2="50" y2="150" clip-path="url(#clip-circle)"/>
+ <g clip-path="url(#clip-circle)">
+ <!-- bottom and right lines -->
+ <path d="M0 100 L150 100"/>
+ <line x1="100" y1="0" x2="100" y2="150"/>
+ </g>
+ </use>
+
+ <defs>
+ <clipPath id="clip-circle">
+ <circle cx="75" cy="75" r="75" clip-path="url(#clip-small-circle)"/>
+ </clipPath>
+ <clipPath id="clip-small-circle">
+ <circle cx="75" cy="75" r="50"/>
+ </clipPath>
+ </defs>
+</svg>
</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 <sabouhallawa@apple.com>
+
+ Cleanup RenderSVGResourceClipper class.
+ https://bugs.webkit.org/show_bug.cgi?id=142032.
+
+ Reviewed by Darin Adler.
+
+ This is a follow up for r180643: <http://trac.webkit.org/changeset/180643>.
+ 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 <sabouhallawa@apple.com>
+
+ 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 <bdakin@apple.com>
</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& renderer, const FloatRect& objectBoundingBox,
</span><span class="cx"> const FloatRect& repaintRect, GraphicsContext* context)
</span><span class="cx"> {
</span><del>- bool missingClipperData = !m_clipper.contains(&renderer);
- if (missingClipperData)
- m_clipper.set(&renderer, std::make_unique<ClipperData>());
</del><ins>+ ClipperMaskImage& 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(&renderer);
- if (!clipperData->clipMaskImage) {
- if (pathOnlyClipping(context, animatedLocalTransform, objectBoundingBox))
- return true;
- shouldCreateClipData = true;
- }
</del><span class="cx">
</span><ins>+ if (shouldCreateClipperMaskImage && 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 && !repaintRect.isEmpty()) {
- if (!SVGRenderingContext::createImageBuffer(repaintRect, absoluteTransform, clipperData->clipMaskImage, ColorSpaceDeviceRGB, Unaccelerated))
</del><ins>+ if (shouldCreateClipperMaskImage && !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->clipMaskImage->context();
</del><ins>+ GraphicsContext* maskContext = clipperMaskImage->context();
</ins><span class="cx"> ASSERT(maskContext);
</span><span class="cx">
</span><span class="cx"> maskContext->concatCTM(animatedLocalTransform);
</span><span class="lines">@@ -165,28 +160,27 @@
</span><span class="cx"> if (!clipper->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->clipMaskImage.reset();
</del><ins>+ clipperMaskImage.reset();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if (!clipperData->clipMaskImage)
</del><ins>+ if (!clipperMaskImage)
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- SVGRenderingContext::clipToImageBuffer(context, absoluteTransform, repaintRect, clipperData->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& objectBoundingBox)
</del><ins>+bool RenderSVGResourceClipper::drawContentIntoMaskImage(const ClipperMaskImage& clipperMaskImage, const FloatRect& objectBoundingBox)
</ins><span class="cx"> {
</span><del>- ASSERT(clipperData);
- ASSERT(clipperData->clipMaskImage);
</del><ins>+ ASSERT(clipperMaskImage);
</ins><span class="cx">
</span><del>- GraphicsContext* maskContext = clipperData->clipMaskImage->context();
</del><ins>+ GraphicsContext* maskContext = clipperMaskImage->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 <use> element, we obtained its renderere above, to retrieve its clipRule.
</span><span class="cx"> // We have to pass the <use> 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->renderer(), as renderer got overriden above.
</span><del>- SVGRenderingContext::renderSubtreeToImageBuffer(clipperData->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& RenderSVGResourceClipper::addRendererToClipper(const RenderObject& object)
+{
+ return m_clipper.add(&object, ClipperMaskImage()).iterator->value;
+}
+
</ins><span class="cx"> bool RenderSVGResourceClipper::hitTestClipContent(const FloatRect& objectBoundingBox, const FloatPoint& 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& 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<ImageBuffer> clipMaskImage;
-};
</del><ins>+typedef std::unique_ptr<ImageBuffer> 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()) && 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 "RenderSVGResourceClipper"; }
</span><span class="cx">
</span><span class="cx"> bool pathOnlyClipping(GraphicsContext*, const AffineTransform&, const FloatRect&);
</span><del>- bool drawContentIntoMaskImage(ClipperData*, const FloatRect& objectBoundingBox);
</del><ins>+ bool drawContentIntoMaskImage(const ClipperMaskImage&, const FloatRect& objectBoundingBox);
</ins><span class="cx"> void calculateClipContentRepaintRect();
</span><ins>+ ClipperMaskImage& addRendererToClipper(const RenderObject&);
</ins><span class="cx">
</span><span class="cx"> FloatRect m_clipBoundaries;
</span><del>- HashMap<RenderObject*, std::unique_ptr<ClipperData>> m_clipper;
</del><ins>+ HashMap<const RenderObject*, ClipperMaskImage> 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() && 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() && selfNeedsLayout(); }
+
</ins><span class="cx"> void markAllClientsForInvalidation(InvalidationMode);
</span><span class="cx"> void markAllClientLayersForInvalidation();
</span><span class="cx"> void markClientForInvalidation(RenderObject&, 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 "HTMLParserIdioms.h"
</span><span class="cx"> #include "RenderObject.h"
</span><span class="cx"> #include "RenderSVGResource.h"
</span><del>-#include "RenderSVGResourceClipper.h"
</del><span class="cx"> #include "RenderSVGResourceFilter.h"
</span><span class="cx"> #include "RenderSVGResourceMasker.h"
</span><span class="cx"> #include "SVGCursorElement.h"
</span></span></pre>
</div>
</div>
</body>
</html>