<!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>[160007] 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/160007">160007</a></dd>
<dt>Author</dt> <dd>rwlbuis@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-03 09:18:01 -0800 (Tue, 03 Dec 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>[css shapes] layout for new ellipse syntax
https://bugs.webkit.org/show_bug.cgi?id=124621

Source/WebCore:

Reviewed by Dirk Schulze.

Implement support for doing layout with the new ellipse shape syntax,
including basic animation support.

Test: fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-000.html

* rendering/shapes/Shape.cpp:
(WebCore::Shape::createShape): Convert new ellipse to a layout shape.
* rendering/style/BasicShapes.cpp:
(WebCore::BasicShape::canBlend): Ignore ellipses with values that
    cannot be interpolated.
(WebCore::BasicShapeEllipse::floatValueForRadiusInBox): Helper function to calculate
    either radiusX or radiusY, shared by clip-path and shape code paths.
(WebCore::BasicShapeEllipse::path):
* rendering/style/BasicShapes.h:

LayoutTests:

Add a new test for the new ellipse syntax. Also update existing shape-inside, animation, and clip-path tests to
test the new ellipse syntax for clipping and shape-inside.

Reviewed by Dirk Schulze.

* animations/resources/animation-test-helpers.js:
(parseBasicShape):
* css3/masking/clip-path-animation-expected.txt:
* css3/masking/clip-path-animation.html:
* css3/masking/clip-path-ellipse.html:
* fast/shapes/shape-inside/shape-inside-animation-expected.txt:
* fast/shapes/shape-inside/shape-inside-animation.html:
* fast/shapes/shape-inside/shape-inside-ellipse-padding.html:
* fast/shapes/shape-inside/shape-inside-ellipse.html:
* fast/shapes/shape-inside/shape-inside-empty-expected.html:
* fast/shapes/shape-inside/shape-inside-empty.html:
* fast/shapes/shape-outside-floats/shape-outside-animation-expected.txt:
* fast/shapes/shape-outside-floats/shape-outside-animation.html:
* fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-000-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-000.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsanimationsresourcesanimationtesthelpersjs">trunk/LayoutTests/animations/resources/animation-test-helpers.js</a></li>
<li><a href="#trunkLayoutTestscss3maskingclippathanimationexpectedtxt">trunk/LayoutTests/css3/masking/clip-path-animation-expected.txt</a></li>
<li><a href="#trunkLayoutTestscss3maskingclippathanimationhtml">trunk/LayoutTests/css3/masking/clip-path-animation.html</a></li>
<li><a href="#trunkLayoutTestscss3maskingclippathellipsehtml">trunk/LayoutTests/css3/masking/clip-path-ellipse.html</a></li>
<li><a href="#trunkLayoutTestsfastshapesshapeinsideshapeinsideanimationexpectedtxt">trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-animation-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastshapesshapeinsideshapeinsideanimationhtml">trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-animation.html</a></li>
<li><a href="#trunkLayoutTestsfastshapesshapeinsideshapeinsideellipsepaddinghtml">trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-ellipse-padding.html</a></li>
<li><a href="#trunkLayoutTestsfastshapesshapeinsideshapeinsideellipsehtml">trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-ellipse.html</a></li>
<li><a href="#trunkLayoutTestsfastshapesshapeinsideshapeinsideemptyexpectedhtml">trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-empty-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastshapesshapeinsideshapeinsideemptyhtml">trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-empty.html</a></li>
<li><a href="#trunkLayoutTestsfastshapesshapeoutsidefloatsshapeoutsideanimationexpectedtxt">trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-animation-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastshapesshapeoutsidefloatsshapeoutsideanimationhtml">trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-animation.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingshapesShapecpp">trunk/Source/WebCore/rendering/shapes/Shape.cpp</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>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastshapesshapeoutsidefloatsshapeoutsidefloatsellipse000expectedhtml">trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-000-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastshapesshapeoutsidefloatsshapeoutsidefloatsellipse000html">trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-000.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/LayoutTests/ChangeLog        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2013-12-03  Rob Buis  &lt;rob.buis@samsung.com&gt;
+
+        [css shapes] layout for new ellipse syntax
+        https://bugs.webkit.org/show_bug.cgi?id=124621
+
+        Add a new test for the new ellipse syntax. Also update existing shape-inside, animation, and clip-path tests to
+        test the new ellipse syntax for clipping and shape-inside.
+
+        Reviewed by Dirk Schulze.
+
+        * animations/resources/animation-test-helpers.js:
+        (parseBasicShape):
+        * css3/masking/clip-path-animation-expected.txt:
+        * css3/masking/clip-path-animation.html:
+        * css3/masking/clip-path-ellipse.html:
+        * fast/shapes/shape-inside/shape-inside-animation-expected.txt:
+        * fast/shapes/shape-inside/shape-inside-animation.html:
+        * fast/shapes/shape-inside/shape-inside-ellipse-padding.html:
+        * fast/shapes/shape-inside/shape-inside-ellipse.html:
+        * fast/shapes/shape-inside/shape-inside-empty-expected.html:
+        * fast/shapes/shape-inside/shape-inside-empty.html:
+        * fast/shapes/shape-outside-floats/shape-outside-animation-expected.txt:
+        * fast/shapes/shape-outside-floats/shape-outside-animation.html:
+        * fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-000-expected.html: Added.
+        * fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-000.html: Added.
+
</ins><span class="cx"> 2013-12-03  Frédéric Wang  &lt;fred.wang@free.fr&gt;
</span><span class="cx"> 
</span><span class="cx">         Add an MathMLSelectElement class to implement &lt;maction&gt; and &lt;semantics&gt;.
</span></span></pre></div>
<a id="trunkLayoutTestsanimationsresourcesanimationtesthelpersjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/animations/resources/animation-test-helpers.js (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/animations/resources/animation-test-helpers.js        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/LayoutTests/animations/resources/animation-test-helpers.js        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -219,7 +219,7 @@
</span><span class="cx">         matches = s.match(&quot;circle\\((.*)\\s+at\\s+(.*)\\s+(.*)\\)&quot;);
</span><span class="cx">         break;
</span><span class="cx">     case &quot;ellipse&quot;:
</span><del>-        matches = s.match(&quot;ellipse\\((.*)\\s*,\\s*(.*)\\s*,\\s*(.*)\\,\\s*(.*)\\)&quot;);
</del><ins>+        matches = s.match(&quot;ellipse\\((.*)\\s+(.*)\\s+at\\s+(.*)\\s+(.*)\\)&quot;);
</ins><span class="cx">         break;
</span><span class="cx">     case &quot;polygon&quot;:
</span><span class="cx">         matches = s.match(&quot;polygon\\(nonzero, (.*)\\s+(.*)\\s*,\\s*(.*)\\s+(.*)\\s*,\\s*(.*)\\s+(.*)\\s*,\\s*(.*)\\s+(.*)\\)&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestscss3maskingclippathanimationexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/masking/clip-path-animation-expected.txt (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/masking/clip-path-animation-expected.txt        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/LayoutTests/css3/masking/clip-path-animation-expected.txt        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx">     
</span><span class="cx"> PASS - &quot;webkitClipPath&quot; property for &quot;rectangle-box&quot; element at 1s saw something close to: rectangle(10%, 10%, 80%, 80%, 0px, 0px)
</span><span class="cx"> PASS - &quot;webkitClipPath&quot; property for &quot;circle-box&quot; element at 1s saw something close to: circle(35% at 35% 35%)
</span><del>-PASS - &quot;webkitClipPath&quot; property for &quot;ellipse-box&quot; element at 1s saw something close to: ellipse(35%, 35%, 35%, 30%)
</del><ins>+PASS - &quot;webkitClipPath&quot; property for &quot;ellipse-box&quot; element at 1s saw something close to: ellipse(35% 30% at 35% 35%)
</ins><span class="cx"> PASS - &quot;webkitClipPath&quot; property for &quot;polygon-box&quot; element at 1s saw something close to: polygon(nonzero, 10% 10%, 90% 10%, 90% 90%, 10% 90%)
</span><span class="cx"> PASS - &quot;webkitClipPath&quot; property for &quot;none-box&quot; element at 1s saw something close to: polygon(nonzero, 20% 20%, 80% 20%, 80% 80%, 20% 80%)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestscss3maskingclippathanimationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/masking/clip-path-animation.html (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/masking/clip-path-animation.html        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/LayoutTests/css3/masking/clip-path-animation.html        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -42,8 +42,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     @-webkit-keyframes ellipse-anim {
</span><del>-        from { -webkit-clip-path: ellipse(50%, 50%, 50%, 40%); }
-        to   { -webkit-clip-path: ellipse(20%, 20%, 20%, 20%); }
</del><ins>+        from { -webkit-clip-path: ellipse(50% 40% at 50% 50%); }
+        to   { -webkit-clip-path: ellipse(20% 20% at 20% 20%); }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     @-webkit-keyframes polygon-anim {
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">       // [animation-name, time, element-id, property, expected-value, tolerance]
</span><span class="cx">       [&quot;rectangle-anim&quot;,  1, &quot;rectangle-box&quot;, &quot;webkitClipPath&quot;, &quot;rectangle(10%, 10%, 80%, 80%, 0px, 0px)&quot;, 0.05],
</span><span class="cx">       [&quot;circle-anim&quot;,  1, &quot;circle-box&quot;, &quot;webkitClipPath&quot;, &quot;circle(35% at 35% 35%)&quot;, 0.05],
</span><del>-      [&quot;ellipse-anim&quot;,  1, &quot;ellipse-box&quot;, &quot;webkitClipPath&quot;, &quot;ellipse(35%, 35%, 35%, 30%)&quot;, 0.05],
</del><ins>+      [&quot;ellipse-anim&quot;,  1, &quot;ellipse-box&quot;, &quot;webkitClipPath&quot;, &quot;ellipse(35% 30% at 35% 35%)&quot;, 0.05],
</ins><span class="cx">       [&quot;polygon-anim&quot;,  1, &quot;polygon-box&quot;, &quot;webkitClipPath&quot;, &quot;polygon(nonzero, 10% 10%, 90% 10%, 90% 90%, 10% 90%)&quot;, 0.05],
</span><span class="cx">       [&quot;none-anim&quot;,  1, &quot;none-box&quot;, &quot;webkitClipPath&quot;, &quot;polygon(nonzero, 20% 20%, 80% 20%, 80% 80%, 20% 80%)&quot;, 0],
</span><span class="cx">     ];
</span></span></pre></div>
<a id="trunkLayoutTestscss3maskingclippathellipsehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/css3/masking/clip-path-ellipse.html (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/masking/clip-path-ellipse.html        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/LayoutTests/css3/masking/clip-path-ellipse.html        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -6,11 +6,11 @@
</span><span class="cx">     width: 200px;
</span><span class="cx">     height: 200px;
</span><span class="cx">     background-color: green;
</span><del>-    -webkit-clip-path: ellipse(100px, 100px, 100px, 75px);
</del><ins>+    -webkit-clip-path: ellipse(100px 75px at 100px 100px);
</ins><span class="cx"> }
</span><span class="cx"> &lt;/style&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx"> &lt;div&gt;
</span><span class="cx"> &lt;/body&gt;
</span><del>-&lt;/html&gt;
</del><span class="cx">\ No newline at end of file
</span><ins>+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastshapesshapeinsideshapeinsideanimationexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-animation-expected.txt (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-animation-expected.txt        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-animation-expected.txt        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -1,6 +1,6 @@
</span><span class="cx"> Moving Text Moving Text Moving Text Moving Text
</span><span class="cx"> PASS - &quot;webkitShapeInside&quot; property for &quot;rectangle-box&quot; element at 1s saw something close to: rectangle(10%, 10%, 80%, 80%, 0px, 0px)
</span><span class="cx"> PASS - &quot;webkitShapeInside&quot; property for &quot;circle-box&quot; element at 1s saw something close to: circle(35% at 35% 35%)
</span><del>-PASS - &quot;webkitShapeInside&quot; property for &quot;ellipse-box&quot; element at 1s saw something close to: ellipse(35%, 35%, 35%, 30%)
</del><ins>+PASS - &quot;webkitShapeInside&quot; property for &quot;ellipse-box&quot; element at 1s saw something close to: ellipse(35% 30% at 35% 35%)
</ins><span class="cx"> PASS - &quot;webkitShapeInside&quot; property for &quot;polygon-box&quot; element at 1s saw something close to: polygon(nonzero, 10% 10%, 90% 10%, 90% 90%, 10% 90%)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesshapeinsideshapeinsideanimationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-animation.html (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-animation.html        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-animation.html        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -38,8 +38,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     @-webkit-keyframes ellipse-anim {
</span><del>-        from { -webkit-shape-inside: ellipse(50%, 50%, 50%, 40%); }
-        to   { -webkit-shape-inside: ellipse(20%, 20%, 20%, 20%); }
</del><ins>+        from { -webkit-shape-inside: ellipse(50% 40% at 50% 50%); }
+        to   { -webkit-shape-inside: ellipse(20% 20% at 20% 20%); }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     @-webkit-keyframes polygon-anim {
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">       // [animation-name, time, element-id, property, expected-value, tolerance]
</span><span class="cx">       [&quot;rectangle-anim&quot;,  1, &quot;rectangle-box&quot;, &quot;webkitShapeInside&quot;, &quot;rectangle(10%, 10%, 80%, 80%, 0px, 0px)&quot;, 0.05],
</span><span class="cx">       [&quot;circle-anim&quot;,  1, &quot;circle-box&quot;, &quot;webkitShapeInside&quot;, &quot;circle(35% at 35% 35%)&quot;, 0.05],
</span><del>-      [&quot;ellipse-anim&quot;,  1, &quot;ellipse-box&quot;, &quot;webkitShapeInside&quot;, &quot;ellipse(35%, 35%, 35%, 30%)&quot;, 0.05],
</del><ins>+      [&quot;ellipse-anim&quot;,  1, &quot;ellipse-box&quot;, &quot;webkitShapeInside&quot;, &quot;ellipse(35% 30% at 35% 35%)&quot;, 0.05],
</ins><span class="cx">       [&quot;polygon-anim&quot;,  1, &quot;polygon-box&quot;, &quot;webkitShapeInside&quot;, &quot;polygon(nonzero, 10% 10%, 90% 10%, 90% 90%, 10% 90%)&quot;, 0.05],
</span><span class="cx">     ];
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesshapeinsideshapeinsideellipsepaddinghtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-ellipse-padding.html (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-ellipse-padding.html        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-ellipse-padding.html        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx">         position: relative;
</span><span class="cx">         width: 500px;
</span><span class="cx">         height: 500px;
</span><del>-        -webkit-shape-inside: ellipse(220px, 220px, 250px, 150px);
</del><ins>+        -webkit-shape-inside: ellipse(250px 150px at 220px 220px);
</ins><span class="cx">         -webkit-shape-padding: 50px;
</span><span class="cx">         font: 178px/1 Ahem, sans-serif;
</span><span class="cx">         color: green;
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesshapeinsideshapeinsideellipsehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-ellipse.html (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-ellipse.html        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-ellipse.html        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -12,7 +12,7 @@
</span><span class="cx">         position: relative;
</span><span class="cx">         width: 500px;
</span><span class="cx">         height: 500px;
</span><del>-        -webkit-shape-inside: ellipse(220px, 220px, 200px, 100px);
</del><ins>+        -webkit-shape-inside: ellipse(200px 100px at 220px 220px);
</ins><span class="cx">         font: 178px/1 Ahem, sans-serif;
</span><span class="cx">         color: green;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesshapeinsideshapeinsideemptyexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-empty-expected.html (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-empty-expected.html        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-empty-expected.html        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -24,10 +24,10 @@
</span><span class="cx">         &lt;p&gt;This text should be pushed down below the green rectangle. (There is a circle(0px at 0px 0px) shape-inside CSS property on the green rectangle.)&lt;/p&gt;
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx">     &lt;div&gt;
</span><del>-        &lt;p&gt;This text should be pushed down below the green rectangle. (There is an ellipse(0px, 0px, 0px, 1em) shape-inside CSS property on the green rectangle.)&lt;/p&gt;
</del><ins>+        &lt;p&gt;This text should be pushed down below the green rectangle. (There is an ellipse(0px 1em at 0px 0px) shape-inside CSS property on the green rectangle.)&lt;/p&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx">     &lt;div&gt;
</span><del>-        &lt;p&gt;This text should be pushed down below the green rectangle. (There is an ellipse(0px, 0px, 1em, 0px) shape-inside CSS property on the green rectangle.)&lt;/p&gt;
</del><ins>+        &lt;p&gt;This text should be pushed down below the green rectangle. (There is an ellipse(1em 0px at 0px 0px) shape-inside CSS property on the green rectangle.)&lt;/p&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx">     &lt;div&gt;
</span><span class="cx">         &lt;p&gt;This text should be pushed down below the green rectangle. (There is a polygon(0px 0px) shape-inside CSS property on the green rectangle.)&lt;/p&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesshapeinsideshapeinsideemptyhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-empty.html (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-empty.html        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/LayoutTests/fast/shapes/shape-inside/shape-inside-empty.html        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -23,11 +23,11 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     #shape-inside-ellipse-radiusX0 {
</span><del>-        -webkit-shape-inside: ellipse(0px, 0px, 0px, 1em);
</del><ins>+        -webkit-shape-inside: ellipse(0px 1em at 0px 0px);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     #shape-inside-ellipse-radiusY0 {
</span><del>-        -webkit-shape-inside: ellipse(0px, 0px, 1em, 0px);
</del><ins>+        -webkit-shape-inside: ellipse(1em 0px at 0px 0px);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     #shape-inside-polygon-1vertex {
</span><span class="lines">@@ -51,10 +51,10 @@
</span><span class="cx">         This text should be pushed down below the green rectangle. (There is a circle(0px at 0px 0px) shape-inside CSS property on the green rectangle.)
</span><span class="cx">     &lt;/p&gt;
</span><span class="cx">     &lt;p id=&quot;shape-inside-ellipse-radiusX0&quot;&gt;
</span><del>-        This text should be pushed down below the green rectangle. (There is an ellipse(0px, 0px, 0px, 1em) shape-inside CSS property on the green rectangle.)
</del><ins>+        This text should be pushed down below the green rectangle. (There is an ellipse(0px 1em at 0px 0px) shape-inside CSS property on the green rectangle.)
</ins><span class="cx">     &lt;/p&gt;
</span><span class="cx">     &lt;p id=&quot;shape-inside-ellipse-radiusY0&quot;&gt;
</span><del>-        This text should be pushed down below the green rectangle. (There is an ellipse(0px, 0px, 1em, 0px) shape-inside CSS property on the green rectangle.)
</del><ins>+        This text should be pushed down below the green rectangle. (There is an ellipse(1em 0px at 0px 0px) shape-inside CSS property on the green rectangle.)
</ins><span class="cx">     &lt;/p&gt;
</span><span class="cx">     &lt;p id=&quot;shape-inside-polygon-1vertex&quot;&gt;
</span><span class="cx">         This text should be pushed down below the green rectangle. (There is a polygon(0px 0px) shape-inside CSS property on the green rectangle.)
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesshapeoutsidefloatsshapeoutsideanimationexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-animation-expected.txt (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-animation-expected.txt        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-animation-expected.txt        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -4,6 +4,6 @@
</span><span class="cx"> Moving Text
</span><span class="cx"> PASS - &quot;webkitShapeOutside&quot; property for &quot;rectangle-box&quot; element at 1s saw something close to: rectangle(10%, 10%, 80%, 80%, 0px, 0px)
</span><span class="cx"> PASS - &quot;webkitShapeOutside&quot; property for &quot;circle-box&quot; element at 1s saw something close to: circle(35% at 35% 35%)
</span><del>-PASS - &quot;webkitShapeOutside&quot; property for &quot;ellipse-box&quot; element at 1s saw something close to: ellipse(35%, 35%, 35%, 30%)
</del><ins>+PASS - &quot;webkitShapeOutside&quot; property for &quot;ellipse-box&quot; element at 1s saw something close to: ellipse(35% 30% at 35% 35%)
</ins><span class="cx"> PASS - &quot;webkitShapeOutside&quot; property for &quot;polygon-box&quot; element at 1s saw something close to: polygon(nonzero, 10% 10%, 90% 10%, 90% 90%, 10% 90%)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesshapeoutsidefloatsshapeoutsideanimationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-animation.html (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-animation.html        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-animation.html        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -42,8 +42,8 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     @-webkit-keyframes ellipse-anim {
</span><del>-        from { -webkit-shape-outside: ellipse(50%, 50%, 50%, 40%); }
-        to   { -webkit-shape-outside: ellipse(20%, 20%, 20%, 20%); }
</del><ins>+        from { -webkit-shape-outside: ellipse(50% 40% at 50% 50%); }
+        to   { -webkit-shape-outside: ellipse(20% 20% at 20% 20%); }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     @-webkit-keyframes polygon-anim {
</span><span class="lines">@@ -58,7 +58,7 @@
</span><span class="cx">       // [animation-name, time, element-id, property, expected-value, tolerance]
</span><span class="cx">       [&quot;rectangle-anim&quot;,  1, &quot;rectangle-box&quot;, &quot;webkitShapeOutside&quot;, &quot;rectangle(10%, 10%, 80%, 80%, 0px, 0px)&quot;, 0.05],
</span><span class="cx">       [&quot;circle-anim&quot;,  1, &quot;circle-box&quot;, &quot;webkitShapeOutside&quot;, &quot;circle(35% at 35% 35%)&quot;, 0.05],
</span><del>-      [&quot;ellipse-anim&quot;,  1, &quot;ellipse-box&quot;, &quot;webkitShapeOutside&quot;, &quot;ellipse(35%, 35%, 35%, 30%)&quot;, 0.05],
</del><ins>+      [&quot;ellipse-anim&quot;,  1, &quot;ellipse-box&quot;, &quot;webkitShapeOutside&quot;, &quot;ellipse(35% 30% at 35% 35%)&quot;, 0.05],
</ins><span class="cx">       [&quot;polygon-anim&quot;,  1, &quot;polygon-box&quot;, &quot;webkitShapeOutside&quot;, &quot;polygon(nonzero, 10% 10%, 90% 10%, 90% 90%, 10% 90%)&quot;, 0.05],
</span><span class="cx">     ];
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesshapeoutsidefloatsshapeoutsidefloatsellipse000expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-000-expected.html (0 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-000-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-000-expected.html        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -0,0 +1,90 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;style&gt;
+.container {
+    position: relative;
+    font: 20px/1 Ahem, sans-serif;
+    width: 500px;
+    height: 200px;
+    border: 1px solid black;
+}
+
+.ellipse {
+    z-index: -1;
+    width: 320px;
+    height: 160px;
+    border-radius: 160px / 80px;
+    background-color: blue;
+    overflow: hidden;
+}
+
+#left-ellipse-outline {
+    position: absolute;
+    top: 20px;
+    left: 0px;
+}
+
+#right-ellipse-outline {
+    position: absolute;
+    top: 20px;
+    right: 0px;
+}
+
+.left-ellipse-float-line {
+    float: left;
+    clear: left;
+    height: 20px;
+}
+
+.right-ellipse-float-line {
+    float: right;
+    clear: right;
+    height: 20px;
+}
+&lt;/style&gt;
+&lt;body&gt;
+&lt;p&gt;The black squares should trace the right side of the ellipse's blue outline.&lt;/p&gt;
+&lt;div class=&quot;container&quot;&gt;
+X&lt;br/&gt;
+    &lt;div id=&quot;left-ellipse-outline&quot; class=&quot;ellipse&quot;&gt;&lt;/div&gt;
+    &lt;!--  generated left-rounded-rect-float-line divs will be inserted here  --&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X
+&lt;/div&gt;
+
+&lt;p&gt;The black squares should trace the left side of the ellipse's blue outline.&lt;/p&gt;
+&lt;div class=&quot;container&quot; style=&quot;text-align: right&quot;&gt;
+X&lt;br/&gt;
+    &lt;div id=&quot;right-ellipse-outline&quot; class=&quot;ellipse&quot;&gt;&lt;/div&gt;
+    &lt;!--  generated right-rounded-rect-float-line divs will be inserted here  --&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X
+&lt;/div&gt;
+
+&lt;script src=&quot;../resources/rounded-rectangle.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/subpixel-utils.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+genLeftRightRoundedRectFloatShapeOutsideRefTest({
+    roundedRect: {x: 0, y: 20, width: 320, height: 160, rx: 160, ry: 80},
+    containerWidth: 500,
+    containerHeight: 200,
+    lineHeight: 20,
+    floatElementClassSuffix: &quot;ellipse-float-line&quot;,
+    insertElementIdSuffix: &quot;ellipse-outline&quot;
+});
+&lt;/script&gt;
+
+&lt;/body&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastshapesshapeoutsidefloatsshapeoutsidefloatsellipse000html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-000.html (0 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-000.html                                (rev 0)
+++ trunk/LayoutTests/fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-000.html        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;title&gt;CSS Test: circle shape-outside on floats&lt;/title&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Adobe&quot; href=&quot;http://html.adobe.com/&quot;&gt;
+&lt;link rel=&quot;author&quot; title=&quot;Bem Jones-Bey&quot; href=&quot;mailto:bjonesbe@adobe.com&quot;&gt;
+&lt;link rel=&quot;help&quot; href=&quot;http://dev.w3.org/csswg/css-shapes-1/#shape-outside-property&quot;&gt;
+&lt;link rel=&quot;match&quot; href=&quot;shape-outside-floats-ellipse-000-ref.html&quot;&gt;
+&lt;meta name=&quot;flags&quot; content=&quot;ahem&quot;&gt;
+&lt;style&gt;
+.container {
+    font: 20px/1 Ahem, sans-serif;
+    width: 500px;
+    height: 200px; 
+    border: 1px solid black;
+}
+
+.ellipse {
+    width: 320px;
+    height: 160px;
+    background-color: blue;
+    overflow: hidden;
+    border-radius: 160px / 80px;
+    -webkit-shape-outside: ellipse(160px 80px at 160px 80px);
+}
+&lt;/style&gt;
+
+&lt;body&gt;
+&lt;p&gt;The black squares should trace the right side of the ellipse's blue outline.&lt;/p&gt;
+&lt;div class=&quot;container&quot;&gt;
+X&lt;br/&gt;
+    &lt;div style=&quot;float: left&quot; class=&quot;ellipse&quot;&gt;&lt;/div&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X
+&lt;/div&gt;
+
+&lt;p&gt;The black squares should trace the left side of the ellipse's blue outline.&lt;/p&gt;
+&lt;div class=&quot;container&quot; style=&quot;text-align: right&quot;&gt;
+X&lt;br/&gt;
+    &lt;div style=&quot;float: right&quot; class=&quot;ellipse&quot;&gt;&lt;/div&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X&lt;br/&gt;
+X
+&lt;/div&gt;
+&lt;/body&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/Source/WebCore/ChangeLog        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2013-12-03  Rob Buis  &lt;rob.buis@samsung.com&gt;
+
+        [css shapes] layout for new ellipse syntax
+        https://bugs.webkit.org/show_bug.cgi?id=124621
+
+        Reviewed by Dirk Schulze.
+
+        Implement support for doing layout with the new ellipse shape syntax,
+        including basic animation support.
+
+        Test: fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-000.html
+
+        * rendering/shapes/Shape.cpp:
+        (WebCore::Shape::createShape): Convert new ellipse to a layout shape.
+        * rendering/style/BasicShapes.cpp:
+        (WebCore::BasicShape::canBlend): Ignore ellipses with values that
+            cannot be interpolated.
+        (WebCore::BasicShapeEllipse::floatValueForRadiusInBox): Helper function to calculate
+            either radiusX or radiusY, shared by clip-path and shape code paths.
+        (WebCore::BasicShapeEllipse::path):
+        * rendering/style/BasicShapes.h:
+
</ins><span class="cx"> 2013-12-03  Frédéric Wang  &lt;fred.wang@free.fr&gt;
</span><span class="cx"> 
</span><span class="cx">         Add an MathMLSelectElement class to implement &lt;maction&gt; and &lt;semantics&gt;.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesShapecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/Shape.cpp (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/Shape.cpp        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/Source/WebCore/rendering/shapes/Shape.cpp        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -175,8 +175,14 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     case BasicShape::BasicShapeEllipseType: {
</span><del>-        // FIXME: Layout implementation needed. See bug https://bugs.webkit.org/show_bug.cgi?id=125079
-        shape = createRectangleShape(FloatRect(0, 0, boxWidth, boxHeight), FloatSize());
</del><ins>+        const BasicShapeEllipse* ellipse = static_cast&lt;const BasicShapeEllipse*&gt;(basicShape);
+        float centerX = floatValueForCenterCoordinate(ellipse-&gt;centerX(), boxWidth);
+        float centerY = floatValueForCenterCoordinate(ellipse-&gt;centerY(), boxHeight);
+        float radiusX = ellipse-&gt;floatValueForRadiusInBox(ellipse-&gt;radiusX(), centerX, boxWidth);
+        float radiusY = ellipse-&gt;floatValueForRadiusInBox(ellipse-&gt;radiusY(), centerY, boxHeight);
+        FloatPoint logicalCenter = physicalPointToLogical(FloatPoint(centerX, centerY), logicalBoxSize.height(), writingMode);
+
+        shape = createShapeEllipse(logicalCenter, FloatSize(radiusX, radiusY));
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleBasicShapescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/BasicShapes.cpp (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/BasicShapes.cpp        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/Source/WebCore/rendering/style/BasicShapes.cpp        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -59,7 +59,17 @@
</span><span class="cx">             return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return true;
</del><ins>+    // Ellipses with keywords for radii or center coordinates cannot be animated.
+    if (type() != BasicShape::BasicShapeEllipseType)
+        return true;
+
+    const BasicShapeEllipse* thisEllipse = static_cast&lt;const BasicShapeEllipse*&gt;(this);
+    const BasicShapeEllipse* otherEllipse = static_cast&lt;const BasicShapeEllipse*&gt;(other);
+    if (!thisEllipse-&gt;radiusX().canBlend(otherEllipse-&gt;radiusX())
+        || !thisEllipse-&gt;radiusY().canBlend(otherEllipse-&gt;radiusY())
+        || !thisEllipse-&gt;centerX().canBlend(otherEllipse-&gt;centerX())
+        || !thisEllipse-&gt;centerY().canBlend(otherEllipse-&gt;centerY()))
+        return false;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void BasicShapeRectangle::path(Path&amp; path, const FloatRect&amp; boundingBox)
</span><span class="lines">@@ -191,22 +201,26 @@
</span><span class="cx">     return result.release();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+float BasicShapeEllipse::floatValueForRadiusInBox(const BasicShapeRadius&amp; radius, float center, float boxWidthOrHeight) const
+{
+    if (radius.type() == BasicShapeRadius::Value)
+        return floatValueForLength(radius.value(), boxWidthOrHeight);
+
+    if (radius.type() == BasicShapeRadius::ClosestSide)
+        return std::min(center, boxWidthOrHeight - center);
+
+    ASSERT(radius.type() == BasicShapeRadius::FarthestSide);
+    return std::max(center, boxWidthOrHeight - center);
+}
+
</ins><span class="cx"> void BasicShapeEllipse::path(Path&amp; path, const FloatRect&amp; boundingBox)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(path.isEmpty());
</span><del>-    // FIXME: The implementation of path is incomplete. See https://bugs.webkit.org/show_bug.cgi?id=125079 
-    // Compute closest-side and farthest-side from boundingBox.
-    // Compute top, left, bottom, right from boundingBox.
-    if (m_radiusX.type() != BasicShapeRadius::Value || m_radiusY.type() != BasicShapeRadius::Value)
-        return;
-    if (m_centerX.keyword() != BasicShapeCenterCoordinate::None || m_centerY.keyword() != BasicShapeCenterCoordinate::None)
-        return;
</del><span class="cx"> 
</span><del>-    float diagonal = sqrtf((boundingBox.width() * boundingBox.width() + boundingBox.height() * boundingBox.height()) / 2);
-    float centerX = floatValueForLength(m_centerX.length(), boundingBox.width());
-    float centerY = floatValueForLength(m_centerY.length(), boundingBox.height());
-    float radiusX = floatValueForLength(m_radiusX.value(), diagonal);
-    float radiusY = floatValueForLength(m_radiusY.value(), diagonal);
</del><ins>+    float centerX = floatValueForCenterCoordinate(m_centerX, boundingBox.width());
+    float centerY = floatValueForCenterCoordinate(m_centerY, boundingBox.height());
+    float radiusX = floatValueForRadiusInBox(m_radiusX, centerX, boundingBox.width());
+    float radiusY = floatValueForRadiusInBox(m_radiusY, centerY, boundingBox.height());
</ins><span class="cx">     path.addEllipse(FloatRect(
</span><span class="cx">         centerX - radiusX + boundingBox.x(),
</span><span class="cx">         centerY - radiusY + boundingBox.y(),
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleBasicShapesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/BasicShapes.h (160006 => 160007)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/BasicShapes.h        2013-12-03 17:15:18 UTC (rev 160006)
+++ trunk/Source/WebCore/rendering/style/BasicShapes.h        2013-12-03 17:18:01 UTC (rev 160007)
</span><span class="lines">@@ -255,6 +255,7 @@
</span><span class="cx">     const BasicShapeCenterCoordinate&amp; centerY() const { return m_centerY; }
</span><span class="cx">     const BasicShapeRadius&amp; radiusX() const { return m_radiusX; }
</span><span class="cx">     const BasicShapeRadius&amp; radiusY() const { return m_radiusY; }
</span><ins>+    float floatValueForRadiusInBox(const BasicShapeRadius&amp;, float center, float boxWidthOrHeight) const;
</ins><span class="cx"> 
</span><span class="cx">     void setCenterX(BasicShapeCenterCoordinate centerX) { m_centerX = std::move(centerX); }
</span><span class="cx">     void setCenterY(BasicShapeCenterCoordinate centerY) { m_centerY = std::move(centerY); }
</span></span></pre>
</div>
</div>

</body>
</html>