<!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>[161209] 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/161209">161209</a></dd>
<dt>Author</dt> <dd>krit@webkit.org</dd>
<dt>Date</dt> <dd>2014-01-02 10:11:51 -0800 (Thu, 02 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Support &lt;box&gt; values computed style for 'clip-path' property
https://bugs.webkit.org/show_bug.cgi?id=126148

Reviewed by Simon Fraser.

Source/WebCore:

Calculate computed style for 'clip-path' property.

Updated tests to check for computed style.

* css/BasicShapeFunctions.cpp: Add box value bounding-box.
(WebCore::valueForBox):
(WebCore::boxForValue):
* css/CSSComputedStyleDeclaration.cpp: Return the computed style
    for 'clip-path'.
(WebCore::ComputedStyleExtractor::propertyValue):
* css/DeprecatedStyleBuilder.cpp: Create CSSValueLists for 'clip-th'.
(WebCore::ApplyPropertyClipPath::applyValue):
* rendering/ClipPathOperation.h: Add bounding-box value.
(WebCore::ShapeClipPathOperation::pathForReferenceRect):
(WebCore::ShapeClipPathOperation::setReferenceBox):
(WebCore::ShapeClipPathOperation::referenceBox):
(WebCore::BoxClipPathOperation::create):
(WebCore::BoxClipPathOperation::pathForReferenceRect):
(WebCore::BoxClipPathOperation::referenceBox):
(WebCore::BoxClipPathOperation::BoxClipPathOperation):
* rendering/shapes/ShapeInfo.h: Add bounding-box value.
(WebCore::ShapeInfo::setShapeSize):
(WebCore::ShapeInfo::logicalTopOffset):
(WebCore::ShapeInfo::logicalLeftOffset):
* rendering/style/BasicShapes.cpp: Add bounding-box value.
(WebCore::BasicShape::referenceBoxSize):
* rendering/style/BasicShapes.h:

LayoutTests:

Test computed style of 'clip-path' property.

* fast/masking/parsing-clip-path-shape.html:</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="#trunkSourceWebCorecssBasicShapeFunctionscpp">trunk/Source/WebCore/css/BasicShapeFunctions.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssDeprecatedStyleBuildercpp">trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationCSSPropertyAnimationcpp">trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp</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>
<li><a href="#trunkSourceWebCorerenderingshapesShapeInfoh">trunk/Source/WebCore/rendering/shapes/ShapeInfo.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleBasicShapescpp">trunk/Source/WebCore/rendering/style/BasicShapes.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleBasicShapesh">trunk/Source/WebCore/rendering/style/BasicShapes.h</a></li>
<li><a href="#trunkSourceWebCorerenderingsvgSVGRenderingContextcpp">trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/LayoutTests/ChangeLog        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-01-02  Dirk Schulze  &lt;krit@webkit.org&gt;
+
+        Support &lt;box&gt; values computed style for 'clip-path' property
+        https://bugs.webkit.org/show_bug.cgi?id=126148
+
+        Reviewed by Simon Fraser.
+
+        Test computed style of 'clip-path' property.
+
+        * fast/masking/parsing-clip-path-shape.html:
+
</ins><span class="cx"> 2014-01-01  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Do less synchronous render tree construction
</span></span></pre></div>
<a id="trunkLayoutTestsfastmaskingparsingclippathshapeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/LayoutTests/fast/masking/parsing-clip-path-shape-expected.txt        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -58,6 +58,16 @@
</span><span class="cx"> PASS innerStyle(&quot;-webkit-clip-path&quot;, &quot;margin-box circle(50% at 50% 50%)&quot;) is &quot;margin-box circle(50% at 50% 50%)&quot;
</span><span class="cx"> PASS innerStyle(&quot;-webkit-clip-path&quot;, &quot;border-box circle(50% at 50% 50%)&quot;) is &quot;border-box circle(50% at 50% 50%)&quot;
</span><span class="cx"> PASS innerStyle(&quot;-webkit-clip-path&quot;, &quot;circle(50% at 50% 50%) bounding-box&quot;) is &quot;circle(50% at 50% 50%) bounding-box&quot;
</span><ins>+PASS computedStyle(&quot;-webkit-clip-path&quot;, &quot;content-box&quot;) is &quot;content-box&quot;
+PASS computedStyle(&quot;-webkit-clip-path&quot;, &quot;padding-box&quot;) is &quot;padding-box&quot;
+PASS computedStyle(&quot;-webkit-clip-path&quot;, &quot;border-box&quot;) is &quot;border-box&quot;
+PASS computedStyle(&quot;-webkit-clip-path&quot;, &quot;margin-box&quot;) is &quot;margin-box&quot;
+PASS computedStyle(&quot;-webkit-clip-path&quot;, &quot;bounding-box&quot;) is &quot;bounding-box&quot;
+PASS computedStyle(&quot;-webkit-clip-path&quot;, &quot;circle(50% at 50% 50%) content-box&quot;) is &quot;circle(50% at 50% 50%) content-box&quot;
+PASS computedStyle(&quot;-webkit-clip-path&quot;, &quot;circle(50% at 50% 50%) padding-box&quot;) is &quot;circle(50% at 50% 50%) padding-box&quot;
+PASS computedStyle(&quot;-webkit-clip-path&quot;, &quot;margin-box circle(50% at 50% 50%)&quot;) is &quot;circle(50% at 50% 50%) margin-box&quot;
+PASS computedStyle(&quot;-webkit-clip-path&quot;, &quot;border-box circle(50% at 50% 50%)&quot;) is &quot;circle(50% at 50% 50%) border-box&quot;
+PASS computedStyle(&quot;-webkit-clip-path&quot;, &quot;circle(50% at 50% 50%) bounding-box&quot;) is &quot;circle(50% at 50% 50%) bounding-box&quot;
</ins><span class="cx"> PASS innerStyle(&quot;-webkit-clip-path&quot;, &quot;circle(1px, 1px, 1)&quot;) is null
</span><span class="cx"> PASS computedStyle(&quot;-webkit-clip-path&quot;, &quot;circle(1px, 1px, 1)&quot;) is &quot;none&quot;
</span><span class="cx"> PASS innerStyle(&quot;-webkit-clip-path&quot;, &quot;circle(1px, 1px, px)&quot;) is null
</span></span></pre></div>
<a id="trunkLayoutTestsfastmaskingparsingclippathshapehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/masking/parsing-clip-path-shape.html (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/masking/parsing-clip-path-shape.html        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/LayoutTests/fast/masking/parsing-clip-path-shape.html        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -118,6 +118,17 @@
</span><span class="cx"> testInner(&quot;-webkit-clip-path&quot;, &quot;border-box circle(50% at 50% 50%)&quot;, &quot;border-box circle(50% at 50% 50%)&quot;);
</span><span class="cx"> testInner(&quot;-webkit-clip-path&quot;, &quot;circle(50% at 50% 50%) bounding-box&quot;, &quot;circle(50% at 50% 50%) bounding-box&quot;);
</span><span class="cx"> 
</span><ins>+testComputed(&quot;-webkit-clip-path&quot;, &quot;content-box&quot;, &quot;content-box&quot;);
+testComputed(&quot;-webkit-clip-path&quot;, &quot;padding-box&quot;, &quot;padding-box&quot;);
+testComputed(&quot;-webkit-clip-path&quot;, &quot;border-box&quot;, &quot;border-box&quot;);
+testComputed(&quot;-webkit-clip-path&quot;, &quot;margin-box&quot;, &quot;margin-box&quot;);
+testComputed(&quot;-webkit-clip-path&quot;, &quot;bounding-box&quot;, &quot;bounding-box&quot;);
+testComputed(&quot;-webkit-clip-path&quot;, &quot;circle(50% at 50% 50%) content-box&quot;, &quot;circle(50% at 50% 50%) content-box&quot;);
+testComputed(&quot;-webkit-clip-path&quot;, &quot;circle(50% at 50% 50%) padding-box&quot;, &quot;circle(50% at 50% 50%) padding-box&quot;);
+testComputed(&quot;-webkit-clip-path&quot;, &quot;margin-box circle(50% at 50% 50%)&quot;, &quot;circle(50% at 50% 50%) margin-box&quot;);
+testComputed(&quot;-webkit-clip-path&quot;, &quot;border-box circle(50% at 50% 50%)&quot;, &quot;circle(50% at 50% 50%) border-box&quot;);
+testComputed(&quot;-webkit-clip-path&quot;, &quot;circle(50% at 50% 50%) bounding-box&quot;, &quot;circle(50% at 50% 50%) bounding-box&quot;);
+
</ins><span class="cx"> // reject non-lengths
</span><span class="cx"> negativeTest(&quot;-webkit-clip-path&quot;, &quot;circle(1px, 1px, 1)&quot;);
</span><span class="cx"> negativeTest(&quot;-webkit-clip-path&quot;, &quot;circle(1px, 1px, px)&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/ChangeLog        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2014-01-02  Dirk Schulze  &lt;krit@webkit.org&gt;
+
+        Support &lt;box&gt; values computed style for 'clip-path' property
+        https://bugs.webkit.org/show_bug.cgi?id=126148
+
+        Reviewed by Simon Fraser.
+
+        Calculate computed style for 'clip-path' property.
+
+        Updated tests to check for computed style.
+
+        * css/BasicShapeFunctions.cpp: Add box value bounding-box.
+        (WebCore::valueForBox):
+        (WebCore::boxForValue):
+        * css/CSSComputedStyleDeclaration.cpp: Return the computed style
+            for 'clip-path'.
+        (WebCore::ComputedStyleExtractor::propertyValue):
+        * css/DeprecatedStyleBuilder.cpp: Create CSSValueLists for 'clip-th'.
+        (WebCore::ApplyPropertyClipPath::applyValue):
+        * rendering/ClipPathOperation.h: Add bounding-box value.
+        (WebCore::ShapeClipPathOperation::pathForReferenceRect):
+        (WebCore::ShapeClipPathOperation::setReferenceBox):
+        (WebCore::ShapeClipPathOperation::referenceBox):
+        (WebCore::BoxClipPathOperation::create):
+        (WebCore::BoxClipPathOperation::pathForReferenceRect):
+        (WebCore::BoxClipPathOperation::referenceBox):
+        (WebCore::BoxClipPathOperation::BoxClipPathOperation):
+        * rendering/shapes/ShapeInfo.h: Add bounding-box value.
+        (WebCore::ShapeInfo::setShapeSize):
+        (WebCore::ShapeInfo::logicalTopOffset):
+        (WebCore::ShapeInfo::logicalLeftOffset):
+        * rendering/style/BasicShapes.cpp: Add bounding-box value.
+        (WebCore::BasicShape::referenceBoxSize):
+        * rendering/style/BasicShapes.h:
+
</ins><span class="cx"> 2014-01-02  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Always resolve style from root
</span></span></pre></div>
<a id="trunkSourceWebCorecssBasicShapeFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/BasicShapeFunctions.cpp (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/BasicShapeFunctions.cpp        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/css/BasicShapeFunctions.cpp        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -50,6 +50,8 @@
</span><span class="cx">         return cssValuePool().createIdentifierValue(CSSValueBorderBox);
</span><span class="cx">     case BasicShape::MarginBox:
</span><span class="cx">         return cssValuePool().createIdentifierValue(CSSValueMarginBox);
</span><ins>+    case BasicShape::BoundingBox:
+        return cssValuePool().createIdentifierValue(CSSValueBoundingBox);
</ins><span class="cx">     case BasicShape::None:
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="lines">@@ -71,6 +73,8 @@
</span><span class="cx">         return BasicShape::BorderBox;
</span><span class="cx">     case CSSValueMarginBox:
</span><span class="cx">         return BasicShape::MarginBox;
</span><ins>+    case CSSValueBoundingBox:
+        return BasicShape::BoundingBox;
</ins><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">         return BasicShape::None;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -4,6 +4,7 @@
</span><span class="cx">  * Copyright (C) 2007 Alexey Proskuryakov &lt;ap@webkit.org&gt;
</span><span class="cx">  * Copyright (C) 2007 Nicholas Shanks &lt;webkit@nickshanks.com&gt;
</span><span class="cx">  * Copyright (C) 2011 Sencha, Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Lesser General Public
</span><span class="lines">@@ -2859,18 +2860,29 @@
</span><span class="cx">             return counterToCSSValue(style.get(), propertyID);
</span><span class="cx">         case CSSPropertyCounterReset:
</span><span class="cx">             return counterToCSSValue(style.get(), propertyID);
</span><del>-        case CSSPropertyWebkitClipPath:
-            if (ClipPathOperation* operation = style-&gt;clipPath()) {
-                if (operation-&gt;type() == ClipPathOperation::SHAPE)
-                    return valueForBasicShape(style.get(), static_cast&lt;ShapeClipPathOperation*&gt;(operation)-&gt;basicShape());
</del><ins>+        case CSSPropertyWebkitClipPath: {
+            ClipPathOperation* operation = style-&gt;clipPath();
+            if (!operation)
+                return cssValuePool().createIdentifierValue(CSSValueNone);
</ins><span class="cx"> #if ENABLE(SVG)
</span><del>-                if (operation-&gt;type() == ClipPathOperation::REFERENCE) {
-                    ReferenceClipPathOperation* referenceOperation = static_cast&lt;ReferenceClipPathOperation*&gt;(operation);
-                    return CSSPrimitiveValue::create(referenceOperation-&gt;url(), CSSPrimitiveValue::CSS_URI);
-                }
</del><ins>+            if (operation-&gt;type() == ClipPathOperation::Reference) {
+                ReferenceClipPathOperation&amp; referenceOperation = toReferenceClipPathOperation(*operation);
+                return CSSPrimitiveValue::create(referenceOperation.url(), CSSPrimitiveValue::CSS_URI);
+            }
</ins><span class="cx"> #endif
</span><ins>+            RefPtr&lt;CSSValueList&gt; list = CSSValueList::createSpaceSeparated();
+            if (operation-&gt;type() == ClipPathOperation::Shape) {
+                ShapeClipPathOperation&amp; shapeOperation = toShapeClipPathOperation(*operation);
+                list-&gt;append(valueForBasicShape(style.get(), shapeOperation.basicShape()));
+                if (shapeOperation.referenceBox() != BasicShape::ReferenceBox::None)
+                    list-&gt;append(valueForBox(shapeOperation.referenceBox()));
</ins><span class="cx">             }
</span><del>-            return cssValuePool().createIdentifierValue(CSSValueNone);
</del><ins>+            if (operation-&gt;type() == ClipPathOperation::Box) {
+                BoxClipPathOperation&amp; boxOperation = toBoxClipPathOperation(*operation);
+                list-&gt;append(valueForBox(boxOperation.referenceBox()));
+            }
+            return list.release();
+        }
</ins><span class="cx"> #if ENABLE(CSS_REGIONS)
</span><span class="cx">         case CSSPropertyWebkitFlowInto:
</span><span class="cx">             if (style-&gt;flowThread().isNull())
</span></span></pre></div>
<a id="trunkSourceWebCorecssDeprecatedStyleBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><span class="cx">  * Copyright (C) 2013 Apple Inc. All rights reserved.
</span><ins>+ * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -2062,16 +2063,30 @@
</span><span class="cx">         }
</span><span class="cx">         if (!value-&gt;isValueList())
</span><span class="cx">             return;
</span><ins>+        BasicShape::ReferenceBox referenceBox = BasicShape::ReferenceBox::None;
+        RefPtr&lt;ClipPathOperation&gt; operation;
</ins><span class="cx">         auto&amp; valueList = toCSSValueList(*value);
</span><span class="cx">         for (unsigned i = 0; i &lt; valueList.length(); ++i) {
</span><del>-            // FIXME: &lt;box&gt; values are not supported yet.
-            // https://bugs.webkit.org/show_bug.cgi?id=126148
</del><span class="cx">             auto&amp; primitiveValue = toCSSPrimitiveValue(*valueList.itemWithoutBoundsCheck(i));
</span><del>-            if (!primitiveValue.isShape())
-                continue;
-            setValue(styleResolver-&gt;style(), ShapeClipPathOperation::create(basicShapeForValue(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), primitiveValue.getShapeValue())));
-            break;
</del><ins>+            if (primitiveValue.isShape() &amp;&amp; !operation)
+                operation = ShapeClipPathOperation::create(basicShapeForValue(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), primitiveValue.getShapeValue()));
+            else if ((primitiveValue.getValueID() == CSSValueContentBox
+                || primitiveValue.getValueID() == CSSValueBorderBox
+                || primitiveValue.getValueID() == CSSValuePaddingBox
+                || primitiveValue.getValueID() == CSSValueMarginBox
+                || primitiveValue.getValueID() == CSSValueBoundingBox)
+                &amp;&amp; referenceBox == BasicShape::ReferenceBox::None)
+                referenceBox = boxForValue(&amp;primitiveValue);
+            else
+                return;
</ins><span class="cx">         }
</span><ins>+        if (!operation) {
+            if (referenceBox == BasicShape::ReferenceBox::None)
+                return;
+            operation = BoxClipPathOperation::create(referenceBox);
+        } else
+            toShapeClipPathOperation(operation.get())-&gt;setReferenceBox(referenceBox);
+        setValue(styleResolver-&gt;style(), operation.release());
</ins><span class="cx">     }
</span><span class="cx">     static PropertyHandler createHandler()
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCSSPropertyAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx">         return to;
</span><span class="cx"> 
</span><span class="cx">     // Other clip-path operations than BasicShapes can not be animated.
</span><del>-    if (from-&gt;type() != ClipPathOperation::SHAPE || to-&gt;type() != ClipPathOperation::SHAPE)
</del><ins>+    if (from-&gt;type() != ClipPathOperation::Shape || to-&gt;type() != ClipPathOperation::Shape)
</ins><span class="cx">         return to;
</span><span class="cx"> 
</span><span class="cx">     const BasicShape* fromShape = static_cast&lt;ShapeClipPathOperation*&gt;(from)-&gt;basicShape();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingClipPathOperationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/ClipPathOperation.h (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/ClipPathOperation.h        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/rendering/ClipPathOperation.h        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
</del><ins>+ * Copyright (C) 2012, 2013 Adobe Systems Incorporated. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -42,8 +42,9 @@
</span><span class="cx"> class ClipPathOperation : public RefCounted&lt;ClipPathOperation&gt; {
</span><span class="cx"> public:
</span><span class="cx">     enum OperationType {
</span><del>-        REFERENCE,
-        SHAPE
</del><ins>+        Reference,
+        Shape,
+        Box
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     virtual ~ClipPathOperation() { }
</span><span class="lines">@@ -83,7 +84,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ReferenceClipPathOperation(const String&amp; url, const String&amp; fragment)
</span><del>-        : ClipPathOperation(REFERENCE)
</del><ins>+        : ClipPathOperation(Reference)
</ins><span class="cx">         , m_url(url)
</span><span class="cx">         , m_fragment(fragment)
</span><span class="cx">     {
</span><span class="lines">@@ -102,15 +103,19 @@
</span><span class="cx"> 
</span><span class="cx">     const BasicShape* basicShape() const { return m_shape.get(); }
</span><span class="cx">     WindRule windRule() const { return m_shape-&gt;windRule(); }
</span><del>-    const Path&amp; path(const FloatRect&amp; boundingRect)
</del><ins>+    const Path pathForReferenceRect(const FloatRect&amp; boundingRect) const
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(m_shape);
</span><del>-        m_path.clear();
-        m_path = adoptPtr(new Path);
-        m_shape-&gt;path(*m_path, boundingRect);
-        return *m_path;
</del><ins>+        // FIXME: Make clipping path from basic-shapes relative to &lt;box&gt; value.
+        // https://bugs.webkit.org/show_bug.cgi?id=126206
+        Path path;
+        m_shape-&gt;path(path, boundingRect);
+        return path;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    void setReferenceBox(BasicShape::ReferenceBox referenceBox) { m_referenceBox = referenceBox; }
+    BasicShape::ReferenceBox referenceBox() const { return m_referenceBox; }
+
</ins><span class="cx"> private:
</span><span class="cx">     virtual bool operator==(const ClipPathOperation&amp; o) const OVERRIDE
</span><span class="cx">     {
</span><span class="lines">@@ -121,14 +126,57 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     explicit ShapeClipPathOperation(PassRefPtr&lt;BasicShape&gt; shape)
</span><del>-        : ClipPathOperation(SHAPE)
</del><ins>+        : ClipPathOperation(Shape)
</ins><span class="cx">         , m_shape(shape)
</span><ins>+        , m_referenceBox(BasicShape::ReferenceBox::None)
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;BasicShape&gt; m_shape;
</span><del>-    OwnPtr&lt;Path&gt; m_path;
</del><ins>+    BasicShape::ReferenceBox m_referenceBox;
</ins><span class="cx"> };
</span><del>-}
</del><span class="cx"> 
</span><ins>+class BoxClipPathOperation : public ClipPathOperation {
+public:
+    static PassRefPtr&lt;BoxClipPathOperation&gt; create(BasicShape::ReferenceBox referenceBox)
+    {
+        return adoptRef(new BoxClipPathOperation(referenceBox));
+    }
+
+    const Path pathForReferenceRect(const FloatRect&amp;) const
+    {
+        Path path;
+        // FIXME: Create clipping path from &lt;box&gt;.
+        // https://bugs.webkit.org/show_bug.cgi?id=126205
+        return path;
+    }
+    BasicShape::ReferenceBox referenceBox() const { return m_referenceBox; }
+
+private:
+    virtual bool operator==(const ClipPathOperation&amp; o) const OVERRIDE
+    {
+        if (!isSameType(o))
+            return false;
+        const BoxClipPathOperation* other = static_cast&lt;const BoxClipPathOperation*&gt;(&amp;o);
+        return m_referenceBox == other-&gt;m_referenceBox;
+    }
+
+    explicit BoxClipPathOperation(BasicShape::ReferenceBox referenceBox)
+        : ClipPathOperation(Box)
+        , m_referenceBox(referenceBox)
+    {
+    }
+
+    BasicShape::ReferenceBox m_referenceBox;
+};
+
+#define CLIP_PATH_OPERATION_CASTS(ToValueTypeName, predicate) \
+    TYPE_CASTS_BASE(ToValueTypeName, ClipPathOperation, operation, operation-&gt;type() == ClipPathOperation::predicate, operation.type() == ClipPathOperation::predicate)
+
+CLIP_PATH_OPERATION_CASTS(ReferenceClipPathOperation, Reference)
+CLIP_PATH_OPERATION_CASTS(ShapeClipPathOperation, Shape)
+CLIP_PATH_OPERATION_CASTS(BoxClipPathOperation, Box)
+
+} // namespace WebCore
+
</ins><span class="cx"> #endif // ClipPathOperation_h
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -3916,7 +3916,7 @@
</span><span class="cx">     RenderStyle&amp; style = renderer().style();
</span><span class="cx"> 
</span><span class="cx">     ASSERT(style.clipPath());
</span><del>-    if (style.clipPath()-&gt;type() == ClipPathOperation::SHAPE) {
</del><ins>+    if (style.clipPath()-&gt;type() == ClipPathOperation::Shape) {
</ins><span class="cx">         ShapeClipPathOperation* clipPath = static_cast&lt;ShapeClipPathOperation*&gt;(style.clipPath());
</span><span class="cx"> 
</span><span class="cx">         if (!rootRelativeBoundsComputed) {
</span><span class="lines">@@ -3925,12 +3925,12 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         context-&gt;save();
</span><del>-        context-&gt;clipPath(clipPath-&gt;path(rootRelativeBounds), clipPath-&gt;windRule());
</del><ins>+        context-&gt;clipPath(clipPath-&gt;pathForReferenceRect(rootRelativeBounds), clipPath-&gt;windRule());
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SVG)
</span><del>-    if (style.clipPath()-&gt;type() == ClipPathOperation::REFERENCE) {
</del><ins>+    if (style.clipPath()-&gt;type() == ClipPathOperation::Reference) {
</ins><span class="cx">         ReferenceClipPathOperation* referenceClipPathOperation = static_cast&lt;ReferenceClipPathOperation*&gt;(style.clipPath());
</span><span class="cx">         Element* element = renderer().document().getElementById(referenceClipPathOperation-&gt;fragment());
</span><span class="cx">         if (element &amp;&amp; element-&gt;hasTagName(SVGNames::clipPathTag) &amp;&amp; element-&gt;renderer()) {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesShapeInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/ShapeInfo.h (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/ShapeInfo.h        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/rendering/shapes/ShapeInfo.h        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -89,6 +89,7 @@
</span><span class="cx">             logicalHeight -= m_renderer.borderAndPaddingLogicalHeight();
</span><span class="cx">             logicalWidth -= m_renderer.borderAndPaddingLogicalWidth();
</span><span class="cx">             break;
</span><ins>+        case BasicShape::BoundingBox:
</ins><span class="cx">         case BasicShape::None:
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="cx">             break;
</span><span class="lines">@@ -175,6 +176,7 @@
</span><span class="cx">         case BasicShape::BorderBox: return LayoutUnit();
</span><span class="cx">         case BasicShape::PaddingBox: return m_renderer.borderBefore();
</span><span class="cx">         case BasicShape::ContentBox: return m_renderer.borderAndPaddingBefore();
</span><ins>+        case BasicShape::BoundingBox: break;
</ins><span class="cx">         case BasicShape::None: break;
</span><span class="cx">         }
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="lines">@@ -191,6 +193,7 @@
</span><span class="cx">         case BasicShape::BorderBox: return LayoutUnit();
</span><span class="cx">         case BasicShape::PaddingBox: return m_renderer.borderStart();
</span><span class="cx">         case BasicShape::ContentBox: return m_renderer.borderAndPaddingStart();
</span><ins>+        case BasicShape::BoundingBox: break;
</ins><span class="cx">         case BasicShape::None: break;
</span><span class="cx">         }
</span><span class="cx">         ASSERT_NOT_REACHED();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleBasicShapescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/BasicShapes.cpp (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/BasicShapes.cpp        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/rendering/style/BasicShapes.cpp        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -86,6 +86,8 @@
</span><span class="cx">     case MarginBox:
</span><span class="cx">         return FloatSize(renderer.marginLeft() + renderer.width() + renderer.marginRight(),
</span><span class="cx">             renderer.marginTop() + renderer.height() + renderer.marginBottom());
</span><ins>+    case BoundingBox:
+        break;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ASSERT_NOT_REACHED();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleBasicShapesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/BasicShapes.h (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/BasicShapes.h        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/rendering/style/BasicShapes.h        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -63,7 +63,8 @@
</span><span class="cx">         ContentBox,
</span><span class="cx">         PaddingBox,
</span><span class="cx">         BorderBox,
</span><del>-        MarginBox
</del><ins>+        MarginBox,
+        BoundingBox
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     bool canBlend(const BasicShape*) const;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingsvgSVGRenderingContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp (161208 => 161209)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp        2014-01-02 15:51:59 UTC (rev 161208)
+++ trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp        2014-01-02 18:11:51 UTC (rev 161209)
</span><span class="lines">@@ -123,9 +123,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     ClipPathOperation* clipPathOperation = style.clipPath();
</span><del>-    if (clipPathOperation &amp;&amp; clipPathOperation-&gt;type() == ClipPathOperation::SHAPE) {
</del><ins>+    if (clipPathOperation &amp;&amp; clipPathOperation-&gt;type() == ClipPathOperation::Shape) {
</ins><span class="cx">         ShapeClipPathOperation* clipPath = static_cast&lt;ShapeClipPathOperation*&gt;(clipPathOperation);
</span><del>-        m_paintInfo-&gt;context-&gt;clipPath(clipPath-&gt;path(renderer.objectBoundingBox()), clipPath-&gt;windRule());
</del><ins>+        m_paintInfo-&gt;context-&gt;clipPath(clipPath-&gt;pathForReferenceRect(renderer.objectBoundingBox()), clipPath-&gt;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>