<!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>[161669] 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/161669">161669</a></dd>
<dt>Author</dt> <dd>krit@webkit.org</dd>
<dt>Date</dt> <dd>2014-01-10 13:29:59 -0800 (Fri, 10 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Make clipping path from basic-shapes relative to <box> value
https://bugs.webkit.org/show_bug.cgi?id=126206
Reviewed by Simon Fraser.
Source/WebCore:
Tests: css3/masking/clip-path-circle-border-box.html
css3/masking/clip-path-circle-bounding-box.html
css3/masking/clip-path-circle-content-box.html
css3/masking/clip-path-circle-margin-box.html
css3/masking/clip-path-circle-padding-box.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setupClipPath): Add switch to differ between boxes
and use different reference boxes to size the clipping path.
LayoutTests:
Add new tests to check that different reference boxes are chosen for sizing and
positioning the clipping path.
* css3/masking/clip-path-circle-border-box.html: Added.
* css3/masking/clip-path-circle-bounding-box.html: Added.
* css3/masking/clip-path-circle-content-box.html: Added.
* css3/masking/clip-path-circle-margin-box.html: Added.
* css3/masking/clip-path-circle-padding-box.html: Added.
* platform/mac/css3/masking/clip-path-circle-border-box-expected.png: Added.
* platform/mac/css3/masking/clip-path-circle-border-box-expected.txt: Added.
* platform/mac/css3/masking/clip-path-circle-bounding-box-expected.png: Added.
* platform/mac/css3/masking/clip-path-circle-bounding-box-expected.txt: Added.
* platform/mac/css3/masking/clip-path-circle-content-box-expected.png: Added.
* platform/mac/css3/masking/clip-path-circle-content-box-expected.txt: Added.
* platform/mac/css3/masking/clip-path-circle-margin-box-expected.png: Added.
* platform/mac/css3/masking/clip-path-circle-margin-box-expected.txt: Added.
* platform/mac/css3/masking/clip-path-circle-padding-box-expected.png: Added.
* platform/mac/css3/masking/clip-path-circle-padding-box-expected.txt: Added.
* platform/mac/css3/masking/mask-luminance-png-expected.png: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingClipPathOperationh">trunk/Source/WebCore/rendering/ClipPathOperation.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscss3maskingclippathcircleborderboxhtml">trunk/LayoutTests/css3/masking/clip-path-circle-border-box.html</a></li>
<li><a href="#trunkLayoutTestscss3maskingclippathcircleboundingboxhtml">trunk/LayoutTests/css3/masking/clip-path-circle-bounding-box.html</a></li>
<li><a href="#trunkLayoutTestscss3maskingclippathcirclecontentboxhtml">trunk/LayoutTests/css3/masking/clip-path-circle-content-box.html</a></li>
<li><a href="#trunkLayoutTestscss3maskingclippathcirclemarginboxhtml">trunk/LayoutTests/css3/masking/clip-path-circle-margin-box.html</a></li>
<li><a href="#trunkLayoutTestscss3maskingclippathcirclepaddingboxhtml">trunk/LayoutTests/css3/masking/clip-path-circle-padding-box.html</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3maskingclippathcircleborderboxexpectedpng">trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-border-box-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3maskingclippathcircleborderboxexpectedtxt">trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-border-box-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3maskingclippathcircleboundingboxexpectedpng">trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-bounding-box-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3maskingclippathcircleboundingboxexpectedtxt">trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-bounding-box-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3maskingclippathcirclecontentboxexpectedpng">trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-content-box-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3maskingclippathcirclecontentboxexpectedtxt">trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-content-box-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3maskingclippathcirclemarginboxexpectedpng">trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-margin-box-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3maskingclippathcirclemarginboxexpectedtxt">trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-margin-box-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3maskingclippathcirclepaddingboxexpectedpng">trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-padding-box-expected.png</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3maskingclippathcirclepaddingboxexpectedtxt">trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-padding-box-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmaccss3maskingmaskluminancepngexpectedpng">trunk/LayoutTests/platform/mac/css3/masking/mask-luminance-png-expected.png</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (161668 => 161669)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-01-10 21:22:18 UTC (rev 161668)
+++ trunk/LayoutTests/ChangeLog        2014-01-10 21:29:59 UTC (rev 161669)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2014-01-10 Dirk Schulze <krit@webkit.org>
+
+ Make clipping path from basic-shapes relative to <box> value
+ https://bugs.webkit.org/show_bug.cgi?id=126206
+
+ Reviewed by Simon Fraser.
+
+ Add new tests to check that different reference boxes are chosen for sizing and
+ positioning the clipping path.
+
+ * css3/masking/clip-path-circle-border-box.html: Added.
+ * css3/masking/clip-path-circle-bounding-box.html: Added.
+ * css3/masking/clip-path-circle-content-box.html: Added.
+ * css3/masking/clip-path-circle-margin-box.html: Added.
+ * css3/masking/clip-path-circle-padding-box.html: Added.
+ * platform/mac/css3/masking/clip-path-circle-border-box-expected.png: Added.
+ * platform/mac/css3/masking/clip-path-circle-border-box-expected.txt: Added.
+ * platform/mac/css3/masking/clip-path-circle-bounding-box-expected.png: Added.
+ * platform/mac/css3/masking/clip-path-circle-bounding-box-expected.txt: Added.
+ * platform/mac/css3/masking/clip-path-circle-content-box-expected.png: Added.
+ * platform/mac/css3/masking/clip-path-circle-content-box-expected.txt: Added.
+ * platform/mac/css3/masking/clip-path-circle-margin-box-expected.png: Added.
+ * platform/mac/css3/masking/clip-path-circle-margin-box-expected.txt: Added.
+ * platform/mac/css3/masking/clip-path-circle-padding-box-expected.png: Added.
+ * platform/mac/css3/masking/clip-path-circle-padding-box-expected.txt: Added.
+ * platform/mac/css3/masking/mask-luminance-png-expected.png: Added.
+
</ins><span class="cx"> 2014-01-10 Youenn Fablet <youennf@gmail.com>
</span><span class="cx">
</span><span class="cx"> Correctly set XHR loadend event attributes (loaded and total).
</span></span></pre></div>
<a id="trunkLayoutTestscss3maskingclippathcircleborderboxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/masking/clip-path-circle-border-box.html (0 => 161669)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/masking/clip-path-circle-border-box.html         (rev 0)
+++ trunk/LayoutTests/css3/masking/clip-path-circle-border-box.html        2014-01-10 21:29:59 UTC (rev 161669)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+<!DOCTYPE html>
+<html lang="en">
+<head>
+<style>
+#content {
+ width: 200px;
+ height: 200px;
+ margin: 0;
+ padding: 0;
+ background-color: green;
+}
+#clip {
+ width: 200px;
+ height: 200px;
+        margin: 10px;
+        padding: 10px;
+        border: 10px solid blue;
+ -webkit-clip-path: circle(50% at 50% 50%) border-box;
+ background-color: yellow;
+}
+</style>
+</head>
+<body>
+<div id="clip">
+        <div id="content"></div>
+</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscss3maskingclippathcircleboundingboxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/masking/clip-path-circle-bounding-box.html (0 => 161669)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/masking/clip-path-circle-bounding-box.html         (rev 0)
+++ trunk/LayoutTests/css3/masking/clip-path-circle-bounding-box.html        2014-01-10 21:29:59 UTC (rev 161669)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+<!DOCTYPE html>
+<html lang="en">
+<head>
+<style>
+#content {
+ width: 200px;
+ height: 200px;
+ margin: 0;
+ padding: 0;
+ background-color: green;
+}
+#clip {
+ width: 200px;
+ height: 200px;
+        margin: 10px;
+        padding: 10px;
+        border: 10px solid blue;
+ -webkit-clip-path: circle(50% at 50% 50%) bounding-box;
+ background-color: yellow;
+}
+</style>
+</head>
+<body>
+<div id="clip">
+        <div id="content"></div>
+</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscss3maskingclippathcirclecontentboxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/masking/clip-path-circle-content-box.html (0 => 161669)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/masking/clip-path-circle-content-box.html         (rev 0)
+++ trunk/LayoutTests/css3/masking/clip-path-circle-content-box.html        2014-01-10 21:29:59 UTC (rev 161669)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+<!DOCTYPE html>
+<html lang="en">
+<head>
+<style>
+#content {
+ width: 200px;
+ height: 200px;
+ margin: 0;
+ padding: 0;
+ background-color: green;
+}
+#clip {
+ width: 200px;
+ height: 200px;
+        border: 10px solid blue;
+ -webkit-clip-path: circle(50% at 50% 50%) content-box;
+ background-color: yellow;
+}
+</style>
+</head>
+<body>
+<div id="clip">
+        <div id="content"></div>
+</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscss3maskingclippathcirclemarginboxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/masking/clip-path-circle-margin-box.html (0 => 161669)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/masking/clip-path-circle-margin-box.html         (rev 0)
+++ trunk/LayoutTests/css3/masking/clip-path-circle-margin-box.html        2014-01-10 21:29:59 UTC (rev 161669)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+<!DOCTYPE html>
+<html lang="en">
+<head>
+<style>
+#content {
+ width: 200px;
+ height: 200px;
+ margin: 0;
+ padding: 0;
+ background-color: green;
+}
+#clip {
+ width: 200px;
+ height: 200px;
+        margin: 10px;
+        padding: 10px;
+        border: 10px solid blue;
+ -webkit-clip-path: circle(50% at 50% 50%) margin-box;
+ background-color: yellow;
+}
+</style>
+</head>
+<body>
+<div id="clip">
+        <div id="content"></div>
+</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscss3maskingclippathcirclepaddingboxhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/masking/clip-path-circle-padding-box.html (0 => 161669)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/masking/clip-path-circle-padding-box.html         (rev 0)
+++ trunk/LayoutTests/css3/masking/clip-path-circle-padding-box.html        2014-01-10 21:29:59 UTC (rev 161669)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+<!DOCTYPE html>
+<html lang="en">
+<head>
+<style>
+#content {
+ width: 200px;
+ height: 200px;
+ margin: 0;
+ padding: 0;
+ background-color: green;
+}
+#clip {
+ width: 200px;
+ height: 200px;
+        margin: 10px;
+        padding: 10px;
+        border: 10px solid blue;
+ -webkit-clip-path: circle(50% at 50% 50%) padding-box;
+ background-color: yellow;
+}
+</style>
+</head>
+<body>
+<div id="clip">
+        <div id="content"></div>
+</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3maskingclippathcircleborderboxexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-border-box-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-border-box-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformmaccss3maskingclippathcircleborderboxexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-border-box-expected.txt (0 => 161669)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-border-box-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-border-box-expected.txt        2014-01-10 21:29:59 UTC (rev 161669)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x260
+ RenderBlock {HTML} at (0,0) size 800x260
+ RenderBody {BODY} at (8,10) size 784x240
+layer at (18,10) size 240x240
+ RenderBlock {DIV} at (10,0) size 240x240 [bgcolor=#FFFF00] [border: (10px solid #0000FF)]
+ RenderBlock {DIV} at (20,20) size 200x200 [bgcolor=#008000]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3maskingclippathcircleboundingboxexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-bounding-box-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-bounding-box-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformmaccss3maskingclippathcircleboundingboxexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-bounding-box-expected.txt (0 => 161669)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-bounding-box-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-bounding-box-expected.txt        2014-01-10 21:29:59 UTC (rev 161669)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x260
+ RenderBlock {HTML} at (0,0) size 800x260
+ RenderBody {BODY} at (8,10) size 784x240
+layer at (18,10) size 240x240
+ RenderBlock {DIV} at (10,0) size 240x240 [bgcolor=#FFFF00] [border: (10px solid #0000FF)]
+ RenderBlock {DIV} at (20,20) size 200x200 [bgcolor=#008000]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3maskingclippathcirclecontentboxexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-content-box-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-content-box-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformmaccss3maskingclippathcirclecontentboxexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-content-box-expected.txt (0 => 161669)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-content-box-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-content-box-expected.txt        2014-01-10 21:29:59 UTC (rev 161669)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x236
+ RenderBlock {HTML} at (0,0) size 800x236
+ RenderBody {BODY} at (8,8) size 784x220
+layer at (8,8) size 220x220
+ RenderBlock {DIV} at (0,0) size 220x220 [bgcolor=#FFFF00] [border: (10px solid #0000FF)]
+ RenderBlock {DIV} at (10,10) size 200x200 [bgcolor=#008000]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3maskingclippathcirclemarginboxexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-margin-box-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-margin-box-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformmaccss3maskingclippathcirclemarginboxexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-margin-box-expected.txt (0 => 161669)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-margin-box-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-margin-box-expected.txt        2014-01-10 21:29:59 UTC (rev 161669)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x260
+ RenderBlock {HTML} at (0,0) size 800x260
+ RenderBody {BODY} at (8,10) size 784x240
+layer at (18,10) size 240x240
+ RenderBlock {DIV} at (10,0) size 240x240 [bgcolor=#FFFF00] [border: (10px solid #0000FF)]
+ RenderBlock {DIV} at (20,20) size 200x200 [bgcolor=#008000]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3maskingclippathcirclepaddingboxexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-padding-box-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-padding-box-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsplatformmaccss3maskingclippathcirclepaddingboxexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-padding-box-expected.txt (0 => 161669)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-padding-box-expected.txt         (rev 0)
+++ trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-padding-box-expected.txt        2014-01-10 21:29:59 UTC (rev 161669)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x260
+ RenderBlock {HTML} at (0,0) size 800x260
+ RenderBody {BODY} at (8,10) size 784x240
+layer at (18,10) size 240x240
+ RenderBlock {DIV} at (10,0) size 240x240 [bgcolor=#FFFF00] [border: (10px solid #0000FF)]
+ RenderBlock {DIV} at (20,20) size 200x200 [bgcolor=#008000]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3maskingmaskluminancepngexpectedpng"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/platform/mac/css3/masking/mask-luminance-png-expected.png</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/platform/mac/css3/masking/mask-luminance-png-expected.png
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161668 => 161669)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-10 21:22:18 UTC (rev 161668)
+++ trunk/Source/WebCore/ChangeLog        2014-01-10 21:29:59 UTC (rev 161669)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2014-01-10 Dirk Schulze <krit@webkit.org>
+
+ Make clipping path from basic-shapes relative to <box> value
+ https://bugs.webkit.org/show_bug.cgi?id=126206
+
+ Reviewed by Simon Fraser.
+
+ Tests: css3/masking/clip-path-circle-border-box.html
+ css3/masking/clip-path-circle-bounding-box.html
+ css3/masking/clip-path-circle-content-box.html
+ css3/masking/clip-path-circle-margin-box.html
+ css3/masking/clip-path-circle-padding-box.html
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::setupClipPath): Add switch to differ between boxes
+ and use different reference boxes to size the clipping path.
+
</ins><span class="cx"> 2014-01-10 Youenn Fablet <youennf@gmail.com>
</span><span class="cx">
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingClipPathOperationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/ClipPathOperation.h (161668 => 161669)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/ClipPathOperation.h        2014-01-10 21:22:18 UTC (rev 161668)
+++ trunk/Source/WebCore/rendering/ClipPathOperation.h        2014-01-10 21:29:59 UTC (rev 161669)
</span><span class="lines">@@ -107,8 +107,6 @@
</span><span class="cx"> const Path pathForReferenceRect(const FloatRect& boundingRect) const
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_shape);
</span><del>- // FIXME: Make clipping path from basic-shapes relative to <box> value.
- // https://bugs.webkit.org/show_bug.cgi?id=126206
</del><span class="cx"> Path path;
</span><span class="cx"> m_shape->path(path, boundingRect);
</span><span class="cx"> return path;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (161668 => 161669)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-01-10 21:22:18 UTC (rev 161668)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-01-10 21:29:59 UTC (rev 161669)
</span><span class="lines">@@ -3914,18 +3914,46 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> RenderStyle& style = renderer().style();
</span><del>-
</del><span class="cx"> ASSERT(style.clipPath());
</span><span class="cx"> if (style.clipPath()->type() == ClipPathOperation::Shape) {
</span><del>- ShapeClipPathOperation* clipPath = static_cast<ShapeClipPathOperation*>(style.clipPath());
</del><ins>+ ShapeClipPathOperation& clippingPath = toShapeClipPathOperation(*(style.clipPath()));
</ins><span class="cx">
</span><span class="cx"> if (!rootRelativeBoundsComputed) {
</span><span class="cx"> rootRelativeBounds = calculateLayerBounds(paintingInfo.rootLayer, &offsetFromRoot, 0);
</span><span class="cx"> rootRelativeBoundsComputed = true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ LayoutRect referenceBox;
+ if (renderer().isBox()) {
+ RenderBox& box = toRenderBox(renderer());
+ switch (clippingPath.referenceBox()) {
+ case ContentBox:
+ referenceBox = box.contentBoxRect();
+ referenceBox.moveBy(rootRelativeBounds.location());
+ break;
+ case PaddingBox:
+ referenceBox = box.paddingBoxRect();
+ referenceBox.moveBy(rootRelativeBounds.location());
+ break;
+ case BorderBox:
+ referenceBox = box.borderBoxRect();
+ referenceBox.moveBy(rootRelativeBounds.location());
+ break;
+ case MarginBox:
+ // FIXME: Support margin-box. Use bounding client rect for now.
+ case BoundingBox:
+ case BoxMissing:
+ // FIXME: If no reference box was specified the spec demands to use
+ // the border-box. However, the current prefixed version of clip-path uses
+ // bounding-box. Keep bounding-box for now.
+ referenceBox = rootRelativeBounds;
+ }
+ } else
+ // FIXME: Support different reference boxes for inline content.
+ referenceBox = rootRelativeBounds;
+
</ins><span class="cx"> context->save();
</span><del>- context->clipPath(clipPath->pathForReferenceRect(rootRelativeBounds), clipPath->windRule());
</del><ins>+ context->clipPath(clippingPath.pathForReferenceRect(referenceBox), clippingPath.windRule());
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>