<!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>[195662] releases/WebKitGTK/webkit-2.10</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/195662">195662</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-01-27 04:28:26 -0800 (Wed, 27 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/195397">r195397</a> - http://victordarras.fr/cssgame/ doesn't work in Safari.
https://bugs.webkit.org/show_bug.cgi?id=153285
&lt;rdar://problem/24212369&gt;

Reviewed by Tim Horton.

This patch adds support for hittesting ClipPathOperation::Reference.

Source/WebCore:

Tests: svg/clip-path/hittest-clip-path-reference-miss.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::nodeAtPoint):
* rendering/RenderObject.h:
(WebCore::RenderObject::isSVGResourceClipper):
* rendering/svg/RenderSVGResourceClipper.h:
(isType):

LayoutTests:

* svg/clip-path/hittest-clip-path-reference-miss-expected.html: Added.
* svg/clip-path/hittest-clip-path-reference-miss.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCorerenderingRenderBlockcpp">releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderBlock.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCorerenderingRenderObjecth">releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderObject.h</a></li>
<li><a href="#releasesWebKitGTKwebkit210SourceWebCorerenderingsvgRenderSVGResourceClipperh">releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestssvgclippathhittestclippathreferencemissexpectedhtml">releases/WebKitGTK/webkit-2.10/LayoutTests/svg/clip-path/hittest-clip-path-reference-miss-expected.html</a></li>
<li><a href="#releasesWebKitGTKwebkit210LayoutTestssvgclippathhittestclippathreferencemisshtml">releases/WebKitGTK/webkit-2.10/LayoutTests/svg/clip-path/hittest-clip-path-reference-miss.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit210LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog (195661 => 195662)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog        2016-01-27 10:32:59 UTC (rev 195661)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/ChangeLog        2016-01-27 12:28:26 UTC (rev 195662)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-01-20  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        http://victordarras.fr/cssgame/ doesn't work in Safari.
+        https://bugs.webkit.org/show_bug.cgi?id=153285
+        &lt;rdar://problem/24212369&gt;
+
+        Reviewed by Tim Horton.
+
+        This patch adds support for hittesting ClipPathOperation::Reference.
+
+        * svg/clip-path/hittest-clip-path-reference-miss-expected.html: Added.
+        * svg/clip-path/hittest-clip-path-reference-miss.html: Added.
+
</ins><span class="cx"> 2016-01-15  Jiewen Tan  &lt;jiewen_tan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         FrameLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame() is never called when loading a main resource from the memory cache
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestssvgclippathhittestclippathreferencemissexpectedhtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/svg/clip-path/hittest-clip-path-reference-miss-expected.html (0 => 195662)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/svg/clip-path/hittest-clip-path-reference-miss-expected.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/svg/clip-path/hittest-clip-path-reference-miss-expected.html        2016-01-27 12:28:26 UTC (rev 195662)
</span><span class="lines">@@ -0,0 +1,19 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;This tests that we properly hittest boxes with reference clip path.&lt;/title&gt;
+&lt;style&gt;
+div {
+  position: absolute;
+  top: 0px;
+  left: 0px;
+  width: 200px;
+  height: 200px;
+  background: green;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210LayoutTestssvgclippathhittestclippathreferencemisshtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.10/LayoutTests/svg/clip-path/hittest-clip-path-reference-miss.html (0 => 195662)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/LayoutTests/svg/clip-path/hittest-clip-path-reference-miss.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.10/LayoutTests/svg/clip-path/hittest-clip-path-reference-miss.html        2016-01-27 12:28:26 UTC (rev 195662)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;title&gt;This tests that we properly hittest boxes with reference clip path.&lt;/title&gt;
+&lt;style&gt;
+svg { 
+  position: absolute;
+  top: -10000px;
+  left: -10000px;
+}
+
+div {
+  width: 200px;
+  height: 200px;
+  background: green;
+}
+
+.greenbox {
+  position: absolute;
+  left: 0px;
+  top: 0px;
+  z-index: -1;
+}
+
+.clipbox {
+  -webkit-clip-path: url('#svgreference');
+}
+
+.clipbox:hover ~ .greenbox
+{
+  background: blue;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;svg width=&quot;200px&quot; height=&quot;200px&quot; viewBox=&quot;0 0 200 200&quot; version=&quot;1.1&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
+  &lt;clippath id=svgreference&gt;&lt;path d=&quot;M50 50 L150 50 L150 150 L50 150 Z&quot;&gt;&lt;/path&gt;&lt;/clippath&gt;
+&lt;/svg&gt;
+&lt;div id=hittestthis class=clipbox&gt;&lt;/div&gt;
+&lt;div class=greenbox&gt;&lt;/div&gt;
+&lt;script&gt;
+  if (window.eventSender)
+    eventSender.mouseMoveTo(10, 10);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog (195661 => 195662)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog        2016-01-27 10:32:59 UTC (rev 195661)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/ChangeLog        2016-01-27 12:28:26 UTC (rev 195662)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-01-20  Zalan Bujtas  &lt;zalan@apple.com&gt;
+
+        http://victordarras.fr/cssgame/ doesn't work in Safari.
+        https://bugs.webkit.org/show_bug.cgi?id=153285
+        &lt;rdar://problem/24212369&gt;
+
+        Reviewed by Tim Horton.
+
+        This patch adds support for hittesting ClipPathOperation::Reference.
+
+        Tests: svg/clip-path/hittest-clip-path-reference-miss.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::nodeAtPoint):
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::isSVGResourceClipper):
+        * rendering/svg/RenderSVGResourceClipper.h:
+        (isType):
+
</ins><span class="cx"> 2016-01-19  Konstantin Tokarev  &lt;annulen@yandex.ru&gt;
</span><span class="cx"> 
</span><span class="cx">         Fixed compilation of AXObjectCache in case of !HAVE(ACCESSIBILITY).
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCorerenderingRenderBlockcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderBlock.cpp (195661 => 195662)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderBlock.cpp        2016-01-27 10:32:59 UTC (rev 195661)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderBlock.cpp        2016-01-27 12:28:26 UTC (rev 195662)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx"> #include &quot;RenderNamedFlowFragment.h&quot;
</span><span class="cx"> #include &quot;RenderNamedFlowThread.h&quot;
</span><span class="cx"> #include &quot;RenderRegion.h&quot;
</span><ins>+#include &quot;RenderSVGResourceClipper.h&quot;
</ins><span class="cx"> #include &quot;RenderTableCell.h&quot;
</span><span class="cx"> #include &quot;RenderTextFragment.h&quot;
</span><span class="cx"> #include &quot;RenderTheme.h&quot;
</span><span class="lines">@@ -2460,8 +2461,18 @@
</span><span class="cx">                 return false;
</span><span class="cx">             break;
</span><span class="cx">         }
</span><del>-        // FIXME: handle Reference/Box
-        case ClipPathOperation::Reference:
</del><ins>+        case ClipPathOperation::Reference: {
+            const auto&amp; referenceClipPathOperation = downcast&lt;ReferenceClipPathOperation&gt;(*style().clipPath());
+            auto* element = document().getElementById(referenceClipPathOperation.fragment());
+            if (!element || !element-&gt;renderer())
+                break;
+            if (!is&lt;SVGClipPathElement&gt;(*element))
+                break;
+            auto&amp; clipper = downcast&lt;RenderSVGResourceClipper&gt;(*element-&gt;renderer());
+            if (!clipper.hitTestClipContent(FloatRect(borderBoxRect()), FloatPoint(locationInContainer.point() - localOffset)))
+                return false;
+            break;
+        }
</ins><span class="cx">         case ClipPathOperation::Box:
</span><span class="cx">             break;
</span><span class="cx">         }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCorerenderingRenderObjecth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderObject.h (195661 => 195662)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderObject.h        2016-01-27 10:32:59 UTC (rev 195661)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/RenderObject.h        2016-01-27 12:28:26 UTC (rev 195662)
</span><span class="lines">@@ -437,6 +437,7 @@
</span><span class="cx">     virtual bool isSVGForeignObject() const { return false; }
</span><span class="cx">     virtual bool isSVGResourceContainer() const { return false; }
</span><span class="cx">     virtual bool isSVGResourceFilter() const { return false; }
</span><ins>+    virtual bool isSVGResourceClipper() const { return false; }
</ins><span class="cx">     virtual bool isSVGResourceFilterPrimitive() const { return false; }
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Those belong into a SVG specific base-class for all renderers (see above)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit210SourceWebCorerenderingsvgRenderSVGResourceClipperh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h (195661 => 195662)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h        2016-01-27 10:32:59 UTC (rev 195661)
+++ releases/WebKitGTK/webkit-2.10/Source/WebCore/rendering/svg/RenderSVGResourceClipper.h        2016-01-27 12:28:26 UTC (rev 195662)
</span><span class="lines">@@ -63,6 +63,7 @@
</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><ins>+    bool isSVGResourceClipper() const override { return true; }
</ins><span class="cx"> 
</span><span class="cx">     bool pathOnlyClipping(GraphicsContext*, const AffineTransform&amp;, const FloatRect&amp;);
</span><span class="cx">     bool drawContentIntoMaskImage(const ClipperMaskImage&amp;, const FloatRect&amp; objectBoundingBox);
</span><span class="lines">@@ -75,6 +76,9 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-SPECIALIZE_TYPE_TRAITS_RENDER_SVG_RESOURCE(RenderSVGResourceClipper, ClipperResourceType)
</del><ins>+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::RenderSVGResourceClipper)
+static bool isType(const WebCore::RenderObject&amp; renderer) { return renderer.isSVGResourceClipper(); }
+static bool isType(const WebCore::RenderSVGResource&amp; resource) { return resource.resourceType() == WebCore::ClipperResourceType; }
+SPECIALIZE_TYPE_TRAITS_END()
</ins><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>