<!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>[163764] 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/163764">163764</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-02-09 22:02:42 -0800 (Sun, 09 Feb 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>-webkit-clip-path should support fill, stroke, view-box keywords
https://bugs.webkit.org/show_bug.cgi?id=128393
Source/WebCore:
Patch by Dirk Schulze <dschulze@chromium.org> on 2014-02-09
Reviewed by Dean Jackson.
CSS Masking uses the keywords fill, stroke and view-box for SVG shapes.
This patch updates the parser, style resolver and SVG implementation of
the prefixed clip-path property.
Remove the unexposed and obsolete keyword bounding-box.
Tests: svg/clip-path/clip-path-shape-fill-expected.svg
svg/clip-path/clip-path-shape-fill.svg
svg/clip-path/clip-path-shape-stroke-expected.svg
svg/clip-path/clip-path-shape-stroke.svg
svg/clip-path/clip-path-shape-view-box-expected.svg
svg/clip-path/clip-path-shape-view-box.svg
* css/CSSParser.cpp: Parse fill, stroke, view-box. Remove bounding-box.
(WebCore::isBoxValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator LayoutBox):
* css/CSSValueKeywords.in:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyClipPath::applyValue):
* rendering/RenderLayer.cpp:
(WebCore::computeReferenceBox):
* rendering/shapes/ShapeInfo.h:
(WebCore::ShapeInfo::setShapeSize):
(WebCore::ShapeInfo::logicalTopOffset):
(WebCore::ShapeInfo::logicalLeftOffset):
* rendering/style/RenderStyleConstants.h:
* rendering/svg/SVGRenderingContext.cpp: Use different reference boxes per keyword.
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):
LayoutTests:
Patch by Dirk Schulze <krit@webkit.org> on 2014-02-09
Reviewed by Dean Jackson.
Update or add new tests for changed clip-path keywords.
* css3/masking/clip-path-circle-bounding-box.html: Removed.
* fast/masking/parsing-clip-path-shape.html:
* platform/mac/css3/masking/clip-path-circle-bounding-box-expected.png: Removed.
* platform/mac/css3/masking/clip-path-circle-bounding-box-expected.txt: Removed.
* svg/clip-path/clip-path-shape-fill-expected.svg: Added.
* svg/clip-path/clip-path-shape-fill.svg: Added.
* svg/clip-path/clip-path-shape-stroke-expected.svg: Added.
* svg/clip-path/clip-path-shape-stroke.svg: Added.
* svg/clip-path/clip-path-shape-view-box-expected.svg: Added.
* svg/clip-path/clip-path-shape-view-box.svg: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastmaskingparsingclippathshapeexpectedtxt">trunk/LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmaskingparsingclippathshapehtml">trunk/LayoutTests/fast/masking/parsing-clip-path-shape.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValueMappingsh">trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSValueKeywordsin">trunk/Source/WebCore/css/CSSValueKeywords.in</a></li>
<li><a href="#trunkSourceWebCorecssDeprecatedStyleBuildercpp">trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLayercpp">trunk/Source/WebCore/rendering/RenderLayer.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingshapesShapeInfoh">trunk/Source/WebCore/rendering/shapes/ShapeInfo.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleConstantsh">trunk/Source/WebCore/rendering/style/RenderStyleConstants.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRenderingContextcpp">trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvgclippathclippathshapefillexpectedsvg">trunk/LayoutTests/svg/clip-path/clip-path-shape-fill-expected.svg</a></li>
<li><a href="#trunkLayoutTestssvgclippathclippathshapefillsvg">trunk/LayoutTests/svg/clip-path/clip-path-shape-fill.svg</a></li>
<li><a href="#trunkLayoutTestssvgclippathclippathshapestrokeexpectedsvg">trunk/LayoutTests/svg/clip-path/clip-path-shape-stroke-expected.svg</a></li>
<li><a href="#trunkLayoutTestssvgclippathclippathshapestrokesvg">trunk/LayoutTests/svg/clip-path/clip-path-shape-stroke.svg</a></li>
<li><a href="#trunkLayoutTestssvgclippathclippathshapeviewboxexpectedsvg">trunk/LayoutTests/svg/clip-path/clip-path-shape-view-box-expected.svg</a></li>
<li><a href="#trunkLayoutTestssvgclippathclippathshapeviewboxsvg">trunk/LayoutTests/svg/clip-path/clip-path-shape-view-box.svg</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscss3maskingclippathcircleboundingboxhtml">trunk/LayoutTests/css3/masking/clip-path-circle-bounding-box.html</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>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (163763 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-02-10 05:40:34 UTC (rev 163763)
+++ trunk/LayoutTests/ChangeLog        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2014-02-09 Dirk Schulze <krit@webkit.org>
+
+ -webkit-clip-path should support fill, stroke, view-box keywords
+ https://bugs.webkit.org/show_bug.cgi?id=128393
+
+ Reviewed by Dean Jackson.
+
+ Update or add new tests for changed clip-path keywords.
+
+ * css3/masking/clip-path-circle-bounding-box.html: Removed.
+ * fast/masking/parsing-clip-path-shape.html:
+ * platform/mac/css3/masking/clip-path-circle-bounding-box-expected.png: Removed.
+ * platform/mac/css3/masking/clip-path-circle-bounding-box-expected.txt: Removed.
+ * svg/clip-path/clip-path-shape-fill-expected.svg: Added.
+ * svg/clip-path/clip-path-shape-fill.svg: Added.
+ * svg/clip-path/clip-path-shape-stroke-expected.svg: Added.
+ * svg/clip-path/clip-path-shape-stroke.svg: Added.
+ * svg/clip-path/clip-path-shape-view-box-expected.svg: Added.
+ * svg/clip-path/clip-path-shape-view-box.svg: Added.
+
</ins><span class="cx"> 2014-02-09 Carlos Garnacho <carlosg@gnome.org>
</span><span class="cx">
</span><span class="cx"> [GTK] Enable touch features
</span></span></pre></div>
<a id="trunkLayoutTestscss3maskingclippathcircleboundingboxhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/css3/masking/clip-path-circle-bounding-box.html (163763 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/masking/clip-path-circle-bounding-box.html        2014-02-10 05:40:34 UTC (rev 163763)
+++ trunk/LayoutTests/css3/masking/clip-path-circle-bounding-box.html        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -1,28 +0,0 @@
</span><del>-<!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>
</del></span></pre></div>
<a id="trunkLayoutTestsfastmaskingparsingclippathshapeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt (163763 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt        2014-02-10 05:40:34 UTC (rev 163763)
+++ trunk/LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -52,22 +52,26 @@
</span><span class="cx"> PASS innerStyle("-webkit-clip-path", "padding-box") is "padding-box"
</span><span class="cx"> PASS innerStyle("-webkit-clip-path", "border-box") is "border-box"
</span><span class="cx"> PASS innerStyle("-webkit-clip-path", "margin-box") is "margin-box"
</span><del>-PASS innerStyle("-webkit-clip-path", "bounding-box") is "bounding-box"
</del><ins>+PASS innerStyle("-webkit-clip-path", "fill") is "fill"
+PASS innerStyle("-webkit-clip-path", "stroke") is "stroke"
+PASS innerStyle("-webkit-clip-path", "view-box") is "view-box"
</ins><span class="cx"> PASS innerStyle("-webkit-clip-path", "circle(50% at 50% 50%) content-box") is "circle(50% at 50% 50%) content-box"
</span><span class="cx"> PASS innerStyle("-webkit-clip-path", "circle(50% at 50% 50%) padding-box") is "circle(50% at 50% 50%) padding-box"
</span><span class="cx"> PASS innerStyle("-webkit-clip-path", "margin-box circle(50% at 50% 50%)") is "margin-box circle(50% at 50% 50%)"
</span><span class="cx"> PASS innerStyle("-webkit-clip-path", "border-box circle(50% at 50% 50%)") is "border-box circle(50% at 50% 50%)"
</span><del>-PASS innerStyle("-webkit-clip-path", "circle(50% at 50% 50%) bounding-box") is "circle(50% at 50% 50%) bounding-box"
</del><ins>+PASS innerStyle("-webkit-clip-path", "circle(50% at 50% 50%) view-box") is "circle(50% at 50% 50%) view-box"
</ins><span class="cx"> PASS computedStyle("-webkit-clip-path", "content-box") is "content-box"
</span><span class="cx"> PASS computedStyle("-webkit-clip-path", "padding-box") is "padding-box"
</span><span class="cx"> PASS computedStyle("-webkit-clip-path", "border-box") is "border-box"
</span><span class="cx"> PASS computedStyle("-webkit-clip-path", "margin-box") is "margin-box"
</span><del>-PASS computedStyle("-webkit-clip-path", "bounding-box") is "bounding-box"
</del><ins>+PASS computedStyle("-webkit-clip-path", "fill") is "fill"
+PASS computedStyle("-webkit-clip-path", "stroke") is "stroke"
+PASS computedStyle("-webkit-clip-path", "view-box") is "view-box"
</ins><span class="cx"> PASS computedStyle("-webkit-clip-path", "circle(50% at 50% 50%) content-box") is "circle(50% at 50% 50%) content-box"
</span><span class="cx"> PASS computedStyle("-webkit-clip-path", "circle(50% at 50% 50%) padding-box") is "circle(50% at 50% 50%) padding-box"
</span><span class="cx"> PASS computedStyle("-webkit-clip-path", "margin-box circle(50% at 50% 50%)") is "circle(50% at 50% 50%) margin-box"
</span><span class="cx"> PASS computedStyle("-webkit-clip-path", "border-box circle(50% at 50% 50%)") is "circle(50% at 50% 50%) border-box"
</span><del>-PASS computedStyle("-webkit-clip-path", "circle(50% at 50% 50%) bounding-box") is "circle(50% at 50% 50%) bounding-box"
</del><ins>+PASS computedStyle("-webkit-clip-path", "circle(50% at 50% 50%) fill") is "circle(50% at 50% 50%) fill"
</ins><span class="cx"> PASS innerStyle("-webkit-clip-path", "circle(1px, 1px, 1)") is null
</span><span class="cx"> PASS computedStyle("-webkit-clip-path", "circle(1px, 1px, 1)") is "none"
</span><span class="cx"> PASS innerStyle("-webkit-clip-path", "circle(1px, 1px, px)") is null
</span><span class="lines">@@ -100,14 +104,14 @@
</span><span class="cx"> PASS computedStyle("-webkit-clip-path", "rectangle(1cm, 1mm, -1in, 1px, 1pt, 1pc)") is "none"
</span><span class="cx"> PASS innerStyle("-webkit-clip-path", "rectangle(1cm, 1mm, 1in, -1px, 1pt, 1pc)") is null
</span><span class="cx"> PASS computedStyle("-webkit-clip-path", "rectangle(1cm, 1mm, 1in, -1px, 1pt, 1pc)") is "none"
</span><del>-PASS innerStyle("-webkit-clip-path", "bounding-box circle(50% at 50% 50%) content-box") is null
-PASS computedStyle("-webkit-clip-path", "bounding-box circle(50% at 50% 50%) content-box") is "none"
</del><ins>+PASS innerStyle("-webkit-clip-path", "fill circle(50% at 50% 50%) content-box") is null
+PASS computedStyle("-webkit-clip-path", "fill circle(50% at 50% 50%) content-box") is "none"
</ins><span class="cx"> PASS innerStyle("-webkit-clip-path", "margin-box padding-box") is null
</span><span class="cx"> PASS computedStyle("-webkit-clip-path", "margin-box padding-box") is "none"
</span><span class="cx"> PASS innerStyle("-webkit-clip-path", "padding-box border-box circle(50% at 50% 50%)") is null
</span><span class="cx"> PASS computedStyle("-webkit-clip-path", "padding-box border-box circle(50% at 50% 50%)") is "none"
</span><del>-PASS innerStyle("-webkit-clip-path", "circle(50% at 50% 50%) content-box bounding-box") is null
-PASS computedStyle("-webkit-clip-path", "circle(50% at 50% 50%) content-box bounding-box") is "none"
</del><ins>+PASS innerStyle("-webkit-clip-path", "circle(50% at 50% 50%) content-box stroke") is null
+PASS computedStyle("-webkit-clip-path", "circle(50% at 50% 50%) content-box stroke") is "none"
</ins><span class="cx"> PASS innerStyle("-webkit-clip-path", "content-box margin-box padding-box") is null
</span><span class="cx"> PASS computedStyle("-webkit-clip-path", "content-box margin-box padding-box") is "none"
</span><span class="cx"> PASS innerStyle("-webkit-clip-path", "none content-box") is null
</span></span></pre></div>
<a id="trunkLayoutTestsfastmaskingparsingclippathshapehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/masking/parsing-clip-path-shape.html (163763 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/masking/parsing-clip-path-shape.html        2014-02-10 05:40:34 UTC (rev 163763)
+++ trunk/LayoutTests/fast/masking/parsing-clip-path-shape.html        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -111,23 +111,27 @@
</span><span class="cx"> testInner("-webkit-clip-path", "padding-box", "padding-box");
</span><span class="cx"> testInner("-webkit-clip-path", "border-box", "border-box");
</span><span class="cx"> testInner("-webkit-clip-path", "margin-box", "margin-box");
</span><del>-testInner("-webkit-clip-path", "bounding-box", "bounding-box");
</del><ins>+testInner("-webkit-clip-path", "fill", "fill");
+testInner("-webkit-clip-path", "stroke", "stroke");
+testInner("-webkit-clip-path", "view-box", "view-box");
</ins><span class="cx"> testInner("-webkit-clip-path", "circle(50% at 50% 50%) content-box", "circle(50% at 50% 50%) content-box");
</span><span class="cx"> testInner("-webkit-clip-path", "circle(50% at 50% 50%) padding-box", "circle(50% at 50% 50%) padding-box");
</span><span class="cx"> testInner("-webkit-clip-path", "margin-box circle(50% at 50% 50%)", "margin-box circle(50% at 50% 50%)");
</span><span class="cx"> testInner("-webkit-clip-path", "border-box circle(50% at 50% 50%)", "border-box circle(50% at 50% 50%)");
</span><del>-testInner("-webkit-clip-path", "circle(50% at 50% 50%) bounding-box", "circle(50% at 50% 50%) bounding-box");
</del><ins>+testInner("-webkit-clip-path", "circle(50% at 50% 50%) view-box", "circle(50% at 50% 50%) view-box");
</ins><span class="cx">
</span><span class="cx"> testComputed("-webkit-clip-path", "content-box", "content-box");
</span><span class="cx"> testComputed("-webkit-clip-path", "padding-box", "padding-box");
</span><span class="cx"> testComputed("-webkit-clip-path", "border-box", "border-box");
</span><span class="cx"> testComputed("-webkit-clip-path", "margin-box", "margin-box");
</span><del>-testComputed("-webkit-clip-path", "bounding-box", "bounding-box");
</del><ins>+testComputed("-webkit-clip-path", "fill", "fill");
+testComputed("-webkit-clip-path", "stroke", "stroke");
+testComputed("-webkit-clip-path", "view-box", "view-box");
</ins><span class="cx"> testComputed("-webkit-clip-path", "circle(50% at 50% 50%) content-box", "circle(50% at 50% 50%) content-box");
</span><span class="cx"> testComputed("-webkit-clip-path", "circle(50% at 50% 50%) padding-box", "circle(50% at 50% 50%) padding-box");
</span><span class="cx"> testComputed("-webkit-clip-path", "margin-box circle(50% at 50% 50%)", "circle(50% at 50% 50%) margin-box");
</span><span class="cx"> testComputed("-webkit-clip-path", "border-box circle(50% at 50% 50%)", "circle(50% at 50% 50%) border-box");
</span><del>-testComputed("-webkit-clip-path", "circle(50% at 50% 50%) bounding-box", "circle(50% at 50% 50%) bounding-box");
</del><ins>+testComputed("-webkit-clip-path", "circle(50% at 50% 50%) fill", "circle(50% at 50% 50%) fill");
</ins><span class="cx">
</span><span class="cx"> // reject non-lengths
</span><span class="cx"> negativeTest("-webkit-clip-path", "circle(1px, 1px, 1)");
</span><span class="lines">@@ -153,10 +157,10 @@
</span><span class="cx"> negativeTest("-webkit-clip-path", "rectangle(1cm, 1mm, 1in, -1px, 1pt, 1pc)");
</span><span class="cx">
</span><span class="cx"> // reject multiple <box> values
</span><del>-negativeTest("-webkit-clip-path", "bounding-box circle(50% at 50% 50%) content-box");
</del><ins>+negativeTest("-webkit-clip-path", "fill circle(50% at 50% 50%) content-box");
</ins><span class="cx"> negativeTest("-webkit-clip-path", "margin-box padding-box");
</span><span class="cx"> negativeTest("-webkit-clip-path", "padding-box border-box circle(50% at 50% 50%)");
</span><del>-negativeTest("-webkit-clip-path", "circle(50% at 50% 50%) content-box bounding-box");
</del><ins>+negativeTest("-webkit-clip-path", "circle(50% at 50% 50%) content-box stroke");
</ins><span class="cx"> negativeTest("-webkit-clip-path", "content-box margin-box padding-box");
</span><span class="cx"> negativeTest("-webkit-clip-path", "none content-box");
</span><span class="cx"> negativeTest("-webkit-clip-path", "url(#test) padding-box");
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmaccss3maskingclippathcircleboundingboxexpectedpng"></a>
<div class="binary"><h4>Deleted: 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>
<a id="trunkLayoutTestsplatformmaccss3maskingclippathcircleboundingboxexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-bounding-box-expected.txt (163763 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-bounding-box-expected.txt        2014-02-10 05:40:34 UTC (rev 163763)
+++ trunk/LayoutTests/platform/mac/css3/masking/clip-path-circle-bounding-box-expected.txt        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -1,8 +0,0 @@
</span><del>-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]
</del></span></pre></div>
<a id="trunkLayoutTestssvgclippathclippathshapefillexpectedsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/clip-path/clip-path-shape-fill-expected.svg (0 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/clip-path/clip-path-shape-fill-expected.svg         (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-shape-fill-expected.svg        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green" stroke="green" stroke-width="10" style="-webkit-clip-path: circle();"/>
+</svg>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvgclippathclippathshapefillsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/clip-path/clip-path-shape-fill.svg (0 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/clip-path/clip-path-shape-fill.svg         (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-shape-fill.svg        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+<svg xmlns="http://www.w3.org/2000/svg">
+<rect width="200" height="200" fill="green" stroke="green" stroke-width="10" style="-webkit-clip-path: circle() fill;"/>
+</svg>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvgclippathclippathshapestrokeexpectedsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/clip-path/clip-path-shape-stroke-expected.svg (0 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/clip-path/clip-path-shape-stroke-expected.svg         (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-shape-stroke-expected.svg        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+<svg xmlns="http://www.w3.org/2000/svg">
+<defs>
+ <clipPath id="clip">
+ <circle cx="100" cy="100" r="100"/>
+ </clipPath>
+</defs>
+<rect x="10" y="10" width="180" height="180" fill="green" stroke="green" stroke-width="20" style="-webkit-clip-path: circle() stroke;"/>
+</svg>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvgclippathclippathshapestrokesvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/clip-path/clip-path-shape-stroke.svg (0 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/clip-path/clip-path-shape-stroke.svg         (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-shape-stroke.svg        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400">
+<rect x="10" y="10" width="180" height="180" fill="green" stroke="green" stroke-width="20" style="-webkit-clip-path: circle() stroke;"/>
+</svg>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvgclippathclippathshapeviewboxexpectedsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/clip-path/clip-path-shape-view-box-expected.svg (0 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/clip-path/clip-path-shape-view-box-expected.svg         (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-shape-view-box-expected.svg        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+<svg xmlns="http://www.w3.org/2000/svg">
+<defs>
+ <clipPath id="clip">
+ <circle cx="200" cy="200" r="200"/>
+ </clipPath>
+</defs>
+<rect width="200" height="200" fill="green" clip-path="url(#clip)"/>
+</svg>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestssvgclippathclippathshapeviewboxsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/clip-path/clip-path-shape-view-box.svg (0 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/clip-path/clip-path-shape-view-box.svg         (rev 0)
+++ trunk/LayoutTests/svg/clip-path/clip-path-shape-view-box.svg        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400">
+<rect width="200" height="200" fill="green" style="-webkit-clip-path: circle() view-box;"/>
+</svg>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (163763 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-10 05:40:34 UTC (rev 163763)
+++ trunk/Source/WebCore/ChangeLog        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2014-02-09 Dirk Schulze <dschulze@chromium.org>
+
+ -webkit-clip-path should support fill, stroke, view-box keywords
+ https://bugs.webkit.org/show_bug.cgi?id=128393
+
+ Reviewed by Dean Jackson.
+
+ CSS Masking uses the keywords fill, stroke and view-box for SVG shapes.
+ This patch updates the parser, style resolver and SVG implementation of
+ the prefixed clip-path property.
+
+ Remove the unexposed and obsolete keyword bounding-box.
+
+ Tests: svg/clip-path/clip-path-shape-fill-expected.svg
+ svg/clip-path/clip-path-shape-fill.svg
+ svg/clip-path/clip-path-shape-stroke-expected.svg
+ svg/clip-path/clip-path-shape-stroke.svg
+ svg/clip-path/clip-path-shape-view-box-expected.svg
+ svg/clip-path/clip-path-shape-view-box.svg
+
+ * css/CSSParser.cpp: Parse fill, stroke, view-box. Remove bounding-box.
+ (WebCore::isBoxValue):
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+ (WebCore::CSSPrimitiveValue::operator LayoutBox):
+ * css/CSSValueKeywords.in:
+ * css/DeprecatedStyleBuilder.cpp:
+ (WebCore::ApplyPropertyClipPath::applyValue):
+ * rendering/RenderLayer.cpp:
+ (WebCore::computeReferenceBox):
+ * rendering/shapes/ShapeInfo.h:
+ (WebCore::ShapeInfo::setShapeSize):
+ (WebCore::ShapeInfo::logicalTopOffset):
+ (WebCore::ShapeInfo::logicalLeftOffset):
+ * rendering/style/RenderStyleConstants.h:
+ * rendering/svg/SVGRenderingContext.cpp: Use different reference boxes per keyword.
+ (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
+
</ins><span class="cx"> 2014-02-09 Dean Jackson <dino@apple.com>
</span><span class="cx">
</span><span class="cx"> [WebGL] Remove state restorer code
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (163763 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2014-02-10 05:40:34 UTC (rev 163763)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -5821,7 +5821,9 @@
</span><span class="cx"> case CSSValueBorderBox:
</span><span class="cx"> case CSSValueMarginBox:
</span><span class="cx"> return true;
</span><del>- case CSSValueBoundingBox:
</del><ins>+ case CSSValueFill:
+ case CSSValueStroke:
+ case CSSValueViewBox:
</ins><span class="cx"> return propId == CSSPropertyWebkitClipPath;
</span><span class="cx"> default: break;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValueMappingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (163763 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h        2014-02-10 05:40:34 UTC (rev 163763)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -5126,9 +5126,6 @@
</span><span class="cx"> {
</span><span class="cx"> m_primitiveUnitType = CSS_VALUE_ID;
</span><span class="cx"> switch (layoutBox) {
</span><del>- case BoundingBox:
- m_value.valueID = CSSValueBoundingBox;
- break;
</del><span class="cx"> case MarginBox:
</span><span class="cx"> m_value.valueID = CSSValueMarginBox;
</span><span class="cx"> break;
</span><span class="lines">@@ -5141,6 +5138,15 @@
</span><span class="cx"> case ContentBox:
</span><span class="cx"> m_value.valueID = CSSValueContentBox;
</span><span class="cx"> break;
</span><ins>+ case Fill:
+ m_value.valueID = CSSValueFill;
+ break;
+ case Stroke:
+ m_value.valueID = CSSValueStroke;
+ break;
+ case ViewBox:
+ m_value.valueID = CSSValueViewBox;
+ break;
</ins><span class="cx"> case BoxMissing:
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> m_value.valueID = CSSValueNone;
</span><span class="lines">@@ -5151,8 +5157,6 @@
</span><span class="cx"> template<> inline CSSPrimitiveValue::operator LayoutBox() const
</span><span class="cx"> {
</span><span class="cx"> switch (getValueID()) {
</span><del>- case CSSValueBoundingBox:
- return BoundingBox;
</del><span class="cx"> case CSSValueMarginBox:
</span><span class="cx"> return MarginBox;
</span><span class="cx"> case CSSValueBorderBox:
</span><span class="lines">@@ -5161,6 +5165,13 @@
</span><span class="cx"> return PaddingBox;
</span><span class="cx"> case CSSValueContentBox:
</span><span class="cx"> return ContentBox;
</span><ins>+ // The following are used in an SVG context.
+ case CSSValueFill:
+ return Fill;
+ case CSSValueStroke:
+ return Stroke;
+ case CSSValueViewBox:
+ return ViewBox;
</ins><span class="cx"> default:
</span><span class="cx"> break;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueKeywordsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (163763 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValueKeywords.in        2014-02-10 05:40:34 UTC (rev 163763)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -745,7 +745,7 @@
</span><span class="cx"> margin-box
</span><span class="cx">
</span><span class="cx"> // clip-path
</span><del>-bounding-box
</del><ins>+view-box
</ins><span class="cx">
</span><span class="cx"> //
</span><span class="cx"> // background-size
</span></span></pre></div>
<a id="trunkSourceWebCorecssDeprecatedStyleBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (163763 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-02-10 05:40:34 UTC (rev 163763)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -2139,7 +2139,9 @@
</span><span class="cx"> || primitiveValue.getValueID() == CSSValueBorderBox
</span><span class="cx"> || primitiveValue.getValueID() == CSSValuePaddingBox
</span><span class="cx"> || primitiveValue.getValueID() == CSSValueMarginBox
</span><del>- || primitiveValue.getValueID() == CSSValueBoundingBox)
</del><ins>+ || primitiveValue.getValueID() == CSSValueFill
+ || primitiveValue.getValueID() == CSSValueStroke
+ || primitiveValue.getValueID() == CSSValueViewBox)
</ins><span class="cx"> && referenceBox == BoxMissing)
</span><span class="cx"> referenceBox = LayoutBox(primitiveValue);
</span><span class="cx"> else
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (163763 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-02-10 05:40:34 UTC (rev 163763)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -3790,6 +3790,10 @@
</span><span class="cx"> referenceBox = box.paddingBoxRect();
</span><span class="cx"> referenceBox.moveBy(rootRelativeBounds.location());
</span><span class="cx"> break;
</span><ins>+ // fill, stroke, view-box compute to border-box for HTML elements.
+ case Fill:
+ case Stroke:
+ case ViewBox:
</ins><span class="cx"> case BorderBox:
</span><span class="cx"> referenceBox = box.borderBoxRect();
</span><span class="cx"> referenceBox.moveBy(rootRelativeBounds.location());
</span><span class="lines">@@ -3797,7 +3801,6 @@
</span><span class="cx"> case MarginBox:
</span><span class="cx"> // FIXME: Support margin-box. Use bounding client rect for now.
</span><span class="cx"> // https://bugs.webkit.org/show_bug.cgi?id=127984
</span><del>- case BoundingBox:
</del><span class="cx"> case BoxMissing:
</span><span class="cx"> // FIXME: If no reference box was specified the spec demands to use
</span><span class="cx"> // the border-box. However, the current prefixed version of clip-path uses
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesShapeInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/ShapeInfo.h (163763 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/ShapeInfo.h        2014-02-10 05:40:34 UTC (rev 163763)
+++ trunk/Source/WebCore/rendering/shapes/ShapeInfo.h        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -89,7 +89,9 @@
</span><span class="cx"> logicalHeight -= m_renderer.borderAndPaddingLogicalHeight();
</span><span class="cx"> logicalWidth -= m_renderer.borderAndPaddingLogicalWidth();
</span><span class="cx"> break;
</span><del>- case BoundingBox:
</del><ins>+ case Fill:
+ case Stroke:
+ case ViewBox:
</ins><span class="cx"> case BoxMissing:
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> break;
</span><span class="lines">@@ -176,7 +178,9 @@
</span><span class="cx"> case BorderBox: return LayoutUnit();
</span><span class="cx"> case PaddingBox: return m_renderer.borderBefore();
</span><span class="cx"> case ContentBox: return m_renderer.borderAndPaddingBefore();
</span><del>- case BoundingBox: break;
</del><ins>+ case Fill: break;
+ case Stroke: break;
+ case ViewBox: break;
</ins><span class="cx"> case BoxMissing: break;
</span><span class="cx"> }
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="lines">@@ -193,7 +197,9 @@
</span><span class="cx"> case BorderBox: return LayoutUnit();
</span><span class="cx"> case PaddingBox: return m_renderer.borderStart();
</span><span class="cx"> case ContentBox: return m_renderer.borderAndPaddingStart();
</span><del>- case BoundingBox: break;
</del><ins>+ case Fill: break;
+ case Stroke: break;
+ case ViewBox: break;
</ins><span class="cx"> case BoxMissing: break;
</span><span class="cx"> }
</span><span class="cx"> ASSERT_NOT_REACHED();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleConstantsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (163763 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h        2014-02-10 05:40:34 UTC (rev 163763)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -544,7 +544,8 @@
</span><span class="cx"> enum TextIndentType { TextIndentNormal, TextIndentHanging };
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-enum LayoutBox { BoxMissing = 0, MarginBox, BorderBox, PaddingBox, ContentBox, BoundingBox };
</del><ins>+// Fill, Stroke, ViewBox are just used for SVG.
+enum LayoutBox { BoxMissing = 0, MarginBox, BorderBox, PaddingBox, ContentBox, Fill, Stroke, ViewBox };
</ins><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp (163763 => 163764)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp        2014-02-10 05:40:34 UTC (rev 163763)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp        2014-02-10 06:02:42 UTC (rev 163764)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include "RenderSVGResourceFilter.h"
</span><span class="cx"> #include "RenderSVGResourceMasker.h"
</span><span class="cx"> #include "RenderView.h"
</span><ins>+#include "SVGLengthContext.h"
</ins><span class="cx"> #include "SVGResources.h"
</span><span class="cx"> #include "SVGResourcesCache.h"
</span><span class="cx">
</span><span class="lines">@@ -121,8 +122,19 @@
</span><span class="cx">
</span><span class="cx"> ClipPathOperation* clipPathOperation = style.clipPath();
</span><span class="cx"> if (clipPathOperation && clipPathOperation->type() == ClipPathOperation::Shape) {
</span><del>- ShapeClipPathOperation* clipPath = static_cast<ShapeClipPathOperation*>(clipPathOperation);
- m_paintInfo->context->clipPath(clipPath->pathForReferenceRect(renderer.objectBoundingBox()), clipPath->windRule());
</del><ins>+ ShapeClipPathOperation& clipPath = toShapeClipPathOperation(*clipPathOperation);
+ FloatRect referenceBox;
+ if (clipPath.referenceBox() == Stroke)
+ // FIXME: strokeBoundingBox() takes dasharray into account but shouldn't.
+ referenceBox = renderer.strokeBoundingBox();
+ else if (clipPath.referenceBox() == ViewBox && renderer.element()) {
+ FloatSize viewportSize;
+ SVGLengthContext(toSVGElement(renderer.element())).determineViewport(viewportSize);
+ referenceBox.setWidth(viewportSize.width());
+ referenceBox.setHeight(viewportSize.height());
+ } else
+ referenceBox = renderer.objectBoundingBox();
+ m_paintInfo->context->clipPath(clipPath.pathForReferenceRect(referenceBox), clipPath.windRule());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(*m_renderer);
</span></span></pre>
</div>
</div>
</body>
</html>