<!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>[159954] 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/159954">159954</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-02 12:52:11 -0800 (Mon, 02 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>[css shapes] Parse new ellipse shape syntax
https://bugs.webkit.org/show_bug.cgi?id=124620
Patch by Rob Buis <rob.buis@samsung.com> on 2013-12-02
Reviewed by Dirk Schulze.
Source/WebCore:
Implement parsing of the new ellipse shape syntax. This closely follows the patch
for the new circle syntax (https://bugs.webkit.org/show_bug.cgi?id=124618), with
some refactoring of functionality shared by both.
Updated existing parsing tests to cover this.
* css/BasicShapeFunctions.cpp:
(WebCore::BasicShapeRadiusToCSSValue):
(WebCore::valueForBasicShape):
(WebCore::CSSValueToBasicShapeRadius):
(WebCore::basicShapeForValue):
* css/CSSBasicShapes.cpp:
(WebCore::buildEllipseString):
(WebCore::CSSBasicShapeEllipse::cssText):
(WebCore::CSSBasicShapeEllipse::equals):
(WebCore::buildDeprecatedEllipseString):
(WebCore::CSSDeprecatedBasicShapeEllipse::cssText):
(WebCore::CSSDeprecatedBasicShapeEllipse::equals):
* css/CSSBasicShapes.h:
(WebCore::CSSDeprecatedBasicShapeEllipse::create):
(WebCore::CSSDeprecatedBasicShapeEllipse::centerX):
(WebCore::CSSDeprecatedBasicShapeEllipse::centerY):
(WebCore::CSSDeprecatedBasicShapeEllipse::radiusX):
(WebCore::CSSDeprecatedBasicShapeEllipse::radiusY):
(WebCore::CSSDeprecatedBasicShapeEllipse::setCenterX):
(WebCore::CSSDeprecatedBasicShapeEllipse::setCenterY):
(WebCore::CSSDeprecatedBasicShapeEllipse::setRadiusX):
(WebCore::CSSDeprecatedBasicShapeEllipse::setRadiusY):
(WebCore::CSSDeprecatedBasicShapeEllipse::CSSDeprecatedBasicShapeEllipse):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseBasicShapeEllipse):
(WebCore::CSSParser::parseDeprecatedBasicShapeEllipse):
(WebCore::CSSParser::parseBasicShape):
* css/CSSParser.h:
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createShape):
* rendering/style/BasicShapes.cpp:
(WebCore::DeprecatedBasicShapeEllipse::path):
(WebCore::DeprecatedBasicShapeEllipse::blend):
(WebCore::BasicShapeEllipse::path):
(WebCore::BasicShapeEllipse::blend):
* rendering/style/BasicShapes.h:
(WebCore::BasicShapeEllipse::centerX):
(WebCore::BasicShapeEllipse::centerY):
(WebCore::BasicShapeEllipse::radiusX):
(WebCore::BasicShapeEllipse::radiusY):
(WebCore::BasicShapeEllipse::setCenterX):
(WebCore::BasicShapeEllipse::setCenterY):
(WebCore::BasicShapeEllipse::setRadiusX):
(WebCore::BasicShapeEllipse::setRadiusY):
(WebCore::BasicShapeEllipse::BasicShapeEllipse):
(WebCore::DeprecatedBasicShapeEllipse::create):
(WebCore::DeprecatedBasicShapeEllipse::DeprecatedBasicShapeEllipse):
LayoutTests:
Test that the new ellipse syntax is properly parsed.
* fast/shapes/parsing/parsing-shape-inside-expected.txt:
* fast/shapes/parsing/parsing-shape-outside-expected.txt:
* fast/shapes/parsing/parsing-test-utils.js:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastshapesparsingparsingshapeinsideexpectedtxt">trunk/LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastshapesparsingparsingshapeoutsideexpectedtxt">trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastshapesparsingparsingtestutilsjs">trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js</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="#trunkSourceWebCorecssCSSBasicShapescpp">trunk/Source/WebCore/css/CSSBasicShapes.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSBasicShapesh">trunk/Source/WebCore/css/CSSBasicShapes.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserh">trunk/Source/WebCore/css/CSSParser.h</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>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (159953 => 159954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-12-02 20:44:17 UTC (rev 159953)
+++ trunk/LayoutTests/ChangeLog        2013-12-02 20:52:11 UTC (rev 159954)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2013-12-02 Rob Buis <rob.buis@samsung.com>
+
+ [css shapes] Parse new ellipse shape syntax
+ https://bugs.webkit.org/show_bug.cgi?id=124620
+
+ Reviewed by Dirk Schulze.
+
+ Test that the new ellipse syntax is properly parsed.
+
+ * fast/shapes/parsing/parsing-shape-inside-expected.txt:
+ * fast/shapes/parsing/parsing-shape-outside-expected.txt:
+ * fast/shapes/parsing/parsing-test-utils.js:
+
</ins><span class="cx"> 2013-12-02 Brendan Long <b.long@cablelabs.com>
</span><span class="cx">
</span><span class="cx"> Use GenericEventQueue in TrackListBase and reduce code duplication with scheduleTrackEvent()
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesparsingparsingshapeinsideexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt (159953 => 159954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt        2013-12-02 20:44:17 UTC (rev 159953)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt        2013-12-02 20:52:11 UTC (rev 159954)
</span><span class="lines">@@ -29,8 +29,6 @@
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "circle(10px at 10px 10px)") is "circle(10px at 10px 10px)"
</span><span class="cx"> PASS getCSSText("-webkit-shape-inside", "circle(at 10px)") is "circle(at 10px 50%)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "circle(at 10px)") is "circle(closest-side at 10px 50%)"
</span><del>-PASS getCSSText("-webkit-shape-inside", "circle(at 10px)") is "circle(at 10px 50%)"
-PASS getComputedStyleValue("-webkit-shape-inside", "circle(at 10px)") is "circle(closest-side at 10px 50%)"
</del><span class="cx"> PASS getCSSText("-webkit-shape-inside", "circle(at 10px 10px)") is "circle(at 10px 10px)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "circle(at 10px 10px)") is "circle(closest-side at 10px 10px)"
</span><span class="cx"> PASS getCSSText("-webkit-shape-inside", "circle(at top left)") is "circle(at 0% 0%)"
</span><span class="lines">@@ -45,6 +43,38 @@
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "circle(10px at right 10px bottom 10px)") is "circle(10px at right 10px bottom 10px)"
</span><span class="cx"> PASS getCSSText("-webkit-shape-inside", "ellipse(10px, 20px, 30px, 40px)") is "ellipse(10px, 20px, 30px, 40px)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px, 20px, 30px, 40px)") is "ellipse(10px, 20px, 30px, 40px)"
</span><ins>+PASS getCSSText("-webkit-shape-inside", "ellipse()") is "ellipse()"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse()") is "ellipse(closest-side closest-side at 50% 50%)"
+PASS getCSSText("-webkit-shape-inside", "ellipse(10px)") is "ellipse(10px)"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px)") is "ellipse(10px closest-side at 50% 50%)"
+PASS getCSSText("-webkit-shape-inside", "ellipse(10px 20px)") is "ellipse(10px 20px)"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px 20px)") is "ellipse(10px 20px at 50% 50%)"
+PASS getCSSText("-webkit-shape-inside", "ellipse(10px at 10px)") is "ellipse(10px at 10px 50%)"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px at 10px)") is "ellipse(10px closest-side at 10px 50%)"
+PASS getCSSText("-webkit-shape-inside", "ellipse(10px 20px at 10px)") is "ellipse(10px 20px at 10px 50%)"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px 20px at 10px)") is "ellipse(10px 20px at 10px 50%)"
+PASS getCSSText("-webkit-shape-inside", "ellipse(10px at 10px 10px)") is "ellipse(10px at 10px 10px)"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px at 10px 10px)") is "ellipse(10px closest-side at 10px 10px)"
+PASS getCSSText("-webkit-shape-inside", "ellipse(at 10px)") is "ellipse(at 10px 50%)"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(at 10px)") is "ellipse(closest-side closest-side at 10px 50%)"
+PASS getCSSText("-webkit-shape-inside", "ellipse(at 10px 10px)") is "ellipse(at 10px 10px)"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(at 10px 10px)") is "ellipse(closest-side closest-side at 10px 10px)"
+PASS getCSSText("-webkit-shape-inside", "ellipse(at top left)") is "ellipse(at 0% 0%)"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(at top left)") is "ellipse(closest-side closest-side at 0% 0%)"
+PASS getCSSText("-webkit-shape-inside", "ellipse(at right bottom)") is "ellipse(at 100% 100%)"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(at right bottom)") is "ellipse(closest-side closest-side at 100% 100%)"
+PASS getCSSText("-webkit-shape-inside", "ellipse(10px at left top 10px)") is "ellipse(10px at left 0% top 10px)"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px at left top 10px)") is "ellipse(10px closest-side at left 0% top 10px)"
+PASS getCSSText("-webkit-shape-inside", "ellipse(10px at top 10px left 10px)") is "ellipse(10px at left 10px top 10px)"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px at top 10px left 10px)") is "ellipse(10px closest-side at left 10px top 10px)"
+PASS getCSSText("-webkit-shape-inside", "ellipse(10px at right 10px bottom 10px)") is "ellipse(10px at right 10px bottom 10px)"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px at right 10px bottom 10px)") is "ellipse(10px closest-side at right 10px bottom 10px)"
+PASS getCSSText("-webkit-shape-inside", "ellipse(10px 20px at left top 10px)") is "ellipse(10px 20px at left 0% top 10px)"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px 20px at left top 10px)") is "ellipse(10px 20px at left 0% top 10px)"
+PASS getCSSText("-webkit-shape-inside", "ellipse(10px 20px at top 10px left 10px)") is "ellipse(10px 20px at left 10px top 10px)"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px 20px at top 10px left 10px)") is "ellipse(10px 20px at left 10px top 10px)"
+PASS getCSSText("-webkit-shape-inside", "ellipse(10px 20px at right 10px bottom 10px)") is "ellipse(10px 20px at right 10px bottom 10px)"
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px 20px at right 10px bottom 10px)") is "ellipse(10px 20px at right 10px bottom 10px)"
</ins><span class="cx"> PASS getCSSText("-webkit-shape-inside", "polygon(10px 20px, 30px 40px, 40px 50px)") is "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "polygon(10px 20px, 30px 40px, 40px 50px)") is "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"
</span><span class="cx"> PASS getCSSText("-webkit-shape-inside", "polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)") is "polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)"
</span><span class="lines">@@ -127,16 +157,28 @@
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "circle(at 10px 10px at center)") is "auto"
</span><span class="cx"> PASS getCSSText("-webkit-shape-inside", "circle(at center center 10px)") is ""
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "circle(at center center 10px)") is "auto"
</span><del>-PASS getCSSText("-webkit-shape-inside", "ellipse()") is ""
-PASS getComputedStyleValue("-webkit-shape-inside", "ellipse()") is "auto"
-PASS getCSSText("-webkit-shape-inside", "ellipse(10px)") is ""
-PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px)") is "auto"
</del><span class="cx"> PASS getCSSText("-webkit-shape-inside", "ellipse(10px, 20px)") is ""
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px, 20px)") is "auto"
</span><span class="cx"> PASS getCSSText("-webkit-shape-inside", "ellipse(10px, 20px, 30px)") is ""
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px, 20px, 30px)") is "auto"
</span><span class="cx"> PASS getCSSText("-webkit-shape-inside", "ellipse(10px 20px 30px 40px)") is ""
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px 20px 30px 40px)") is "auto"
</span><ins>+PASS getCSSText("-webkit-shape-inside", "ellipse(10px 20px 30px)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px 20px 30px)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "ellipse(10px at 10px 10px 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px at 10px 10px 10px)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "ellipse(10px at 10px 10px at center)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px at 10px 10px at center)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "ellipse(10px at center center 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px at center center 10px)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "ellipse(10px 20px 30px at center center 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(10px 20px 30px at center center 10px)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "ellipse(at 10px 10px 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(at 10px 10px 10px)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "ellipse(at 10px 10px at center)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(at 10px 10px at center)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "ellipse(at center center 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(at center center 10px)") is "auto"
</ins><span class="cx"> PASS getCSSText("-webkit-shape-inside", "polygon()") is ""
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "polygon()") is "auto"
</span><span class="cx"> PASS getCSSText("-webkit-shape-inside", "polygon(evenodd 10px 20px, 30px 40px, 40px 50px)") is ""
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesparsingparsingshapeoutsideexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt (159953 => 159954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt        2013-12-02 20:44:17 UTC (rev 159953)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt        2013-12-02 20:52:11 UTC (rev 159954)
</span><span class="lines">@@ -29,8 +29,6 @@
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "circle(10px at 10px 10px)") is "circle(10px at 10px 10px)"
</span><span class="cx"> PASS getCSSText("-webkit-shape-outside", "circle(at 10px)") is "circle(at 10px 50%)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "circle(at 10px)") is "circle(closest-side at 10px 50%)"
</span><del>-PASS getCSSText("-webkit-shape-outside", "circle(at 10px)") is "circle(at 10px 50%)"
-PASS getComputedStyleValue("-webkit-shape-outside", "circle(at 10px)") is "circle(closest-side at 10px 50%)"
</del><span class="cx"> PASS getCSSText("-webkit-shape-outside", "circle(at 10px 10px)") is "circle(at 10px 10px)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "circle(at 10px 10px)") is "circle(closest-side at 10px 10px)"
</span><span class="cx"> PASS getCSSText("-webkit-shape-outside", "circle(at top left)") is "circle(at 0% 0%)"
</span><span class="lines">@@ -45,6 +43,38 @@
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "circle(10px at right 10px bottom 10px)") is "circle(10px at right 10px bottom 10px)"
</span><span class="cx"> PASS getCSSText("-webkit-shape-outside", "ellipse(10px, 20px, 30px, 40px)") is "ellipse(10px, 20px, 30px, 40px)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px, 20px, 30px, 40px)") is "ellipse(10px, 20px, 30px, 40px)"
</span><ins>+PASS getCSSText("-webkit-shape-outside", "ellipse()") is "ellipse()"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse()") is "ellipse(closest-side closest-side at 50% 50%)"
+PASS getCSSText("-webkit-shape-outside", "ellipse(10px)") is "ellipse(10px)"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px)") is "ellipse(10px closest-side at 50% 50%)"
+PASS getCSSText("-webkit-shape-outside", "ellipse(10px 20px)") is "ellipse(10px 20px)"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px 20px)") is "ellipse(10px 20px at 50% 50%)"
+PASS getCSSText("-webkit-shape-outside", "ellipse(10px at 10px)") is "ellipse(10px at 10px 50%)"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at 10px)") is "ellipse(10px closest-side at 10px 50%)"
+PASS getCSSText("-webkit-shape-outside", "ellipse(10px 20px at 10px)") is "ellipse(10px 20px at 10px 50%)"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px 20px at 10px)") is "ellipse(10px 20px at 10px 50%)"
+PASS getCSSText("-webkit-shape-outside", "ellipse(10px at 10px 10px)") is "ellipse(10px at 10px 10px)"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at 10px 10px)") is "ellipse(10px closest-side at 10px 10px)"
+PASS getCSSText("-webkit-shape-outside", "ellipse(at 10px)") is "ellipse(at 10px 50%)"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(at 10px)") is "ellipse(closest-side closest-side at 10px 50%)"
+PASS getCSSText("-webkit-shape-outside", "ellipse(at 10px 10px)") is "ellipse(at 10px 10px)"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(at 10px 10px)") is "ellipse(closest-side closest-side at 10px 10px)"
+PASS getCSSText("-webkit-shape-outside", "ellipse(at top left)") is "ellipse(at 0% 0%)"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(at top left)") is "ellipse(closest-side closest-side at 0% 0%)"
+PASS getCSSText("-webkit-shape-outside", "ellipse(at right bottom)") is "ellipse(at 100% 100%)"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(at right bottom)") is "ellipse(closest-side closest-side at 100% 100%)"
+PASS getCSSText("-webkit-shape-outside", "ellipse(10px at left top 10px)") is "ellipse(10px at left 0% top 10px)"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at left top 10px)") is "ellipse(10px closest-side at left 0% top 10px)"
+PASS getCSSText("-webkit-shape-outside", "ellipse(10px at top 10px left 10px)") is "ellipse(10px at left 10px top 10px)"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at top 10px left 10px)") is "ellipse(10px closest-side at left 10px top 10px)"
+PASS getCSSText("-webkit-shape-outside", "ellipse(10px at right 10px bottom 10px)") is "ellipse(10px at right 10px bottom 10px)"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at right 10px bottom 10px)") is "ellipse(10px closest-side at right 10px bottom 10px)"
+PASS getCSSText("-webkit-shape-outside", "ellipse(10px 20px at left top 10px)") is "ellipse(10px 20px at left 0% top 10px)"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px 20px at left top 10px)") is "ellipse(10px 20px at left 0% top 10px)"
+PASS getCSSText("-webkit-shape-outside", "ellipse(10px 20px at top 10px left 10px)") is "ellipse(10px 20px at left 10px top 10px)"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px 20px at top 10px left 10px)") is "ellipse(10px 20px at left 10px top 10px)"
+PASS getCSSText("-webkit-shape-outside", "ellipse(10px 20px at right 10px bottom 10px)") is "ellipse(10px 20px at right 10px bottom 10px)"
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px 20px at right 10px bottom 10px)") is "ellipse(10px 20px at right 10px bottom 10px)"
</ins><span class="cx"> PASS getCSSText("-webkit-shape-outside", "polygon(10px 20px, 30px 40px, 40px 50px)") is "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "polygon(10px 20px, 30px 40px, 40px 50px)") is "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"
</span><span class="cx"> PASS getCSSText("-webkit-shape-outside", "polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)") is "polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)"
</span><span class="lines">@@ -125,16 +155,28 @@
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "circle(at 10px 10px at center)") is "auto"
</span><span class="cx"> PASS getCSSText("-webkit-shape-outside", "circle(at center center 10px)") is ""
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "circle(at center center 10px)") is "auto"
</span><del>-PASS getCSSText("-webkit-shape-outside", "ellipse()") is ""
-PASS getComputedStyleValue("-webkit-shape-outside", "ellipse()") is "auto"
-PASS getCSSText("-webkit-shape-outside", "ellipse(10px)") is ""
-PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px)") is "auto"
</del><span class="cx"> PASS getCSSText("-webkit-shape-outside", "ellipse(10px, 20px)") is ""
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px, 20px)") is "auto"
</span><span class="cx"> PASS getCSSText("-webkit-shape-outside", "ellipse(10px, 20px, 30px)") is ""
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px, 20px, 30px)") is "auto"
</span><span class="cx"> PASS getCSSText("-webkit-shape-outside", "ellipse(10px 20px 30px 40px)") is ""
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px 20px 30px 40px)") is "auto"
</span><ins>+PASS getCSSText("-webkit-shape-outside", "ellipse(10px 20px 30px)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px 20px 30px)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "ellipse(10px at 10px 10px 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at 10px 10px 10px)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "ellipse(10px at 10px 10px at center)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at 10px 10px at center)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "ellipse(10px at center center 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px at center center 10px)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "ellipse(10px 20px 30px at center center 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(10px 20px 30px at center center 10px)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "ellipse(at 10px 10px 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(at 10px 10px 10px)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "ellipse(at 10px 10px at center)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(at 10px 10px at center)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "ellipse(at center center 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "ellipse(at center center 10px)") is "auto"
</ins><span class="cx"> PASS getCSSText("-webkit-shape-outside", "polygon()") is ""
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "polygon()") is "auto"
</span><span class="cx"> PASS getCSSText("-webkit-shape-outside", "polygon(evenodd 10px 20px, 30px 40px, 40px 50px)") is ""
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesparsingparsingtestutilsjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js (159953 => 159954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js        2013-12-02 20:44:17 UTC (rev 159953)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js        2013-12-02 20:52:11 UTC (rev 159954)
</span><span class="lines">@@ -14,14 +14,13 @@
</span><span class="cx"> ["inset-rectangle(10px, 20px, 30px, 40px, 5px)", "inset-rectangle(10px, 20px, 30px, 40px, 5px)", "inset-rectangle(10px, 20px, 30px, 40px, 5px, 5px)"],
</span><span class="cx"> "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)",
</span><span class="cx">
</span><del>- "circle(10px, 20px, 30px)", // FIXME remove with deprecated circle
</del><ins>+ "circle(10px, 20px, 30px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
</ins><span class="cx">
</span><span class="cx"> ["circle()", "circle()", "circle(closest-side at 50% 50%)"],
</span><span class="cx"> ["circle(10px)", "circle(10px)", "circle(10px at 50% 50%)"],
</span><span class="cx"> ["circle(10px at 10px)", "circle(10px at 10px 50%)"],
</span><span class="cx"> "circle(10px at 10px 10px)",
</span><span class="cx"> ["circle(at 10px)", "circle(at 10px 50%)", "circle(closest-side at 10px 50%)"],
</span><del>- ["circle(at 10px)", "circle(at 10px 50%)", "circle(closest-side at 10px 50%)"],
</del><span class="cx"> ["circle(at 10px 10px)", "circle(at 10px 10px)", "circle(closest-side at 10px 10px)"],
</span><span class="cx"> ["circle(at top left)", "circle(at 0% 0%)", "circle(closest-side at 0% 0%)"],
</span><span class="cx"> ["circle(at right bottom)", "circle(at 100% 100%)", "circle(closest-side at 100% 100%)"],
</span><span class="lines">@@ -29,8 +28,25 @@
</span><span class="cx"> ["circle(10px at top 10px left 10px)", "circle(10px at left 10px top 10px)"],
</span><span class="cx"> ["circle(10px at right 10px bottom 10px)", "circle(10px at right 10px bottom 10px)"],
</span><span class="cx">
</span><del>- "ellipse(10px, 20px, 30px, 40px)",
</del><ins>+ "ellipse(10px, 20px, 30px, 40px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
</ins><span class="cx">
</span><ins>+ ["ellipse()", "ellipse()", "ellipse(closest-side closest-side at 50% 50%)"],
+ ["ellipse(10px)", "ellipse(10px)", "ellipse(10px closest-side at 50% 50%)"],
+ ["ellipse(10px 20px)", "ellipse(10px 20px)", "ellipse(10px 20px at 50% 50%)"],
+ ["ellipse(10px at 10px)", "ellipse(10px at 10px 50%)", "ellipse(10px closest-side at 10px 50%)"],
+ ["ellipse(10px 20px at 10px)", "ellipse(10px 20px at 10px 50%)"],
+ ["ellipse(10px at 10px 10px)", "ellipse(10px at 10px 10px)", "ellipse(10px closest-side at 10px 10px)"],
+ ["ellipse(at 10px)", "ellipse(at 10px 50%)", "ellipse(closest-side closest-side at 10px 50%)"],
+ ["ellipse(at 10px 10px)", "ellipse(at 10px 10px)", "ellipse(closest-side closest-side at 10px 10px)"],
+ ["ellipse(at top left)", "ellipse(at 0% 0%)", "ellipse(closest-side closest-side at 0% 0%)"],
+ ["ellipse(at right bottom)", "ellipse(at 100% 100%)", "ellipse(closest-side closest-side at 100% 100%)"],
+ ["ellipse(10px at left top 10px)", "ellipse(10px at left 0% top 10px)", "ellipse(10px closest-side at left 0% top 10px)"],
+ ["ellipse(10px at top 10px left 10px)", "ellipse(10px at left 10px top 10px)", "ellipse(10px closest-side at left 10px top 10px)"],
+ ["ellipse(10px at right 10px bottom 10px)", "ellipse(10px at right 10px bottom 10px)", "ellipse(10px closest-side at right 10px bottom 10px)"],
+ ["ellipse(10px 20px at left top 10px)", "ellipse(10px 20px at left 0% top 10px)"],
+ ["ellipse(10px 20px at top 10px left 10px)", "ellipse(10px 20px at left 10px top 10px)"],
+ ["ellipse(10px 20px at right 10px bottom 10px)", "ellipse(10px 20px at right 10px bottom 10px)"],
+
</ins><span class="cx"> ["polygon(10px 20px, 30px 40px, 40px 50px)", "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"],
</span><span class="cx"> ["polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)", "polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)"],
</span><span class="cx"> ["polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)", "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"],
</span><span class="lines">@@ -71,9 +87,9 @@
</span><span class="cx"> "inset-rectangle(10px 20px 30px 40px)",
</span><span class="cx"> "inset-rectangle(10px, 20px, 30px, 40px, 50px, 60px, 70px)",
</span><span class="cx">
</span><del>- "circle(10px, 20px)", // FIXME remove with deprecated circle
- "circle(10px 20px 30px)", // FIXME remove with deprecated circle
- "circle(10px, 20px, 30px, 40px)", // FIXME remove with deprecated circle
</del><ins>+ "circle(10px, 20px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
+ "circle(10px 20px 30px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
+ "circle(10px, 20px, 30px, 40px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
</ins><span class="cx">
</span><span class="cx"> "circle(10px 20px)",
</span><span class="cx"> "circle(10px at 10px 10px 10px)",
</span><span class="lines">@@ -83,12 +99,19 @@
</span><span class="cx"> "circle(at 10px 10px at center)",
</span><span class="cx"> "circle(at center center 10px)",
</span><span class="cx">
</span><del>- "ellipse()",
- "ellipse(10px)",
- "ellipse(10px, 20px)",
- "ellipse(10px, 20px, 30px)",
- "ellipse(10px 20px 30px 40px)",
</del><ins>+ "ellipse(10px, 20px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
+ "ellipse(10px, 20px, 30px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
+ "ellipse(10px 20px 30px 40px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
</ins><span class="cx">
</span><ins>+ "ellipse(10px 20px 30px)",
+ "ellipse(10px at 10px 10px 10px)",
+ "ellipse(10px at 10px 10px at center)",
+ "ellipse(10px at center center 10px)",
+ "ellipse(10px 20px 30px at center center 10px)",
+ "ellipse(at 10px 10px 10px)",
+ "ellipse(at 10px 10px at center)",
+ "ellipse(at center center 10px)",
+
</ins><span class="cx"> "polygon()",
</span><span class="cx"> "polygon(evenodd 10px 20px, 30px 40px, 40px 50px)",
</span><span class="cx"> "polygon(nonzero 10px 20px, 30px 40px, 40px 50px)",
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (159953 => 159954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-02 20:44:17 UTC (rev 159953)
+++ trunk/Source/WebCore/ChangeLog        2013-12-02 20:52:11 UTC (rev 159954)
</span><span class="lines">@@ -1,3 +1,64 @@
</span><ins>+2013-12-02 Rob Buis <rob.buis@samsung.com>
+
+ [css shapes] Parse new ellipse shape syntax
+ https://bugs.webkit.org/show_bug.cgi?id=124620
+
+ Reviewed by Dirk Schulze.
+
+ Implement parsing of the new ellipse shape syntax. This closely follows the patch
+ for the new circle syntax (https://bugs.webkit.org/show_bug.cgi?id=124618), with
+ some refactoring of functionality shared by both.
+
+ Updated existing parsing tests to cover this.
+
+ * css/BasicShapeFunctions.cpp:
+ (WebCore::BasicShapeRadiusToCSSValue):
+ (WebCore::valueForBasicShape):
+ (WebCore::CSSValueToBasicShapeRadius):
+ (WebCore::basicShapeForValue):
+ * css/CSSBasicShapes.cpp:
+ (WebCore::buildEllipseString):
+ (WebCore::CSSBasicShapeEllipse::cssText):
+ (WebCore::CSSBasicShapeEllipse::equals):
+ (WebCore::buildDeprecatedEllipseString):
+ (WebCore::CSSDeprecatedBasicShapeEllipse::cssText):
+ (WebCore::CSSDeprecatedBasicShapeEllipse::equals):
+ * css/CSSBasicShapes.h:
+ (WebCore::CSSDeprecatedBasicShapeEllipse::create):
+ (WebCore::CSSDeprecatedBasicShapeEllipse::centerX):
+ (WebCore::CSSDeprecatedBasicShapeEllipse::centerY):
+ (WebCore::CSSDeprecatedBasicShapeEllipse::radiusX):
+ (WebCore::CSSDeprecatedBasicShapeEllipse::radiusY):
+ (WebCore::CSSDeprecatedBasicShapeEllipse::setCenterX):
+ (WebCore::CSSDeprecatedBasicShapeEllipse::setCenterY):
+ (WebCore::CSSDeprecatedBasicShapeEllipse::setRadiusX):
+ (WebCore::CSSDeprecatedBasicShapeEllipse::setRadiusY):
+ (WebCore::CSSDeprecatedBasicShapeEllipse::CSSDeprecatedBasicShapeEllipse):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseBasicShapeEllipse):
+ (WebCore::CSSParser::parseDeprecatedBasicShapeEllipse):
+ (WebCore::CSSParser::parseBasicShape):
+ * css/CSSParser.h:
+ * rendering/shapes/Shape.cpp:
+ (WebCore::Shape::createShape):
+ * rendering/style/BasicShapes.cpp:
+ (WebCore::DeprecatedBasicShapeEllipse::path):
+ (WebCore::DeprecatedBasicShapeEllipse::blend):
+ (WebCore::BasicShapeEllipse::path):
+ (WebCore::BasicShapeEllipse::blend):
+ * rendering/style/BasicShapes.h:
+ (WebCore::BasicShapeEllipse::centerX):
+ (WebCore::BasicShapeEllipse::centerY):
+ (WebCore::BasicShapeEllipse::radiusX):
+ (WebCore::BasicShapeEllipse::radiusY):
+ (WebCore::BasicShapeEllipse::setCenterX):
+ (WebCore::BasicShapeEllipse::setCenterY):
+ (WebCore::BasicShapeEllipse::setRadiusX):
+ (WebCore::BasicShapeEllipse::setRadiusY):
+ (WebCore::BasicShapeEllipse::BasicShapeEllipse):
+ (WebCore::DeprecatedBasicShapeEllipse::create):
+ (WebCore::DeprecatedBasicShapeEllipse::DeprecatedBasicShapeEllipse):
+
</ins><span class="cx"> 2013-12-02 Alexey Proskuryakov <ap@apple.com>
</span><span class="cx">
</span><span class="cx"> Add support for WebCrypto RSA-OAEP
</span></span></pre></div>
<a id="trunkSourceWebCorecssBasicShapeFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/BasicShapeFunctions.cpp (159953 => 159954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/BasicShapeFunctions.cpp        2013-12-02 20:44:17 UTC (rev 159953)
+++ trunk/Source/WebCore/css/BasicShapeFunctions.cpp        2013-12-02 20:52:11 UTC (rev 159954)
</span><span class="lines">@@ -100,6 +100,21 @@
</span><span class="cx"> return pool.createValue(Pair::create(pool.createIdentifierValue(keyword), pool.createValue(center.length(), style)));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static PassRefPtr<CSSPrimitiveValue> basicShapeRadiusToCSSValue(const RenderStyle* style, CSSValuePool& pool, const BasicShapeRadius& radius)
+{
+ switch (radius.type()) {
+ case BasicShapeRadius::Value:
+ return pool.createValue(radius.value(), style);
+ case BasicShapeRadius::ClosestSide:
+ return pool.createIdentifierValue(CSSValueClosestSide);
+ case BasicShapeRadius::FarthestSide:
+ return pool.createIdentifierValue(CSSValueFarthestSide);
+ }
+
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
</ins><span class="cx"> PassRefPtr<CSSValue> valueForBasicShape(const RenderStyle* style, const BasicShape* basicShape)
</span><span class="cx"> {
</span><span class="cx"> CSSValuePool& pool = cssValuePool();
</span><span class="lines">@@ -137,23 +152,13 @@
</span><span class="cx">
</span><span class="cx"> circleValue->setCenterX(valueForCenterCoordinate(pool, style, circle->centerX()));
</span><span class="cx"> circleValue->setCenterY(valueForCenterCoordinate(pool, style, circle->centerY()));
</span><del>- switch (circle->radius().type()) {
- case BasicShapeRadius::Value:
- circleValue->setRadius(pool.createValue(circle->radius().value(), style));
- break;
- case BasicShapeRadius::ClosestSide:
- circleValue->setRadius(pool.createIdentifierValue(CSSValueClosestSide));
- break;
- case BasicShapeRadius::FarthestSide:
- circleValue->setRadius(pool.createIdentifierValue(CSSValueFarthestSide));
- break;
- }
</del><ins>+ circleValue->setRadius(basicShapeRadiusToCSSValue(style, pool, circle->radius()));
</ins><span class="cx"> basicShapeValue = circleValue.release();
</span><span class="cx"> break;
</span><span class="cx"> }
</span><del>- case BasicShape::BasicShapeEllipseType: {
- const BasicShapeEllipse* ellipse = static_cast<const BasicShapeEllipse*>(basicShape);
- RefPtr<CSSBasicShapeEllipse> ellipseValue = CSSBasicShapeEllipse::create();
</del><ins>+ case BasicShape::DeprecatedBasicShapeEllipseType: {
+ const DeprecatedBasicShapeEllipse* ellipse = static_cast<const DeprecatedBasicShapeEllipse*>(basicShape);
+ RefPtr<CSSDeprecatedBasicShapeEllipse> ellipseValue = CSSDeprecatedBasicShapeEllipse::create();
</ins><span class="cx">
</span><span class="cx"> ellipseValue->setCenterX(pool.createValue(ellipse->centerX(), style));
</span><span class="cx"> ellipseValue->setCenterY(pool.createValue(ellipse->centerY(), style));
</span><span class="lines">@@ -163,6 +168,17 @@
</span><span class="cx"> basicShapeValue = ellipseValue.release();
</span><span class="cx"> break;
</span><span class="cx"> }
</span><ins>+ case BasicShape::BasicShapeEllipseType: {
+ const BasicShapeEllipse* ellipse = static_cast<const BasicShapeEllipse*>(basicShape);
+ RefPtr<CSSBasicShapeEllipse> ellipseValue = CSSBasicShapeEllipse::create();
+
+ ellipseValue->setCenterX(valueForCenterCoordinate(pool, style, ellipse->centerX()));
+ ellipseValue->setCenterY(valueForCenterCoordinate(pool, style, ellipse->centerY()));
+ ellipseValue->setRadiusX(basicShapeRadiusToCSSValue(style, pool, ellipse->radiusX()));
+ ellipseValue->setRadiusY(basicShapeRadiusToCSSValue(style, pool, ellipse->radiusY()));
+ basicShapeValue = ellipseValue.release();
+ break;
+ }
</ins><span class="cx"> case BasicShape::BasicShapePolygonType: {
</span><span class="cx"> const BasicShapePolygon* polygon = static_cast<const BasicShapePolygon*>(basicShape);
</span><span class="cx"> RefPtr<CSSBasicShapePolygon> polygonValue = CSSBasicShapePolygon::create();
</span><span class="lines">@@ -230,6 +246,26 @@
</span><span class="cx"> return BasicShapeCenterCoordinate(convertToLength(style, rootStyle, value));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static BasicShapeRadius cssValueToBasicShapeRadius(const RenderStyle* style, const RenderStyle* rootStyle, PassRefPtr<CSSPrimitiveValue> radius)
+{
+ if (!radius)
+ return BasicShapeRadius(BasicShapeRadius::ClosestSide);
+
+ if (radius->isValueID()) {
+ switch (radius->getValueID()) {
+ case CSSValueClosestSide:
+ return BasicShapeRadius(BasicShapeRadius::ClosestSide);
+ case CSSValueFarthestSide:
+ return BasicShapeRadius(BasicShapeRadius::FarthestSide);
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ }
+
+ return BasicShapeRadius(convertToLength(style, rootStyle, radius.get()));
+}
+
</ins><span class="cx"> PassRefPtr<BasicShape> basicShapeForValue(const RenderStyle* style, const RenderStyle* rootStyle, const CSSBasicShape* basicShapeValue)
</span><span class="cx"> {
</span><span class="cx"> RefPtr<BasicShape> basicShape;
</span><span class="lines">@@ -279,30 +315,14 @@
</span><span class="cx"> circle->setCenterX(BasicShapeCenterCoordinate(Length(50, Percent)));
</span><span class="cx"> circle->setCenterY(BasicShapeCenterCoordinate(Length(50, Percent)));
</span><span class="cx"> }
</span><del>- if (RefPtr<CSSPrimitiveValue> radius = circleValue->radius()) {
- if (radius->isValueID()) {
- switch (radius->getValueID()) {
- case CSSValueClosestSide:
- circle->setRadius(BasicShapeRadius(BasicShapeRadius::ClosestSide));
- break;
- case CSSValueFarthestSide:
- circle->setRadius(BasicShapeRadius(BasicShapeRadius::FarthestSide));
- break;
- default:
- ASSERT_NOT_REACHED();
- break;
- }
- } else
- circle->setRadius(BasicShapeRadius(convertToLength(style, rootStyle, radius.get())));
- } else
- circle->setRadius(BasicShapeRadius(BasicShapeRadius::ClosestSide));
</del><ins>+ circle->setRadius(cssValueToBasicShapeRadius(style, rootStyle, circleValue->radius()));
</ins><span class="cx">
</span><span class="cx"> basicShape = circle.release();
</span><span class="cx"> break;
</span><span class="cx"> }
</span><del>- case CSSBasicShape::CSSBasicShapeEllipseType: {
- const CSSBasicShapeEllipse* ellipseValue = static_cast<const CSSBasicShapeEllipse *>(basicShapeValue);
- RefPtr<BasicShapeEllipse> ellipse = BasicShapeEllipse::create();
</del><ins>+ case CSSBasicShape::CSSDeprecatedBasicShapeEllipseType: {
+ const CSSDeprecatedBasicShapeEllipse* ellipseValue = static_cast<const CSSDeprecatedBasicShapeEllipse *>(basicShapeValue);
+ RefPtr<DeprecatedBasicShapeEllipse> ellipse = DeprecatedBasicShapeEllipse::create();
</ins><span class="cx">
</span><span class="cx"> ellipse->setCenterX(convertToLength(style, rootStyle, ellipseValue->centerX()));
</span><span class="cx"> ellipse->setCenterY(convertToLength(style, rootStyle, ellipseValue->centerY()));
</span><span class="lines">@@ -312,6 +332,23 @@
</span><span class="cx"> basicShape = ellipse.release();
</span><span class="cx"> break;
</span><span class="cx"> }
</span><ins>+ case CSSBasicShape::CSSBasicShapeEllipseType: {
+ const CSSBasicShapeEllipse* ellipseValue = static_cast<const CSSBasicShapeEllipse *>(basicShapeValue);
+ RefPtr<BasicShapeEllipse> ellipse = BasicShapeEllipse::create();
+
+ if (ellipseValue->centerX() && ellipseValue->centerY()) {
+ ellipse->setCenterX(convertToCenterCoordinate(style, rootStyle, ellipseValue->centerX()));
+ ellipse->setCenterY(convertToCenterCoordinate(style, rootStyle, ellipseValue->centerY()));
+ } else {
+ ellipse->setCenterX(BasicShapeCenterCoordinate(Length(50, Percent)));
+ ellipse->setCenterY(BasicShapeCenterCoordinate(Length(50, Percent)));
+ }
+ ellipse->setRadiusX(cssValueToBasicShapeRadius(style, rootStyle, ellipseValue->radiusX()));
+ ellipse->setRadiusY(cssValueToBasicShapeRadius(style, rootStyle, ellipseValue->radiusY()));
+
+ basicShape = ellipse.release();
+ break;
+ }
</ins><span class="cx"> case CSSBasicShape::CSSBasicShapePolygonType: {
</span><span class="cx"> const CSSBasicShapePolygon* polygonValue = static_cast<const CSSBasicShapePolygon *>(basicShapeValue);
</span><span class="cx"> RefPtr<BasicShapePolygon> polygon = BasicShapePolygon::create();
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSBasicShapescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSBasicShapes.cpp (159953 => 159954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSBasicShapes.cpp        2013-12-02 20:44:17 UTC (rev 159953)
+++ trunk/Source/WebCore/css/CSSBasicShapes.cpp        2013-12-02 20:52:11 UTC (rev 159954)
</span><span class="lines">@@ -181,9 +181,67 @@
</span><span class="cx"> && compareCSSValuePtr(m_box, other.m_box);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static String buildEllipseString(const String& x, const String& y, const String& radiusX, const String& radiusY, const String& box)
</del><ins>+static String buildEllipseString(const String& radiusX, const String& radiusY, const String& centerX, const String& centerY, const String& box)
</ins><span class="cx"> {
</span><ins>+ char opening[] = "ellipse(";
+ char at[] = "at";
+ char separator[] = " ";
</ins><span class="cx"> StringBuilder result;
</span><ins>+ result.appendLiteral(opening);
+ bool needsSeparator = false;
+ if (!radiusX.isNull()) {
+ result.append(radiusX);
+ needsSeparator = true;
+ }
+ if (!radiusY.isNull()) {
+ if (needsSeparator)
+ result.appendLiteral(separator);
+ result.append(radiusY);
+ needsSeparator = true;
+ }
+
+ if (!centerX.isNull() || !centerY.isNull()) {
+ if (needsSeparator)
+ result.appendLiteral(separator);
+ result.appendLiteral(at);
+ result.appendLiteral(separator);
+ result.append(centerX);
+ result.appendLiteral(separator);
+ result.append(centerY);
+ }
+ result.appendLiteral(")");
+ if (box.length()) {
+ result.appendLiteral(separator);
+ result.append(box);
+ }
+ return result.toString();
+}
+
+String CSSBasicShapeEllipse::cssText() const
+{
+ return buildEllipseString(m_radiusX ? m_radiusX->cssText() : String(),
+ m_radiusY ? m_radiusY->cssText() : String(),
+ m_centerX ? m_centerX->cssText() : String(),
+ m_centerY ? m_centerY->cssText() : String(),
+ m_box ? m_box->cssText() : String());
+}
+
+bool CSSBasicShapeEllipse::equals(const CSSBasicShape& shape) const
+{
+ if (shape.type() != CSSBasicShapeEllipseType)
+ return false;
+
+ const CSSBasicShapeEllipse& other = static_cast<const CSSBasicShapeEllipse&>(shape);
+ return compareCSSValuePtr(m_centerX, other.m_centerX)
+ && compareCSSValuePtr(m_centerY, other.m_centerY)
+ && compareCSSValuePtr(m_radiusX, other.m_radiusX)
+ && compareCSSValuePtr(m_radiusY, other.m_radiusY)
+ && compareCSSValuePtr(m_box, other.m_box);
+}
+
+static String buildDeprecatedEllipseString(const String& x, const String& y, const String& radiusX, const String& radiusY, const String& box)
+{
+ StringBuilder result;
</ins><span class="cx"> char opening[] = "ellipse(";
</span><span class="cx"> char separator[] = ", ";
</span><span class="cx"> result.appendLiteral(opening);
</span><span class="lines">@@ -202,17 +260,17 @@
</span><span class="cx"> return result.toString();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String CSSBasicShapeEllipse::cssText() const
</del><ins>+String CSSDeprecatedBasicShapeEllipse::cssText() const
</ins><span class="cx"> {
</span><del>- return buildEllipseString(m_centerX->cssText(), m_centerY->cssText(), m_radiusX->cssText(), m_radiusY->cssText(), m_box ? m_box->cssText() : String());
</del><ins>+ return buildDeprecatedEllipseString(m_centerX->cssText(), m_centerY->cssText(), m_radiusX->cssText(), m_radiusY->cssText(), m_box ? m_box->cssText() : String());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-bool CSSBasicShapeEllipse::equals(const CSSBasicShape& shape) const
</del><ins>+bool CSSDeprecatedBasicShapeEllipse::equals(const CSSBasicShape& shape) const
</ins><span class="cx"> {
</span><del>- if (shape.type() != CSSBasicShapeEllipseType)
</del><ins>+ if (shape.type() != CSSDeprecatedBasicShapeEllipseType)
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- const CSSBasicShapeEllipse& other = static_cast<const CSSBasicShapeEllipse&>(shape);
</del><ins>+ const CSSDeprecatedBasicShapeEllipse& other = static_cast<const CSSDeprecatedBasicShapeEllipse&>(shape);
</ins><span class="cx"> return compareCSSValuePtr(m_centerX, other.m_centerX)
</span><span class="cx"> && compareCSSValuePtr(m_centerY, other.m_centerY)
</span><span class="cx"> && compareCSSValuePtr(m_radiusX, other.m_radiusX)
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSBasicShapesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSBasicShapes.h (159953 => 159954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSBasicShapes.h        2013-12-02 20:44:17 UTC (rev 159953)
+++ trunk/Source/WebCore/css/CSSBasicShapes.h        2013-12-02 20:52:11 UTC (rev 159954)
</span><span class="lines">@@ -43,10 +43,11 @@
</span><span class="cx"> enum Type {
</span><span class="cx"> CSSBasicShapeRectangleType = 1,
</span><span class="cx"> CSSDeprecatedBasicShapeCircleType = 2,
</span><del>- CSSBasicShapeEllipseType = 3,
</del><ins>+ CSSDeprecatedBasicShapeEllipseType = 3,
</ins><span class="cx"> CSSBasicShapePolygonType = 4,
</span><span class="cx"> CSSBasicShapeInsetRectangleType = 5,
</span><del>- CSSBasicShapeCircleType = 6
</del><ins>+ CSSBasicShapeCircleType = 6,
+ CSSBasicShapeEllipseType = 7
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> virtual Type type() const = 0;
</span><span class="lines">@@ -178,6 +179,33 @@
</span><span class="cx"> RefPtr<CSSPrimitiveValue> m_radius;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+class CSSDeprecatedBasicShapeEllipse : public CSSBasicShape {
+public:
+ static PassRefPtr<CSSDeprecatedBasicShapeEllipse> create() { return adoptRef(new CSSDeprecatedBasicShapeEllipse); }
+
+ CSSPrimitiveValue* centerX() const { return m_centerX.get(); }
+ CSSPrimitiveValue* centerY() const { return m_centerY.get(); }
+ CSSPrimitiveValue* radiusX() const { return m_radiusX.get(); }
+ CSSPrimitiveValue* radiusY() const { return m_radiusY.get(); }
+
+ void setCenterX(PassRefPtr<CSSPrimitiveValue> centerX) { m_centerX = centerX; }
+ void setCenterY(PassRefPtr<CSSPrimitiveValue> centerY) { m_centerY = centerY; }
+ void setRadiusX(PassRefPtr<CSSPrimitiveValue> radiusX) { m_radiusX = radiusX; }
+ void setRadiusY(PassRefPtr<CSSPrimitiveValue> radiusY) { m_radiusY = radiusY; }
+
+ virtual Type type() const OVERRIDE { return CSSDeprecatedBasicShapeEllipseType; }
+ virtual String cssText() const OVERRIDE;
+ virtual bool equals(const CSSBasicShape&) const OVERRIDE;
+
+private:
+ CSSDeprecatedBasicShapeEllipse() { }
+
+ RefPtr<CSSPrimitiveValue> m_centerX;
+ RefPtr<CSSPrimitiveValue> m_centerY;
+ RefPtr<CSSPrimitiveValue> m_radiusX;
+ RefPtr<CSSPrimitiveValue> m_radiusY;
+};
+
</ins><span class="cx"> class CSSBasicShapeEllipse : public CSSBasicShape {
</span><span class="cx"> public:
</span><span class="cx"> static PassRefPtr<CSSBasicShapeEllipse> create() { return adoptRef(new CSSBasicShapeEllipse); }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (159953 => 159954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2013-12-02 20:44:17 UTC (rev 159953)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2013-12-02 20:52:11 UTC (rev 159954)
</span><span class="lines">@@ -5565,11 +5565,60 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(args);
</span><span class="cx">
</span><ins>+ // ellipse(radiusX)
+ // ellipse(radiusX at <position>
+ // ellipse(radiusX radiusY)
+ // ellipse(radiusX radiusY at <position>
+ // ellipse(at <position>)
+ // where position defines centerX and centerY using a CSS <position> data type.
+ RefPtr<CSSBasicShapeEllipse> shape = CSSBasicShapeEllipse::create();
+
+ for (CSSParserValue* argument = args->current(); argument; argument = args->next()) {
+ // The call to parseFillPosition below should consume all of the
+ // arguments except the first three. Thus, an index greater than two
+ // indicates an invalid production.
+ if (args->currentIndex() > 2)
+ return 0;
+
+ if (args->currentIndex() < 2 && argument->id != CSSValueAt) {
+ if (RefPtr<CSSPrimitiveValue> radius = parseShapeRadius(argument)) {
+ if (!shape->radiusX())
+ shape->setRadiusX(radius);
+ else
+ shape->setRadiusY(radius);
+ continue;
+ }
+
+ return 0;
+ }
+
+ if (argument->id != CSSValueAt)
+ return 0;
+ RefPtr<CSSValue> centerX;
+ RefPtr<CSSValue> centerY;
+ args->next(); // set list to start of position center
+ parseFillPosition(args, centerX, centerY);
+ if (!centerX || !centerY)
+ return 0;
+
+ ASSERT(centerX->isPrimitiveValue());
+ ASSERT(centerY->isPrimitiveValue());
+ shape->setCenterX(toCSSPrimitiveValue(centerX.get()));
+ shape->setCenterY(toCSSPrimitiveValue(centerY.get()));
+ }
+
+ return shape;
+}
+
+PassRefPtr<CSSBasicShape> CSSParser::parseDeprecatedBasicShapeEllipse(CSSParserValueList* args)
+{
+ ASSERT(args);
+
</ins><span class="cx"> // ellipse(centerX, centerY, radiusX, radiusY)
</span><span class="cx"> if (args->size() != 7)
</span><span class="cx"> return 0;
</span><span class="cx">
</span><del>- RefPtr<CSSBasicShapeEllipse> shape = CSSBasicShapeEllipse::create();
</del><ins>+ RefPtr<CSSDeprecatedBasicShapeEllipse> shape = CSSDeprecatedBasicShapeEllipse::create();
</ins><span class="cx"> unsigned argumentNumber = 0;
</span><span class="cx"> CSSParserValue* argument = args->current();
</span><span class="cx"> while (argument) {
</span><span class="lines">@@ -5761,7 +5810,10 @@
</span><span class="cx"> else
</span><span class="cx"> shape = parseBasicShapeCircle(args);
</span><span class="cx"> else if (equalIgnoringCase(value->function->name, "ellipse("))
</span><del>- shape = parseBasicShapeEllipse(args);
</del><ins>+ if (isDeprecatedBasicShape(args))
+ shape = parseDeprecatedBasicShapeEllipse(args);
+ else
+ shape = parseBasicShapeEllipse(args);
</ins><span class="cx"> else if (equalIgnoringCase(value->function->name, "polygon("))
</span><span class="cx"> shape = parseBasicShapePolygon(args);
</span><span class="cx"> else if (equalIgnoringCase(value->function->name, "inset-rectangle("))
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.h (159953 => 159954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.h        2013-12-02 20:44:17 UTC (rev 159953)
+++ trunk/Source/WebCore/css/CSSParser.h        2013-12-02 20:52:11 UTC (rev 159954)
</span><span class="lines">@@ -184,6 +184,7 @@
</span><span class="cx"> PassRefPtr<CSSBasicShape> parseBasicShapeCircle(CSSParserValueList*);
</span><span class="cx"> PassRefPtr<CSSBasicShape> parseDeprecatedBasicShapeCircle(CSSParserValueList*);
</span><span class="cx"> PassRefPtr<CSSBasicShape> parseBasicShapeEllipse(CSSParserValueList*);
</span><ins>+ PassRefPtr<CSSBasicShape> parseDeprecatedBasicShapeEllipse(CSSParserValueList*);
</ins><span class="cx"> PassRefPtr<CSSBasicShape> parseBasicShapePolygon(CSSParserValueList*);
</span><span class="cx"> PassRefPtr<CSSBasicShape> parseBasicShapeInsetRectangle(CSSParserValueList*);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesShapecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/Shape.cpp (159953 => 159954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/Shape.cpp        2013-12-02 20:44:17 UTC (rev 159953)
+++ trunk/Source/WebCore/rendering/shapes/Shape.cpp        2013-12-02 20:52:11 UTC (rev 159954)
</span><span class="lines">@@ -156,8 +156,8 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- case BasicShape::BasicShapeEllipseType: {
- const BasicShapeEllipse* ellipse = static_cast<const BasicShapeEllipse*>(basicShape);
</del><ins>+ case BasicShape::DeprecatedBasicShapeEllipseType: {
+ const DeprecatedBasicShapeEllipse* ellipse = static_cast<const DeprecatedBasicShapeEllipse*>(basicShape);
</ins><span class="cx"> float centerX = floatValueForLength(ellipse->centerX(), boxWidth);
</span><span class="cx"> float centerY = floatValueForLength(ellipse->centerY(), boxHeight);
</span><span class="cx"> float radiusX = floatValueForLength(ellipse->radiusX(), boxWidth);
</span><span class="lines">@@ -169,6 +169,12 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ case BasicShape::BasicShapeEllipseType: {
+ // FIXME: Layout implementation needed. See bug https://bugs.webkit.org/show_bug.cgi?id=125079
+ shape = createRectangleShape(FloatRect(0, 0, boxWidth, boxHeight), FloatSize());
+ break;
+ }
+
</ins><span class="cx"> case BasicShape::BasicShapePolygonType: {
</span><span class="cx"> const BasicShapePolygon* polygon = static_cast<const BasicShapePolygon*>(basicShape);
</span><span class="cx"> const Vector<Length>& values = polygon->values();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleBasicShapescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/BasicShapes.cpp (159953 => 159954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/BasicShapes.cpp        2013-12-02 20:44:17 UTC (rev 159953)
+++ trunk/Source/WebCore/rendering/style/BasicShapes.cpp        2013-12-02 20:52:11 UTC (rev 159954)
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx"> return result.release();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void BasicShapeEllipse::path(Path& path, const FloatRect& boundingBox)
</del><ins>+void DeprecatedBasicShapeEllipse::path(Path& path, const FloatRect& boundingBox)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(path.isEmpty());
</span><span class="cx"> float centerX = floatValueForLength(m_centerX, boundingBox.width());
</span><span class="lines">@@ -167,12 +167,57 @@
</span><span class="cx"> ));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+PassRefPtr<BasicShape> DeprecatedBasicShapeEllipse::blend(const BasicShape* other, double progress) const
+{
+ ASSERT(type() == other->type());
+
+ const DeprecatedBasicShapeEllipse* o = static_cast<const DeprecatedBasicShapeEllipse*>(other);
+ RefPtr<DeprecatedBasicShapeEllipse> result = DeprecatedBasicShapeEllipse::create();
+ result->setCenterX(m_centerX.blend(o->centerX(), progress));
+ result->setCenterY(m_centerY.blend(o->centerY(), progress));
+ result->setRadiusX(m_radiusX.blend(o->radiusX(), progress));
+ result->setRadiusY(m_radiusY.blend(o->radiusY(), progress));
+ return result.release();
+}
+
+void BasicShapeEllipse::path(Path& path, const FloatRect& boundingBox)
+{
+ ASSERT(path.isEmpty());
+ // 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;
+
+ 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);
+ path.addEllipse(FloatRect(
+ centerX - radiusX + boundingBox.x(),
+ centerY - radiusY + boundingBox.y(),
+ radiusX * 2,
+ radiusY * 2));
+}
+
</ins><span class="cx"> PassRefPtr<BasicShape> BasicShapeEllipse::blend(const BasicShape* other, double progress) const
</span><span class="cx"> {
</span><span class="cx"> ASSERT(type() == other->type());
</span><ins>+ const BasicShapeEllipse* o = static_cast<const BasicShapeEllipse*>(other);
+ RefPtr<BasicShapeEllipse> result = BasicShapeEllipse::create();
</ins><span class="cx">
</span><del>- const BasicShapeEllipse* o = static_cast<const BasicShapeEllipse*>(other);
- RefPtr<BasicShapeEllipse> result = BasicShapeEllipse::create();
</del><ins>+ if (m_radiusX.type() != BasicShapeRadius::Value || o->radiusX().type() != BasicShapeRadius::Value
+ || m_radiusY.type() != BasicShapeRadius::Value || o->radiusY().type() != BasicShapeRadius::Value) {
+ result->setCenterX(o->centerX());
+ result->setCenterY(o->centerY());
+ result->setRadiusX(o->radiusX());
+ result->setRadiusY(o->radiusY());
+ return result;
+ }
+
</ins><span class="cx"> result->setCenterX(m_centerX.blend(o->centerX(), progress));
</span><span class="cx"> result->setCenterY(m_centerY.blend(o->centerY(), progress));
</span><span class="cx"> result->setRadiusX(m_radiusX.blend(o->radiusX(), progress));
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleBasicShapesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/BasicShapes.h (159953 => 159954)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/BasicShapes.h        2013-12-02 20:44:17 UTC (rev 159953)
+++ trunk/Source/WebCore/rendering/style/BasicShapes.h        2013-12-02 20:52:11 UTC (rev 159954)
</span><span class="lines">@@ -48,10 +48,11 @@
</span><span class="cx"> enum Type {
</span><span class="cx"> BasicShapeRectangleType = 1,
</span><span class="cx"> DeprecatedBasicShapeCircleType = 2,
</span><del>- BasicShapeEllipseType = 3,
</del><ins>+ DeprecatedBasicShapeEllipseType = 3,
</ins><span class="cx"> BasicShapePolygonType = 4,
</span><span class="cx"> BasicShapeInsetRectangleType = 5,
</span><del>- BasicShapeCircleType = 6
</del><ins>+ BasicShapeCircleType = 6,
+ BasicShapeEllipseType = 7
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> enum ReferenceBox {
</span><span class="lines">@@ -235,6 +236,33 @@
</span><span class="cx"> public:
</span><span class="cx"> static PassRefPtr<BasicShapeEllipse> create() { return adoptRef(new BasicShapeEllipse); }
</span><span class="cx">
</span><ins>+ const BasicShapeCenterCoordinate& centerX() const { return m_centerX; }
+ const BasicShapeCenterCoordinate& centerY() const { return m_centerY; }
+ const BasicShapeRadius& radiusX() const { return m_radiusX; }
+ const BasicShapeRadius& radiusY() const { return m_radiusY; }
+
+ void setCenterX(BasicShapeCenterCoordinate centerX) { m_centerX = std::move(centerX); }
+ void setCenterY(BasicShapeCenterCoordinate centerY) { m_centerY = std::move(centerY); }
+ void setRadiusX(BasicShapeRadius radiusX) { m_radiusX = std::move(radiusX); }
+ void setRadiusY(BasicShapeRadius radiusY) { m_radiusY = std::move(radiusY); }
+
+ virtual void path(Path&, const FloatRect&) OVERRIDE;
+ virtual PassRefPtr<BasicShape> blend(const BasicShape*, double) const OVERRIDE;
+
+ virtual Type type() const OVERRIDE { return BasicShapeEllipseType; }
+private:
+ BasicShapeEllipse() { }
+
+ BasicShapeCenterCoordinate m_centerX;
+ BasicShapeCenterCoordinate m_centerY;
+ BasicShapeRadius m_radiusX;
+ BasicShapeRadius m_radiusY;
+};
+
+class DeprecatedBasicShapeEllipse : public BasicShape {
+public:
+ static PassRefPtr<DeprecatedBasicShapeEllipse> create() { return adoptRef(new DeprecatedBasicShapeEllipse); }
+
</ins><span class="cx"> const Length& centerX() const { return m_centerX; }
</span><span class="cx"> const Length& centerY() const { return m_centerY; }
</span><span class="cx"> const Length& radiusX() const { return m_radiusX; }
</span><span class="lines">@@ -248,9 +276,9 @@
</span><span class="cx"> virtual void path(Path&, const FloatRect&) OVERRIDE;
</span><span class="cx"> virtual PassRefPtr<BasicShape> blend(const BasicShape*, double) const OVERRIDE;
</span><span class="cx">
</span><del>- virtual Type type() const OVERRIDE { return BasicShapeEllipseType; }
</del><ins>+ virtual Type type() const OVERRIDE { return DeprecatedBasicShapeEllipseType; }
</ins><span class="cx"> private:
</span><del>- BasicShapeEllipse() { }
</del><ins>+ DeprecatedBasicShapeEllipse() { }
</ins><span class="cx">
</span><span class="cx"> Length m_centerX;
</span><span class="cx"> Length m_centerY;
</span></span></pre>
</div>
</div>
</body>
</html>