<!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>[159968] 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/159968">159968</a></dd>
<dt>Author</dt> <dd>zoltan@webkit.org</dd>
<dt>Date</dt> <dd>2013-12-02 14:48:54 -0800 (Mon, 02 Dec 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>[CSS Shapes] Support inset parsing
https://bugs.webkit.org/show_bug.cgi?id=124903
Reviewed by David Hyatt.
Source/WebCore:
In this patch I added support for inset shape parsing for CSS Shapes. Inset is defined
by CSS Shapes Level 1 (http://dev.w3.org/csswg/css-shapes-1/#supported-basic-shapes).
Inset is going to be used by shape-outside (bug #124905), and eventually by shape-inside.
No new tests, I updated existing tests to cover the changes.
* css/BasicShapeFunctions.cpp:
(WebCore::valueForBasicShape): Add support for inset.
(WebCore::basicShapeForValue): Add support for inset.
* css/CSSBasicShapes.cpp:
(WebCore::buildInsetString): Create inset css string.
(WebCore::CSSBasicShapeInset::cssText): Convert inset shape to a CSS string.
(WebCore::CSSBasicShapeInset::equals): Compare two inset rectangles.
(WebCore::CSSBasicShapeInset::serializeResolvingVariables): Create an inset string, with CSS variables resolved.
(WebCore::CSSBasicShapeInset::hasVariableReference): Determine if this inset has any CSS Variable references.
* css/CSSBasicShapes.h: Add inset class.
(WebCore::CSSBasicShapeInset::create):
(WebCore::CSSBasicShapeInset::top):
(WebCore::CSSBasicShapeInset::right):
(WebCore::CSSBasicShapeInset::bottom):
(WebCore::CSSBasicShapeInset::left):
(WebCore::CSSBasicShapeInset::topLeftRadius):
(WebCore::CSSBasicShapeInset::topRightRadius):
(WebCore::CSSBasicShapeInset::bottomRightRadius):
(WebCore::CSSBasicShapeInset::bottomLeftRadius):
(WebCore::CSSBasicShapeInset::setTop):
(WebCore::CSSBasicShapeInset::setRight):
(WebCore::CSSBasicShapeInset::setBottom):
(WebCore::CSSBasicShapeInset::setLeft):
(WebCore::CSSBasicShapeInset::setTopLeftRadius):
(WebCore::CSSBasicShapeInset::setTopRightRadius):
(WebCore::CSSBasicShapeInset::setBottomRightRadius):
(WebCore::CSSBasicShapeInset::setBottomLeftRadius):
(WebCore::CSSBasicShapeInset::CSSBasicShapeInset):
* css/CSSParser.cpp:
(WebCore::completeBorderRadii): Move static function before parseInsetBorderRadius.
(WebCore::CSSParser::parseInsetRoundedCorners): I added this helper function for parsing the rounded corners
(WebCore::CSSParser::parseBasicShapeInset): Parse inset.
(WebCore::CSSParser::parseBasicShape): Add call to parse inset.
* css/CSSParser.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add constructor for LengthSize.
(WebCore::CSSPrimitiveValue::init): Initialize LengthSize.
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::create): Add support for creating PrimitiveValue from LengthSize.
* css/CSSValuePool.h:
(WebCore::CSSValuePool::createValue): Add support for LengthSize.
* platform/LengthSize.h:
(WebCore::LengthSize::blend): Add blend for LengthSize.
* rendering/shapes/ShapeInsideInfo.cpp:
(WebCore::ShapeInsideInfo::isEnabledFor): Keep inset disabled for shape-inside now.
* rendering/style/BasicShapes.cpp:
(WebCore::BasicShapeInset::path): Calculate path for an inset.
(WebCore::BasicShapeInset::blend): Blend two insets.
* rendering/style/BasicShapes.h: Add higher level inset.
(WebCore::BasicShapeInset::create):
(WebCore::BasicShapeInset::top):
(WebCore::BasicShapeInset::right):
(WebCore::BasicShapeInset::bottom):
(WebCore::BasicShapeInset::left):
(WebCore::BasicShapeInset::topLeftRadius):
(WebCore::BasicShapeInset::topRightRadius):
(WebCore::BasicShapeInset::bottomRightRadius):
(WebCore::BasicShapeInset::bottomLeftRadius):
(WebCore::BasicShapeInset::setTop):
(WebCore::BasicShapeInset::setRight):
(WebCore::BasicShapeInset::setBottom):
(WebCore::BasicShapeInset::setLeft):
(WebCore::BasicShapeInset::setTopLeftRadius):
(WebCore::BasicShapeInset::setTopRightRadius):
(WebCore::BasicShapeInset::setBottomRightRadius):
(WebCore::BasicShapeInset::setBottomLeftRadius):
(WebCore::BasicShapeInset::BasicShapeInset):
LayoutTests:
* fast/shapes/parsing/parsing-shape-inside-expected.txt:
* fast/shapes/parsing/parsing-shape-lengths-expected.txt:
* fast/shapes/parsing/parsing-shape-lengths.html:
* 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="#trunkLayoutTestsfastshapesparsingparsingshapelengthsexpectedtxt">trunk/LayoutTests/fast/shapes/parsing/parsing-shape-lengths-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastshapesparsingparsingshapelengthshtml">trunk/LayoutTests/fast/shapes/parsing/parsing-shape-lengths.html</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="#trunkSourceWebCorecssCSSPrimitiveValuecpp">trunk/Source/WebCore/css/CSSPrimitiveValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValueh">trunk/Source/WebCore/css/CSSPrimitiveValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSValuePoolh">trunk/Source/WebCore/css/CSSValuePool.h</a></li>
<li><a href="#trunkSourceWebCoreplatformLengthSizeh">trunk/Source/WebCore/platform/LengthSize.h</a></li>
<li><a href="#trunkSourceWebCorerenderingshapesShapeInsideInfocpp">trunk/Source/WebCore/rendering/shapes/ShapeInsideInfo.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 (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/LayoutTests/ChangeLog        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2013-12-02 Zoltan Horvath <zoltan@webkit.org>
+
+ [CSS Shapes] Support inset parsing
+ https://bugs.webkit.org/show_bug.cgi?id=124903
+
+ Reviewed by David Hyatt.
+
+ * fast/shapes/parsing/parsing-shape-inside-expected.txt:
+ * fast/shapes/parsing/parsing-shape-lengths-expected.txt:
+ * fast/shapes/parsing/parsing-shape-lengths.html:
+ * fast/shapes/parsing/parsing-shape-outside-expected.txt:
+ * fast/shapes/parsing/parsing-test-utils.js:
+
</ins><span class="cx"> 2013-12-02 Alexey Proskuryakov <ap@apple.com>
</span><span class="cx">
</span><span class="cx"> Support WebCrypto AES-KW
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesparsingparsingshapeinsideexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -17,6 +17,12 @@
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "inset-rectangle(10px, 20px, 30px, 40px, 5px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px, 5px)"
</span><span class="cx"> PASS getCSSText("-webkit-shape-inside", "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)"
</span><ins>+PASS getCSSText("-webkit-shape-inside", "inset(10px 20px 30px 40px)") is "inset(10px 20px 30px 40px)"
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(10px 20px 30px 40px)") is "inset(10px 20px 30px 40px round 0px 0px 0px 0px / 0px 0px 0px 0px)"
+PASS getCSSText("-webkit-shape-inside", "inset(10px 20px 30px 40px round 5px 6px)") is "inset(10px 20px 30px 40px round 5px 6px 5px 6px / 5px 6px 5px 6px)"
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(10px 20px 30px 40px round 5px 6px)") is "inset(10px 20px 30px 40px round 5px 6px 5px 6px / 5px 6px 5px 6px)"
+PASS getCSSText("-webkit-shape-inside", "inset(10px 20px 30px 40px round 5px 6px 7px 8px / 50px 60px 70px 80px)") is "inset(10px 20px 30px 40px round 5px 6px 7px 8px / 50px 60px 70px 80px)"
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(10px 20px 30px 40px round 5px 6px 7px 8px / 50px 60px 70px 80px)") is "inset(10px 20px 30px 40px round 5px 6px 7px 8px / 50px 60px 70px 80px)"
</ins><span class="cx"> PASS getCSSText("-webkit-shape-inside", "circle(10px, 20px, 30px)") is "circle(10px, 20px, 30px)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "circle(10px, 20px, 30px)") is "circle(10px, 20px, 30px)"
</span><span class="cx"> PASS getCSSText("-webkit-shape-inside", "circle()") is "circle()"
</span><span class="lines">@@ -137,6 +143,36 @@
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "inset-rectangle(10px 20px 30px 40px)") is "auto"
</span><span class="cx"> PASS getCSSText("-webkit-shape-inside", "inset-rectangle(10px, 20px, 30px, 40px, 50px, 60px, 70px)") is ""
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "inset-rectangle(10px, 20px, 30px, 40px, 50px, 60px, 70px)") is "auto"
</span><ins>+PASS getCSSText("-webkit-shape-inside", "inset()") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "inset()") is "auto"
+PASS getCSSText("-webkit-shape-inside", "inset(10px, 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(10px, 10px)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "inset(10px 20px, 30px)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(10px 20px, 30px)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "inset(10px, 20px 30px 40px)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(10px, 20px 30px 40px)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "inset(10px 20px 30px 40px 50px 60px)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(10px 20px 30px 40px 50px 60px)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "inset(round)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(round)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "inset(round 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(round 10px)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "inset(10px round)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(10px round)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "inset(10px round 10px /)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(10px round 10px /)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "inset(10px round 20px 30px 40px 50px 60px)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(10px round 20px 30px 40px 50px 60px)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "inset(10px round /)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(10px round /)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "inset(10px round / 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(10px round / 10px)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "inset(/)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(/)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "inset(/ 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(/ 10px)") is "auto"
+PASS getCSSText("-webkit-shape-inside", "inset(round /)") is ""
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(round /)") is "auto"
</ins><span class="cx"> PASS getCSSText("-webkit-shape-inside", "circle(10px, 20px)") is ""
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "circle(10px, 20px)") is "auto"
</span><span class="cx"> PASS getCSSText("-webkit-shape-inside", "circle(10px 20px 30px)") is ""
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesparsingparsingshapelengthsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-shape-lengths-expected.txt (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/parsing/parsing-shape-lengths-expected.txt        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-shape-lengths-expected.txt        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -9,6 +9,7 @@
</span><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "circle(-.5px, +.5px, .5px)") is "circle(-0.5px, 0.5px, 0.5px)"
</span><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "rectangle(1cm, 1mm, 1in, 1px, 1pt, 1pc)") is "rectangle(1cm, 1mm, 1in, 1px, 1pt, 1pc)"
</span><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "inset-rectangle(1cm, 1mm, 1in, 1px, 1pt, 1pc)") is "inset-rectangle(1cm, 1mm, 1in, 1px, 1pt, 1pc)"
</span><ins>+PASS getStyleValue("-webkit-shape-inside", "inset(1cm 1mm 1in 1px round 1pt 1pc)") is "inset(1cm 1mm 1in 1px round 1pt 1pc 1pt 1pc / 1pt 1pc 1pt 1pc)"
</ins><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "circle(-1em, +1em, 1em)") is "circle(-1em, 1em, 1em)"
</span><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "circle(-1.5em, +1.5em, 1.5em)") is "circle(-1.5em, 1.5em, 1.5em)"
</span><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "circle(-.5em, +.5em, .5em)") is "circle(-0.5em, 0.5em, 0.5em)"
</span><span class="lines">@@ -25,11 +26,13 @@
</span><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "circle(100%, 100%, 100%)") is "circle(100%, 100%, 100%)"
</span><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "rectangle(45%, 45%, 90%, 60%, 25%, 10%)") is "rectangle(45%, 45%, 90%, 60%, 25%, 10%)"
</span><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "inset-rectangle(45%, 45%, 90%, 60%, 25%, 10%)") is "inset-rectangle(45%, 45%, 90%, 60%, 25%, 10%)"
</span><ins>+PASS getStyleValue("-webkit-shape-inside", "inset(45% 45% 90% 60% round 25% 10%)") is "inset(45% 45% 90% 60% round 25% 10% 25% 10% / 25% 10% 25% 10%)"
</ins><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "ellipse(100%, 100%, 100%, 100%)") is "ellipse(100%, 100%, 100%, 100%)"
</span><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "polygon(10% 20%, 30% 40%, 40% 50%)") is "polygon(nonzero, 10% 20%, 30% 40%, 40% 50%)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "circle(50%, 100%, 150%)") is "circle(50%, 100%, 150%)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "rectangle(45%, 45%, 90%, 60%, 25%, 10%)") is "rectangle(45%, 45%, 90%, 60%, 25%, 10%)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "inset-rectangle(45%, 45%, 90%, 60%, 25%, 10%)") is "inset-rectangle(45%, 45%, 90%, 60%, 25%, 10%)"
</span><ins>+PASS getComputedStyleValue("-webkit-shape-inside", "inset(45% 45% 90% 60% round 25% 10%)") is "inset(45% 45% 90% 60% round 25% 10% 25% 10% / 25% 10% 25% 10%)"
</ins><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(100%, 100%, 100%, 100%)") is "ellipse(100%, 100%, 100%, 100%)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "polygon(10% 20%, 30% 40%, 40% 50%)") is "polygon(nonzero, 10% 20%, 30% 40%, 40% 50%)"
</span><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "circle(1px, 1px, 1)") is null
</span><span class="lines">@@ -50,6 +53,8 @@
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "inset-rectangle(1cm, 1mm, 1in, 1px, -1pt, 1pc)") is "auto"
</span><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "inset-rectangle(1cm, 1mm, 1in, 1px, 1pt, -1pc)") is null
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "inset-rectangle(1cm, 1mm, 1in, 1px, 1pt, -1pc)") is "auto"
</span><ins>+PASS getStyleValue("-webkit-shape-inside", "inset(1cm 1mm 1in 1px round 1pt -1pc)") is null
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(1cm 1mm 1in 1px round 1pt -1pc)") is "auto"
</ins><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "ellipse(1em, 1em, -1em, 1em)") is null
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "ellipse(1em, 1em, -1em, 1em)") is "auto"
</span><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "ellipse(1em, 1em, 1em, -1em)") is null
</span><span class="lines">@@ -66,6 +71,14 @@
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "inset-rectangle(1cm, 1mm, -1in, 1px, 1pt, 1pc)") is "auto"
</span><span class="cx"> PASS getStyleValue("-webkit-shape-inside", "inset-rectangle(1cm, 1mm, 1in, -1px, 1pt, 1pc)") is null
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "inset-rectangle(1cm, 1mm, 1in, -1px, 1pt, 1pc)") is "auto"
</span><ins>+PASS getStyleValue("-webkit-shape-inside", "inset(-1cm, 1mm, 1in, 1px, 1pt, 1pc)") is null
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(-1cm, 1mm, 1in, 1px, 1pt, 1pc)") is "auto"
+PASS getStyleValue("-webkit-shape-inside", "inset(1cm, -1mm, 1in, 1px, 1pt, 1pc)") is null
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(1cm, -1mm, 1in, 1px, 1pt, 1pc)") is "auto"
+PASS getStyleValue("-webkit-shape-inside", "inset(1cm, 1mm, -1in, 1px, 1pt, 1pc)") is null
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(1cm, 1mm, -1in, 1px, 1pt, 1pc)") is "auto"
+PASS getStyleValue("-webkit-shape-inside", "inset(1cm, 1mm, 1in, -1px, 1pt, 1pc)") is null
+PASS getComputedStyleValue("-webkit-shape-inside", "inset(1cm, 1mm, 1in, -1px, 1pt, 1pc)") is "auto"
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx">
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesparsingparsingshapelengthshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-shape-lengths.html (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/parsing/parsing-shape-lengths.html        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-shape-lengths.html        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx">
</span><span class="cx"> testStyleValue("rectangle(1cm, 1mm, 1in, 1px, 1pt, 1pc)", "rectangle(1cm, 1mm, 1in, 1px, 1pt, 1pc)");
</span><span class="cx"> testStyleValue("inset-rectangle(1cm, 1mm, 1in, 1px, 1pt, 1pc)", "inset-rectangle(1cm, 1mm, 1in, 1px, 1pt, 1pc)");
</span><ins>+testStyleValue("inset(1cm 1mm 1in 1px round 1pt 1pc)", "inset(1cm 1mm 1in 1px round 1pt 1pc 1pt 1pc / 1pt 1pc 1pt 1pc)");
</ins><span class="cx">
</span><span class="cx"> // font-relative lengths - number serialization, units, resolution
</span><span class="cx"> testStyleValue("circle(-1em, +1em, 1em)", "circle(-1em, 1em, 1em)");
</span><span class="lines">@@ -69,12 +70,14 @@
</span><span class="cx"> testStyleValue("circle(100%, 100%, 100%)", "circle(100%, 100%, 100%)");
</span><span class="cx"> testStyleValue("rectangle(45%, 45%, 90%, 60%, 25%, 10%)", "rectangle(45%, 45%, 90%, 60%, 25%, 10%)");
</span><span class="cx"> testStyleValue("inset-rectangle(45%, 45%, 90%, 60%, 25%, 10%)", "inset-rectangle(45%, 45%, 90%, 60%, 25%, 10%)");
</span><ins>+testStyleValue("inset(45% 45% 90% 60% round 25% 10%)", "inset(45% 45% 90% 60% round 25% 10% 25% 10% / 25% 10% 25% 10%)");
</ins><span class="cx"> testStyleValue("ellipse(100%, 100%, 100%, 100%)", "ellipse(100%, 100%, 100%, 100%)");
</span><span class="cx"> testStyleValue("polygon(10% 20%, 30% 40%, 40% 50%)", "polygon(nonzero, 10% 20%, 30% 40%, 40% 50%)");
</span><span class="cx">
</span><span class="cx"> testComputedStyleValue("circle(50%, 100%, 150%)", "circle(50%, 100%, 150%)");
</span><span class="cx"> testComputedStyleValue("rectangle(45%, 45%, 90%, 60%, 25%, 10%)", "rectangle(45%, 45%, 90%, 60%, 25%, 10%)");
</span><span class="cx"> testComputedStyleValue("inset-rectangle(45%, 45%, 90%, 60%, 25%, 10%)", "inset-rectangle(45%, 45%, 90%, 60%, 25%, 10%)");
</span><ins>+testComputedStyleValue("inset(45% 45% 90% 60% round 25% 10%)", "inset(45% 45% 90% 60% round 25% 10% 25% 10% / 25% 10% 25% 10%)");
</ins><span class="cx"> testComputedStyleValue("ellipse(100%, 100%, 100%, 100%)", "ellipse(100%, 100%, 100%, 100%)");
</span><span class="cx"> testComputedStyleValue("polygon(10% 20%, 30% 40%, 40% 50%)", "polygon(nonzero, 10% 20%, 30% 40%, 40% 50%)");
</span><span class="cx">
</span><span class="lines">@@ -90,6 +93,7 @@
</span><span class="cx"> testInvalidValue("-webkit-shape-inside", "rectangle(1cm, 1mm, 1in, 1px, 1pt, -1pc)");
</span><span class="cx"> testInvalidValue("-webkit-shape-inside", "inset-rectangle(1cm, 1mm, 1in, 1px, -1pt, 1pc)");
</span><span class="cx"> testInvalidValue("-webkit-shape-inside", "inset-rectangle(1cm, 1mm, 1in, 1px, 1pt, -1pc)");
</span><ins>+testInvalidValue("-webkit-shape-inside", "inset(1cm 1mm 1in 1px round 1pt -1pc)");
</ins><span class="cx"> testInvalidValue("-webkit-shape-inside", "ellipse(1em, 1em, -1em, 1em)");
</span><span class="cx"> testInvalidValue("-webkit-shape-inside", "ellipse(1em, 1em, 1em, -1em)");
</span><span class="cx">
</span><span class="lines">@@ -102,6 +106,13 @@
</span><span class="cx"> testInvalidValue("-webkit-shape-inside", "inset-rectangle(1cm, -1mm, 1in, 1px, 1pt, 1pc)");
</span><span class="cx"> testInvalidValue("-webkit-shape-inside", "inset-rectangle(1cm, 1mm, -1in, 1px, 1pt, 1pc)");
</span><span class="cx"> testInvalidValue("-webkit-shape-inside", "inset-rectangle(1cm, 1mm, 1in, -1px, 1pt, 1pc)");
</span><ins>+
+// reject negative top, right, bottom, and left
+testInvalidValue("-webkit-shape-inside", "inset(-1cm, 1mm, 1in, 1px, 1pt, 1pc)");
+testInvalidValue("-webkit-shape-inside", "inset(1cm, -1mm, 1in, 1px, 1pt, 1pc)");
+testInvalidValue("-webkit-shape-inside", "inset(1cm, 1mm, -1in, 1px, 1pt, 1pc)");
+testInvalidValue("-webkit-shape-inside", "inset(1cm, 1mm, 1in, -1px, 1pt, 1pc)");
+
</ins><span class="cx"> </script>
</span><span class="cx"> <script src="../../../resources/js-test-post.js"></script>
</span><span class="cx"> </body>
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesparsingparsingshapeoutsideexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -17,6 +17,12 @@
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "inset-rectangle(10px, 20px, 30px, 40px, 5px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px, 5px)"
</span><span class="cx"> PASS getCSSText("-webkit-shape-outside", "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)") is "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)"
</span><ins>+PASS getCSSText("-webkit-shape-outside", "inset(10px 20px 30px 40px)") is "inset(10px 20px 30px 40px)"
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 20px 30px 40px)") is "inset(10px 20px 30px 40px round 0px 0px 0px 0px / 0px 0px 0px 0px)"
+PASS getCSSText("-webkit-shape-outside", "inset(10px 20px 30px 40px round 5px 6px)") is "inset(10px 20px 30px 40px round 5px 6px 5px 6px / 5px 6px 5px 6px)"
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 20px 30px 40px round 5px 6px)") is "inset(10px 20px 30px 40px round 5px 6px 5px 6px / 5px 6px 5px 6px)"
+PASS getCSSText("-webkit-shape-outside", "inset(10px 20px 30px 40px round 5px 6px 7px 8px / 50px 60px 70px 80px)") is "inset(10px 20px 30px 40px round 5px 6px 7px 8px / 50px 60px 70px 80px)"
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 20px 30px 40px round 5px 6px 7px 8px / 50px 60px 70px 80px)") is "inset(10px 20px 30px 40px round 5px 6px 7px 8px / 50px 60px 70px 80px)"
</ins><span class="cx"> PASS getCSSText("-webkit-shape-outside", "circle(10px, 20px, 30px)") is "circle(10px, 20px, 30px)"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "circle(10px, 20px, 30px)") is "circle(10px, 20px, 30px)"
</span><span class="cx"> PASS getCSSText("-webkit-shape-outside", "circle()") is "circle()"
</span><span class="lines">@@ -135,6 +141,36 @@
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "inset-rectangle(10px 20px 30px 40px)") is "auto"
</span><span class="cx"> PASS getCSSText("-webkit-shape-outside", "inset-rectangle(10px, 20px, 30px, 40px, 50px, 60px, 70px)") is ""
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "inset-rectangle(10px, 20px, 30px, 40px, 50px, 60px, 70px)") is "auto"
</span><ins>+PASS getCSSText("-webkit-shape-outside", "inset()") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "inset()") is "auto"
+PASS getCSSText("-webkit-shape-outside", "inset(10px, 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px, 10px)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "inset(10px 20px, 30px)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 20px, 30px)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "inset(10px, 20px 30px 40px)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px, 20px 30px 40px)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "inset(10px 20px 30px 40px 50px 60px)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px 20px 30px 40px 50px 60px)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "inset(round)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(round)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "inset(round 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(round 10px)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "inset(10px round)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "inset(10px round 10px /)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 10px /)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "inset(10px round 20px 30px 40px 50px 60px)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round 20px 30px 40px 50px 60px)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "inset(10px round /)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round /)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "inset(10px round / 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(10px round / 10px)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "inset(/)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(/)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "inset(/ 10px)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(/ 10px)") is "auto"
+PASS getCSSText("-webkit-shape-outside", "inset(round /)") is ""
+PASS getComputedStyleValue("-webkit-shape-outside", "inset(round /)") is "auto"
</ins><span class="cx"> PASS getCSSText("-webkit-shape-outside", "circle(10px, 20px)") is ""
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "circle(10px, 20px)") is "auto"
</span><span class="cx"> PASS getCSSText("-webkit-shape-outside", "circle(10px 20px 30px)") is ""
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesparsingparsingtestutilsjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -14,6 +14,10 @@
</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><ins>+ ["inset(10px 20px 30px 40px)", "inset(10px 20px 30px 40px)", "inset(10px 20px 30px 40px round 0px 0px 0px 0px / 0px 0px 0px 0px)"],
+ ["inset(10px 20px 30px 40px round 5px 6px)", "inset(10px 20px 30px 40px round 5px 6px 5px 6px / 5px 6px 5px 6px)", "inset(10px 20px 30px 40px round 5px 6px 5px 6px / 5px 6px 5px 6px)"],
+ "inset(10px 20px 30px 40px round 5px 6px 7px 8px / 50px 60px 70px 80px)",
+
</ins><span class="cx"> "circle(10px, 20px, 30px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
</span><span class="cx">
</span><span class="cx"> ["circle()", "circle()", "circle(closest-side at 50% 50%)"],
</span><span class="lines">@@ -87,6 +91,22 @@
</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><ins>+ "inset()",
+ "inset(10px, 10px)",
+ "inset(10px 20px, 30px)",
+ "inset(10px, 20px 30px 40px)",
+ "inset(10px 20px 30px 40px 50px 60px)",
+ "inset(round)",
+ "inset(round 10px)",
+ "inset(10px round)",
+ "inset(10px round 10px /)",
+ "inset(10px round 20px 30px 40px 50px 60px)",
+ "inset(10px round /)",
+ "inset(10px round / 10px)",
+ "inset(/)",
+ "inset(/ 10px)",
+ "inset(round /)",
+
</ins><span class="cx"> "circle(10px, 20px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
</span><span class="cx"> "circle(10px 20px 30px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
</span><span class="cx"> "circle(10px, 20px, 30px, 40px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/Source/WebCore/ChangeLog        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -1,3 +1,84 @@
</span><ins>+2013-12-02 Zoltan Horvath <zoltan@webkit.org>
+
+ [CSS Shapes] Support inset parsing
+ https://bugs.webkit.org/show_bug.cgi?id=124903
+
+ Reviewed by David Hyatt.
+
+ In this patch I added support for inset shape parsing for CSS Shapes. Inset is defined
+ by CSS Shapes Level 1 (http://dev.w3.org/csswg/css-shapes-1/#supported-basic-shapes).
+ Inset is going to be used by shape-outside (bug #124905), and eventually by shape-inside.
+
+ No new tests, I updated existing tests to cover the changes.
+
+ * css/BasicShapeFunctions.cpp:
+ (WebCore::valueForBasicShape): Add support for inset.
+ (WebCore::basicShapeForValue): Add support for inset.
+ * css/CSSBasicShapes.cpp:
+ (WebCore::buildInsetString): Create inset css string.
+ (WebCore::CSSBasicShapeInset::cssText): Convert inset shape to a CSS string.
+ (WebCore::CSSBasicShapeInset::equals): Compare two inset rectangles.
+ (WebCore::CSSBasicShapeInset::serializeResolvingVariables): Create an inset string, with CSS variables resolved.
+ (WebCore::CSSBasicShapeInset::hasVariableReference): Determine if this inset has any CSS Variable references.
+ * css/CSSBasicShapes.h: Add inset class.
+ (WebCore::CSSBasicShapeInset::create):
+ (WebCore::CSSBasicShapeInset::top):
+ (WebCore::CSSBasicShapeInset::right):
+ (WebCore::CSSBasicShapeInset::bottom):
+ (WebCore::CSSBasicShapeInset::left):
+ (WebCore::CSSBasicShapeInset::topLeftRadius):
+ (WebCore::CSSBasicShapeInset::topRightRadius):
+ (WebCore::CSSBasicShapeInset::bottomRightRadius):
+ (WebCore::CSSBasicShapeInset::bottomLeftRadius):
+ (WebCore::CSSBasicShapeInset::setTop):
+ (WebCore::CSSBasicShapeInset::setRight):
+ (WebCore::CSSBasicShapeInset::setBottom):
+ (WebCore::CSSBasicShapeInset::setLeft):
+ (WebCore::CSSBasicShapeInset::setTopLeftRadius):
+ (WebCore::CSSBasicShapeInset::setTopRightRadius):
+ (WebCore::CSSBasicShapeInset::setBottomRightRadius):
+ (WebCore::CSSBasicShapeInset::setBottomLeftRadius):
+ (WebCore::CSSBasicShapeInset::CSSBasicShapeInset):
+ * css/CSSParser.cpp:
+ (WebCore::completeBorderRadii): Move static function before parseInsetBorderRadius.
+ (WebCore::CSSParser::parseInsetRoundedCorners): I added this helper function for parsing the rounded corners
+ (WebCore::CSSParser::parseBasicShapeInset): Parse inset.
+ (WebCore::CSSParser::parseBasicShape): Add call to parse inset.
+ * css/CSSParser.h:
+ * css/CSSPrimitiveValue.cpp:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Add constructor for LengthSize.
+ (WebCore::CSSPrimitiveValue::init): Initialize LengthSize.
+ * css/CSSPrimitiveValue.h:
+ (WebCore::CSSPrimitiveValue::create): Add support for creating PrimitiveValue from LengthSize.
+ * css/CSSValuePool.h:
+ (WebCore::CSSValuePool::createValue): Add support for LengthSize.
+ * platform/LengthSize.h:
+ (WebCore::LengthSize::blend): Add blend for LengthSize.
+ * rendering/shapes/ShapeInsideInfo.cpp:
+ (WebCore::ShapeInsideInfo::isEnabledFor): Keep inset disabled for shape-inside now.
+ * rendering/style/BasicShapes.cpp:
+ (WebCore::BasicShapeInset::path): Calculate path for an inset.
+ (WebCore::BasicShapeInset::blend): Blend two insets.
+ * rendering/style/BasicShapes.h: Add higher level inset.
+ (WebCore::BasicShapeInset::create):
+ (WebCore::BasicShapeInset::top):
+ (WebCore::BasicShapeInset::right):
+ (WebCore::BasicShapeInset::bottom):
+ (WebCore::BasicShapeInset::left):
+ (WebCore::BasicShapeInset::topLeftRadius):
+ (WebCore::BasicShapeInset::topRightRadius):
+ (WebCore::BasicShapeInset::bottomRightRadius):
+ (WebCore::BasicShapeInset::bottomLeftRadius):
+ (WebCore::BasicShapeInset::setTop):
+ (WebCore::BasicShapeInset::setRight):
+ (WebCore::BasicShapeInset::setBottom):
+ (WebCore::BasicShapeInset::setLeft):
+ (WebCore::BasicShapeInset::setTopLeftRadius):
+ (WebCore::BasicShapeInset::setTopRightRadius):
+ (WebCore::BasicShapeInset::setBottomRightRadius):
+ (WebCore::BasicShapeInset::setBottomLeftRadius):
+ (WebCore::BasicShapeInset::BasicShapeInset):
+
</ins><span class="cx"> 2013-12-02 Alexey Proskuryakov <ap@apple.com>
</span><span class="cx">
</span><span class="cx"> Support WebCrypto AES-KW
</span></span></pre></div>
<a id="trunkSourceWebCorecssBasicShapeFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/BasicShapeFunctions.cpp (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/BasicShapeFunctions.cpp        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/Source/WebCore/css/BasicShapeFunctions.cpp        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -205,6 +205,23 @@
</span><span class="cx"> basicShapeValue = rectangleValue.release();
</span><span class="cx"> break;
</span><span class="cx"> }
</span><ins>+ case BasicShape::BasicShapeInsetType: {
+ const BasicShapeInset* inset = static_cast<const BasicShapeInset*>(basicShape);
+ RefPtr<CSSBasicShapeInset> insetValue = CSSBasicShapeInset::create();
+
+ insetValue->setTop(pool.createValue(inset->top()));
+ insetValue->setRight(pool.createValue(inset->right()));
+ insetValue->setBottom(pool.createValue(inset->bottom()));
+ insetValue->setLeft(pool.createValue(inset->left()));
+
+ insetValue->setTopLeftRadius(pool.createValue(inset->topLeftRadius()));
+ insetValue->setTopRightRadius(pool.createValue(inset->topRightRadius()));
+ insetValue->setBottomRightRadius(pool.createValue(inset->bottomRightRadius()));
+ insetValue->setBottomLeftRadius(pool.createValue(inset->bottomLeftRadius()));
+
+ basicShapeValue = insetValue.release();
+ break;
+ }
</ins><span class="cx"> default:
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="lines">@@ -383,6 +400,48 @@
</span><span class="cx"> basicShape = rect.release();
</span><span class="cx"> break;
</span><span class="cx"> }
</span><ins>+ case CSSBasicShape::CSSBasicShapeInsetType: {
+ const CSSBasicShapeInset* rectValue = static_cast<const CSSBasicShapeInset* >(basicShapeValue);
+ RefPtr<BasicShapeInset> rect = BasicShapeInset::create();
+
+ if (rectValue->left())
+ rect->setTop(convertToLength(style, rootStyle, rectValue->top()));
+ else
+ return rect;
+ if (rectValue->right())
+ rect->setRight(convertToLength(style, rootStyle, rectValue->right()));
+ if (rectValue->bottom())
+ rect->setBottom(convertToLength(style, rootStyle, rectValue->bottom()));
+ if (rectValue->left())
+ rect->setLeft(convertToLength(style, rootStyle, rectValue->left()));
+
+ if (rectValue->topLeftRadius()) {
+ Pair* topLeftRadius = rectValue->topLeftRadius()->getPairValue();
+ rect->setTopLeftRadius(LengthSize(convertToLength(style, rootStyle, topLeftRadius->first()), convertToLength(style, rootStyle, topLeftRadius->second())));
+ } else
+ rect->setTopLeftRadius(LengthSize(Length(0, Fixed), Length(0, Fixed)));
+
+ if (rectValue->topRightRadius()) {
+ Pair* topRightRadius = rectValue->topRightRadius()->getPairValue();
+ rect->setTopRightRadius(LengthSize(convertToLength(style, rootStyle, topRightRadius->first()), convertToLength(style, rootStyle, topRightRadius->second())));
+ } else
+ rect->setTopRightRadius(LengthSize(Length(0, Fixed), Length(0, Fixed)));
+
+ if (rectValue->bottomRightRadius()) {
+ Pair* bottomRightRadius = rectValue->bottomRightRadius()->getPairValue();
+ rect->setBottomRightRadius(LengthSize(convertToLength(style, rootStyle, bottomRightRadius->first()), convertToLength(style, rootStyle, bottomRightRadius->second())));
+ } else
+ rect->setBottomRightRadius(LengthSize(Length(0, Fixed), Length(0, Fixed)));
+
+ if (rectValue->topLeftRadius()) {
+ Pair* bottomLeftRadius = rectValue->bottomLeftRadius()->getPairValue();
+ rect->setBottomLeftRadius(LengthSize(convertToLength(style, rootStyle, bottomLeftRadius->first()), convertToLength(style, rootStyle, bottomLeftRadius->second())));
+ } else
+ rect->setBottomLeftRadius(LengthSize(Length(0, Fixed), Length(0, Fixed)));
+
+ basicShape = rect.release();
+ break;
+ }
</ins><span class="cx"> default:
</span><span class="cx"> break;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSBasicShapescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSBasicShapes.cpp (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSBasicShapes.cpp        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/Source/WebCore/css/CSSBasicShapes.cpp        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx"> #include "CSSBasicShapes.h"
</span><span class="cx">
</span><span class="cx"> #include "CSSPrimitiveValueMappings.h"
</span><del>-
</del><ins>+#include "Pair.h"
</ins><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx">
</span><span class="cx"> using namespace WTF;
</span><span class="lines">@@ -403,5 +403,205 @@
</span><span class="cx"> && compareCSSValuePtr(m_box, other.m_box);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static String buildInsetString(const String& top, const String& right, const String& bottom, const String& left,
+ const String& topLeftRadiusWidth, const String& topLeftRadiusHeight,
+ const String& topRightRadiusWidth, const String& topRightRadiusHeight,
+ const String& bottomRightRadiusWidth, const String& bottomRightRadiusHeight,
+ const String& bottomLeftRadiusWidth, const String& bottomLeftRadiusHeight,
+ const String& box)
+{
+ char opening[] = "inset(";
+ char separator[] = " ";
+ char cornersSeparator[] = "round";
+ char radiusSeparator[] = "/";
+ StringBuilder result;
+ // Compute the required capacity in advance to reduce allocations.
+ result.reserveCapacity((sizeof(opening) - 1) + (13 * (sizeof(separator) - 1)) + (sizeof(cornersSeparator) - 1) + (sizeof(radiusSeparator) - 1) + 1
+ + top.length() + right.length() + bottom.length() + left.length()
+ + topLeftRadiusWidth.length() + topRightRadiusWidth.length() + bottomRightRadiusWidth.length() + bottomLeftRadiusWidth.length() +
+ + topLeftRadiusHeight.length() + topRightRadiusHeight.length() + bottomRightRadiusHeight.length() + bottomLeftRadiusHeight.length() +
+ + (box.length() ? box.length() + 1 : 0));
+ result.appendLiteral(opening);
+ result.append(top);
+ result.appendLiteral(separator);
+ result.append(right);
+ result.appendLiteral(separator);
+ result.append(bottom);
+ result.appendLiteral(separator);
+ result.append(left);
+
+ if (!topLeftRadiusWidth.isNull() && !topLeftRadiusHeight.isNull()) {
+ result.appendLiteral(separator);
+ result.appendLiteral(cornersSeparator);
+ result.appendLiteral(separator);
+
+ result.append(topLeftRadiusWidth);
+ result.appendLiteral(separator);
+ result.append(topRightRadiusWidth);
+ result.appendLiteral(separator);
+ result.append(bottomRightRadiusWidth);
+ result.appendLiteral(separator);
+ result.append(bottomLeftRadiusWidth);
+
+ result.appendLiteral(separator);
+ result.append(radiusSeparator);
+ result.appendLiteral(separator);
+
+ result.append(topLeftRadiusHeight);
+ result.appendLiteral(separator);
+ result.append(topRightRadiusHeight);
+ result.appendLiteral(separator);
+ result.append(bottomRightRadiusHeight);
+ result.appendLiteral(separator);
+ result.append(bottomLeftRadiusHeight);
+ }
+ result.append(')');
+ if (box.length()) {
+ result.append(' ');
+ result.append(box);
+ }
+ return result.toString();
+}
+
+String CSSBasicShapeInset::cssText() const
+{
+ String topLeftRadiusWidth;
+ String topLeftRadiusHeight;
+ if (topLeftRadius()) {
+ Pair* topLeftRadius = m_topLeftRadius->getPairValue();
+ topLeftRadiusWidth = topLeftRadius->first() ? topLeftRadius->first()->cssText() : String("0");
+ if (topLeftRadius->second())
+ topLeftRadiusHeight = topLeftRadius->second()->cssText();
+ }
+
+ String topRightRadiusWidth;
+ String topRightRadiusHeight;
+ if (topRightRadius()) {
+ Pair* topRightRadius = m_topRightRadius->getPairValue();
+ if (topRightRadius->first())
+ topRightRadiusWidth = topRightRadius->first()->cssText();
+ if (topRightRadius->second())
+ topRightRadiusHeight = topRightRadius->second()->cssText();
+ }
+
+ String bottomRightRadiusWidth;
+ String bottomRightRadiusHeight;
+ if (bottomRightRadius()) {
+ Pair* bottomRightRadius = m_bottomRightRadius->getPairValue();
+ if (bottomRightRadius->first())
+ bottomRightRadiusWidth = bottomRightRadius->first()->cssText();
+ if (bottomRightRadius->second())
+ bottomRightRadiusHeight = bottomRightRadius->second()->cssText();
+ }
+
+ String bottomLeftRadiusWidth;
+ String bottomLeftRadiusHeight;
+ if (bottomLeftRadius()) {
+ Pair* bottomLeftRadius = m_bottomLeftRadius->getPairValue();
+ if (bottomLeftRadius->first())
+ bottomLeftRadiusWidth = bottomLeftRadius->first()->cssText();
+ if (bottomLeftRadius->second())
+ bottomLeftRadiusHeight = bottomLeftRadius->second()->cssText();
+ }
+
+ return buildInsetString(m_top ? m_top->cssText() : String(),
+ m_right ? m_right->cssText() : String(),
+ m_bottom ? m_bottom->cssText() : String(),
+ m_left ? m_left->cssText() : String(),
+ topLeftRadiusWidth,
+ topLeftRadiusHeight,
+ topRightRadiusWidth,
+ topRightRadiusHeight,
+ bottomRightRadiusWidth,
+ bottomRightRadiusHeight,
+ bottomLeftRadiusWidth,
+ bottomLeftRadiusHeight,
+ m_box ? m_box->cssText() : String());
+}
+
+bool CSSBasicShapeInset::equals(const CSSBasicShape& shape) const
+{
+ if (shape.type() != CSSBasicShapeInsetType)
+ return false;
+
+ const CSSBasicShapeInset& other = static_cast<const CSSBasicShapeInset&>(shape);
+ return compareCSSValuePtr(m_top, other.m_top)
+ && compareCSSValuePtr(m_right, other.m_right)
+ && compareCSSValuePtr(m_bottom, other.m_bottom)
+ && compareCSSValuePtr(m_left, other.m_left)
+ && compareCSSValuePtr(m_topLeftRadius, other.m_topLeftRadius)
+ && compareCSSValuePtr(m_topRightRadius, other.m_topRightRadius)
+ && compareCSSValuePtr(m_bottomRightRadius, other.m_bottomRightRadius)
+ && compareCSSValuePtr(m_bottomLeftRadius, other.m_bottomLeftRadius);
+}
+
+#if ENABLE(CSS_VARIABLES)
+String CSSBasicShapeInset::serializeResolvingVariables(const HashMap<AtomicString, String>& variables) const
+{
+ String topLeftRadiusWidth;
+ String topLeftRadiusHeight;
+ if (topLeftRadius()) {
+ if (m_topLeftRadius->getPairValue()->first())
+ topLeftRadiusWidth = m_topLeftRadius->getPairValue()->first()->serializeResolvingVariables(variables);
+ if (m_topLeftRadius->getPairValue()->second())
+ topLeftRadiusHeight = m_topLeftRadius->getPairValue()->second()->serializeResolvingVariables(variables);
+ }
+
+ String topRightRadiusWidth;
+ String topRightRadiusHeight;
+ if (topRightRadius()) {
+ if (m_topRightRadius->getPairValue()->first())
+ topRightRadiusWidth = m_topRightRadius->getPairValue()->first()->serializeResolvingVariables(variables);
+ if (m_topRightRadius->getPairValue()->second())
+ topRightRadiusHeight = m_topRightRadius->getPairValue()->second()->serializeResolvingVariables(variables);
+ }
+
+ String bottomRightRadiusWidth;
+ String bottomRightRadiusHeight;
+ if (bottomRightRadius()) {
+ if (m_bottomRightRadius->getPairValue()->first())
+ bottomRightRadiusWidth = m_bottomRightRadius->getPairValue()->first()->serializeResolvingVariables(variables);
+ if (m_bottomRightRadius->getPairValue()->second())
+ bottomRightRadiusHeight = m_bottomRightRadius->getPairValue()->second()->serializeResolvingVariables(variables);
+ }
+
+ String bottomLeftRadiusWidth;
+ String bottomLeftRadiusHeight;
+ if (bottomLeftRadius()) {
+ if (m_bottomLeftRadius->getPairValue()->first())
+ bottomLeftRadiusWidth = m_bottomLeftRadius->getPairValue()->first()->serializeResolvingVariables(variables);
+ if (m_bottomLeftRadius->getPairValue()->second())
+ bottomLeftRadiusHeight = m_bottomLeftRadius->getPairValue()->second()->serializeResolvingVariables(variables);
+ }
+
+ return buildInsetString(m_top->serializeResolvingVariables(variables),
+ m_right->serializeResolvingVariables(variables),
+ m_bottom->serializeResolvingVariables(variables),
+ m_left->serializeResolvingVariables(variables),
+ topLeftRadiusWidth,
+ topLeftRadiusHeight,
+ topRightRadiusWidth,
+ topRightRadiusHeight,
+ bottomRightRadiusWidth,
+ bottomRightRadiusHeight,
+ bottomLeftRadiusWidth,
+ bottomLeftRadiusHeight,
+ m_box ? m_box->serializeResolvingVariables(variables) : String());
+}
+
+bool CSSBasicShapeInset::hasVariableReference() const
+{
+ return m_top->hasVariableReference()
+ || m_right->hasVariableReference()
+ || m_bottom->hasVariableReference()
+ || m_left->hasVariableReference()
+ || (topLeftRadius() && m_topLeftRadius->hasVariableReference())
+ || (topRightRadius() && m_topRightRadius->hasVariableReference())
+ || (bottomRightRadius() && m_bottomRightRadius->hasVariableReference())
+ || (bottomLeftRadius() && m_bottomLeftRadius->hasVariableReference())
+ || (m_box && m_box->hasVariableReference());
+}
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSBasicShapesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSBasicShapes.h (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSBasicShapes.h        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/Source/WebCore/css/CSSBasicShapes.h        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -47,7 +47,8 @@
</span><span class="cx"> CSSBasicShapePolygonType = 4,
</span><span class="cx"> CSSBasicShapeInsetRectangleType = 5,
</span><span class="cx"> CSSBasicShapeCircleType = 6,
</span><del>- CSSBasicShapeEllipseType = 7
</del><ins>+ CSSBasicShapeEllipseType = 7,
+ CSSBasicShapeInsetType = 8
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> virtual Type type() const = 0;
</span><span class="lines">@@ -131,6 +132,54 @@
</span><span class="cx"> RefPtr<CSSPrimitiveValue> m_radiusY;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+
+class CSSBasicShapeInset : public CSSBasicShape {
+public:
+ static PassRefPtr<CSSBasicShapeInset> create() { return adoptRef(new CSSBasicShapeInset); }
+
+ CSSPrimitiveValue* top() const { return m_top.get(); }
+ CSSPrimitiveValue* right() const { return m_right.get(); }
+ CSSPrimitiveValue* bottom() const { return m_bottom.get(); }
+ CSSPrimitiveValue* left() const { return m_left.get(); }
+
+ CSSPrimitiveValue* topLeftRadius() const { return m_topLeftRadius.get(); }
+ CSSPrimitiveValue* topRightRadius() const { return m_topRightRadius.get(); }
+ CSSPrimitiveValue* bottomRightRadius() const { return m_bottomRightRadius.get(); }
+ CSSPrimitiveValue* bottomLeftRadius() const { return m_bottomLeftRadius.get(); }
+
+ void setTop(PassRefPtr<CSSPrimitiveValue> top) { m_top = top; }
+ void setRight(PassRefPtr<CSSPrimitiveValue> right) { m_right = right; }
+ void setBottom(PassRefPtr<CSSPrimitiveValue> bottom) { m_bottom = bottom; }
+ void setLeft(PassRefPtr<CSSPrimitiveValue> left) { m_left = left; }
+
+ void setTopLeftRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_topLeftRadius = radius; }
+ void setTopRightRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_topRightRadius = radius; }
+ void setBottomRightRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_bottomRightRadius = radius; }
+ void setBottomLeftRadius(PassRefPtr<CSSPrimitiveValue> radius) { m_bottomLeftRadius = radius; }
+
+ virtual Type type() const OVERRIDE { return CSSBasicShapeInsetType; }
+ virtual String cssText() const OVERRIDE;
+ virtual bool equals(const CSSBasicShape&) const OVERRIDE;
+
+#if ENABLE(CSS_VARIABLES)
+ virtual String serializeResolvingVariables(const HashMap<AtomicString, String>&) const;
+ virtual bool hasVariableReference() const;
+#endif
+
+private:
+ CSSBasicShapeInset() { }
+
+ RefPtr<CSSPrimitiveValue> m_top;
+ RefPtr<CSSPrimitiveValue> m_right;
+ RefPtr<CSSPrimitiveValue> m_bottom;
+ RefPtr<CSSPrimitiveValue> m_left;
+
+ RefPtr<CSSPrimitiveValue> m_topLeftRadius;
+ RefPtr<CSSPrimitiveValue> m_topRightRadius;
+ RefPtr<CSSPrimitiveValue> m_bottomRightRadius;
+ RefPtr<CSSPrimitiveValue> m_bottomLeftRadius;
+};
+
</ins><span class="cx"> class CSSBasicShapeCircle : public CSSBasicShape {
</span><span class="cx"> public:
</span><span class="cx"> static PassRefPtr<CSSBasicShapeCircle> create() { return adoptRef(new CSSBasicShapeCircle); }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -5343,6 +5343,124 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+static void completeBorderRadii(RefPtr<CSSPrimitiveValue> radii[4])
+{
+ if (radii[3])
+ return;
+ if (!radii[2]) {
+ if (!radii[1])
+ radii[1] = radii[0];
+ radii[2] = radii[0];
+ }
+ radii[3] = radii[1];
+}
+
+// FIXME: This should be refactored with CSSParser::parseBorderRadius.
+// CSSParser::parseBorderRadius contains support for some legacy radius construction.
+PassRefPtr<CSSBasicShape> CSSParser::parseInsetRoundedCorners(PassRefPtr<CSSBasicShapeInset> shape, CSSParserValueList* args)
+{
+ CSSParserValue* argument = args->next();
+
+ std::unique_ptr<CSSParserValueList> radiusArguments(new CSSParserValueList);
+ while (argument) {
+ radiusArguments->addValue(*argument);
+ argument = args->next();
+ }
+
+ unsigned num = radiusArguments->size();
+ if (!num || num > 9)
+ return nullptr;
+
+ RefPtr<CSSPrimitiveValue> radii[2][4];
+
+ unsigned indexAfterSlash = 0;
+ for (unsigned i = 0; i < num; ++i) {
+ CSSParserValue* value = radiusArguments->valueAt(i);
+ if (value->unit == CSSParserValue::Operator) {
+ if (value->iValue != '/')
+ return nullptr;
+
+ if (!i || indexAfterSlash || i + 1 == num || num > i + 5)
+ return nullptr;
+
+ indexAfterSlash = i + 1;
+ completeBorderRadii(radii[0]);
+ continue;
+ }
+
+ if (i - indexAfterSlash >= 4)
+ return nullptr;
+
+ if (!validUnit(value, FLength | FPercent | FNonNeg))
+ return nullptr;
+
+ RefPtr<CSSPrimitiveValue> radius = createPrimitiveNumericValue(value);
+
+ if (!indexAfterSlash)
+ radii[0][i] = radius;
+ else
+ radii[1][i - indexAfterSlash] = radius.release();
+ }
+
+ if (!indexAfterSlash) {
+ completeBorderRadii(radii[0]);
+ for (unsigned i = 0; i < 4; ++i)
+ radii[1][i] = radii[0][i];
+ } else
+ completeBorderRadii(radii[1]);
+
+ shape->setTopLeftRadius(createPrimitiveValuePair(radii[0][0].release(), radii[1][0].release()));
+ shape->setTopRightRadius(createPrimitiveValuePair(radii[0][1].release(), radii[1][1].release()));
+ shape->setBottomRightRadius(createPrimitiveValuePair(radii[0][2].release(), radii[1][2].release()));
+ shape->setBottomLeftRadius(createPrimitiveValuePair(radii[0][3].release(), radii[1][3].release()));
+
+ return shape;
+}
+
+PassRefPtr<CSSBasicShape> CSSParser::parseBasicShapeInset(CSSParserValueList* args)
+{
+ ASSERT(args);
+
+ RefPtr<CSSBasicShapeInset> shape = CSSBasicShapeInset::create();
+
+ unsigned argumentNumber = 0;
+ CSSParserValue* argument = args->current();
+ while (argument) {
+ if (argument->unit == CSSPrimitiveValue::CSS_IDENT) {
+ if (argumentNumber > 0 && equalIgnoringCase(argument->string, "round"))
+ return parseInsetRoundedCorners(shape.release(), args);
+ return nullptr;
+ }
+
+ Units unitFlags = FLength | FPercent| FNonNeg;
+ if (!validUnit(argument, unitFlags) || argumentNumber > 3)
+ return nullptr;
+
+ RefPtr<CSSPrimitiveValue> length = createPrimitiveNumericValue(argument);
+ switch (argumentNumber) {
+ case 0:
+ shape->setTop(length);
+ break;
+ case 1:
+ shape->setRight(length);
+ break;
+ case 2:
+ shape->setBottom(length);
+ break;
+ case 3:
+ shape->setLeft(length);
+ break;
+ }
+ argument = args->next();
+ argumentNumber++;
+ }
+
+ if (!argumentNumber)
+ return nullptr;
+
+ return shape;
+}
+
</ins><span class="cx"> PassRefPtr<CSSBasicShape> CSSParser::parseBasicShapeRectangle(CSSParserValueList* args)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(args);
</span><span class="lines">@@ -5818,6 +5936,8 @@
</span><span class="cx"> shape = parseBasicShapePolygon(args);
</span><span class="cx"> else if (equalIgnoringCase(value->function->name, "inset-rectangle("))
</span><span class="cx"> shape = parseBasicShapeInsetRectangle(args);
</span><ins>+ else if (equalIgnoringCase(value->function->name, "inset("))
+ shape = parseBasicShapeInset(args);
</ins><span class="cx">
</span><span class="cx"> if (!shape)
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -7509,18 +7629,6 @@
</span><span class="cx"> return parseBorderImageQuad(FLength | FInteger | FNonNeg, result);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static void completeBorderRadii(RefPtr<CSSPrimitiveValue> radii[4])
-{
- if (radii[3])
- return;
- if (!radii[2]) {
- if (!radii[1])
- radii[1] = radii[0];
- radii[2] = radii[0];
- }
- radii[3] = radii[1];
-}
-
</del><span class="cx"> bool CSSParser::parseBorderRadius(CSSPropertyID propId, bool important)
</span><span class="cx"> {
</span><span class="cx"> unsigned num = m_valueList->size();
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.h (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.h        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/Source/WebCore/css/CSSParser.h        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx"> class CSSValue;
</span><span class="cx"> class CSSValueList;
</span><span class="cx"> class CSSBasicShape;
</span><ins>+class CSSBasicShapeInset;
</ins><span class="cx"> class Document;
</span><span class="cx"> class Element;
</span><span class="cx"> class ImmutableStyleProperties;
</span><span class="lines">@@ -187,6 +188,7 @@
</span><span class="cx"> PassRefPtr<CSSBasicShape> parseDeprecatedBasicShapeEllipse(CSSParserValueList*);
</span><span class="cx"> PassRefPtr<CSSBasicShape> parseBasicShapePolygon(CSSParserValueList*);
</span><span class="cx"> PassRefPtr<CSSBasicShape> parseBasicShapeInsetRectangle(CSSParserValueList*);
</span><ins>+ PassRefPtr<CSSBasicShape> parseBasicShapeInset(CSSParserValueList*);
</ins><span class="cx">
</span><span class="cx"> bool parseFont(bool important);
</span><span class="cx"> PassRefPtr<CSSValueList> parseFontFamily();
</span><span class="lines">@@ -530,6 +532,8 @@
</span><span class="cx"> bool parseValue(MutableStyleProperties*, CSSPropertyID, const String&, bool important, StyleSheetContents* contextStyleSheet);
</span><span class="cx"> PassRef<ImmutableStyleProperties> parseDeclaration(const String&, StyleSheetContents* contextStyleSheet);
</span><span class="cx">
</span><ins>+ PassRefPtr<CSSBasicShape> parseInsetRoundedCorners(PassRefPtr<CSSBasicShapeInset>, CSSParserValueList*);
+
</ins><span class="cx"> enum SizeParameterType {
</span><span class="cx"> None,
</span><span class="cx"> Auto,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -268,7 +268,6 @@
</span><span class="cx"> m_value.string->ref();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-
</del><span class="cx"> CSSPrimitiveValue::CSSPrimitiveValue(RGBA32 color)
</span><span class="cx"> : CSSValue(PrimitiveClass)
</span><span class="cx"> {
</span><span class="lines">@@ -314,6 +313,12 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+CSSPrimitiveValue::CSSPrimitiveValue(const LengthSize& lengthSize)
+ : CSSValue(PrimitiveClass)
+{
+ init(lengthSize);
+}
+
</ins><span class="cx"> void CSSPrimitiveValue::init(const Length& length)
</span><span class="cx"> {
</span><span class="cx"> switch (length.type()) {
</span><span class="lines">@@ -378,6 +383,13 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void CSSPrimitiveValue::init(const LengthSize& lengthSize)
+{
+ m_primitiveUnitType = CSS_PAIR;
+ m_hasCachedCSSText = false;
+ m_value.pair = Pair::create(create(lengthSize.width()), create(lengthSize.height())).leakRef();
+}
+
</ins><span class="cx"> void CSSPrimitiveValue::init(PassRefPtr<Counter> c)
</span><span class="cx"> {
</span><span class="cx"> m_primitiveUnitType = CSS_COUNTER;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.h (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValue.h        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.h        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -43,6 +43,7 @@
</span><span class="cx"> class CSSBasicShape;
</span><span class="cx">
</span><span class="cx"> struct Length;
</span><ins>+struct LengthSize;
</ins><span class="cx">
</span><span class="cx"> // Dimension calculations are imprecise, often resulting in values of e.g.
</span><span class="cx"> // 44.99998. We need to go ahead and round if we're really close to the next
</span><span class="lines">@@ -213,6 +214,7 @@
</span><span class="cx"> static PassRef<CSSPrimitiveValue> create(double value, UnitTypes type) { return adoptRef(*new CSSPrimitiveValue(value, type)); }
</span><span class="cx"> static PassRef<CSSPrimitiveValue> create(const String& value, UnitTypes type) { return adoptRef(*new CSSPrimitiveValue(value, type)); }
</span><span class="cx"> static PassRef<CSSPrimitiveValue> create(const Length& value, const RenderStyle* style) { return adoptRef(*new CSSPrimitiveValue(value, style)); }
</span><ins>+ static PassRef<CSSPrimitiveValue> create(const LengthSize& value) { return adoptRef(*new CSSPrimitiveValue(value)); }
</ins><span class="cx">
</span><span class="cx"> template<typename T> static PassRef<CSSPrimitiveValue> create(T value)
</span><span class="cx"> {
</span><span class="lines">@@ -344,6 +346,7 @@
</span><span class="cx"> CSSPrimitiveValue(unsigned color); // RGB value
</span><span class="cx"> CSSPrimitiveValue(const Length&);
</span><span class="cx"> CSSPrimitiveValue(const Length&, const RenderStyle*);
</span><ins>+ CSSPrimitiveValue(const LengthSize&);
</ins><span class="cx"> CSSPrimitiveValue(const String&, UnitTypes);
</span><span class="cx"> CSSPrimitiveValue(double, UnitTypes);
</span><span class="cx">
</span><span class="lines">@@ -365,6 +368,7 @@
</span><span class="cx"> template<typename T> operator T*(); // compile-time guard
</span><span class="cx">
</span><span class="cx"> void init(const Length&);
</span><ins>+ void init(const LengthSize&);
</ins><span class="cx"> void init(PassRefPtr<Counter>);
</span><span class="cx"> void init(PassRefPtr<Rect>);
</span><span class="cx"> void init(PassRefPtr<Pair>);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValuePoolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValuePool.h (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValuePool.h        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/Source/WebCore/css/CSSValuePool.h        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> PassRef<CSSPrimitiveValue> createValue(double value, CSSPrimitiveValue::UnitTypes);
</span><span class="cx"> PassRef<CSSPrimitiveValue> createValue(const String& value, CSSPrimitiveValue::UnitTypes type) { return CSSPrimitiveValue::create(value, type); }
</span><span class="cx"> PassRef<CSSPrimitiveValue> createValue(const Length& value, const RenderStyle* style) { return CSSPrimitiveValue::create(value, style); }
</span><ins>+ PassRef<CSSPrimitiveValue> createValue(const LengthSize& value) { return CSSPrimitiveValue::create(value); }
</ins><span class="cx"> template<typename T> static PassRef<CSSPrimitiveValue> createValue(T value) { return CSSPrimitiveValue::create(value); }
</span><span class="cx">
</span><span class="cx"> void drain();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformLengthSizeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/LengthSize.h (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/LengthSize.h        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/Source/WebCore/platform/LengthSize.h        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -48,6 +48,11 @@
</span><span class="cx"> void setHeight(Length height) { m_height = std::move(height); }
</span><span class="cx"> const Length& height() const { return m_height; }
</span><span class="cx">
</span><ins>+ LengthSize blend(const LengthSize& from, double progress) const
+ {
+ return LengthSize(m_width.blend(from.width(), progress), m_height.blend(from.height(), progress));
+ }
+
</ins><span class="cx"> private:
</span><span class="cx"> Length m_width;
</span><span class="cx"> Length m_height;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingshapesShapeInsideInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/shapes/ShapeInsideInfo.cpp (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/shapes/ShapeInsideInfo.cpp        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/Source/WebCore/rendering/shapes/ShapeInsideInfo.cpp        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">
</span><span class="cx"> switch (shapeValue->type()) {
</span><span class="cx"> case ShapeValue::Shape:
</span><del>- return shapeValue->shape() && shapeValue->shape()->type() != BasicShape::BasicShapeInsetRectangleType;
</del><ins>+ return shapeValue->shape() && shapeValue->shape()->type() != BasicShape::BasicShapeInsetRectangleType && shapeValue->shape()->type() != BasicShape::BasicShapeInsetType;
</ins><span class="cx"> case ShapeValue::Image:
</span><span class="cx"> return shapeValue->isImageValid() && checkShapeImageOrigin(renderer.document(), *(shapeValue->image()->cachedImage()));
</span><span class="cx"> case ShapeValue::Box:
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleBasicShapescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/BasicShapes.cpp (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/BasicShapes.cpp        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/Source/WebCore/rendering/style/BasicShapes.cpp        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -299,4 +299,54 @@
</span><span class="cx"> result->setCornerRadiusY(m_cornerRadiusY.blend(o->cornerRadiusY(), progress));
</span><span class="cx"> return result.release();
</span><span class="cx"> }
</span><ins>+
+void BasicShapeInset::path(Path& path, const FloatRect& boundingBox)
+{
+ ASSERT(path.isEmpty());
+ float left = floatValueForLength(m_left, boundingBox.width());
+ float top = floatValueForLength(m_top, boundingBox.height());
+ path.addRoundedRect(
+ FloatRect(
+ left + boundingBox.x(),
+ top + boundingBox.y(),
+ std::max<float>(boundingBox.width() - left - floatValueForLength(m_right, boundingBox.width()), 0),
+ std::max<float>(boundingBox.height() - top - floatValueForLength(m_bottom, boundingBox.height()), 0)
+ ),
+ FloatSize(
+ floatValueForLength(m_topLeftRadius.width(), boundingBox.width()),
+ floatValueForLength(m_topLeftRadius.height(), boundingBox.height())
+ ),
+ FloatSize(
+ floatValueForLength(m_topRightRadius.width(), boundingBox.width()),
+ floatValueForLength(m_topRightRadius.height(), boundingBox.height())
+ ),
+ FloatSize(
+ floatValueForLength(m_bottomRightRadius.width(), boundingBox.width()),
+ floatValueForLength(m_bottomRightRadius.height(), boundingBox.height())
+ ),
+ FloatSize(
+ floatValueForLength(m_bottomLeftRadius.width(), boundingBox.width()),
+ floatValueForLength(m_bottomLeftRadius.height(), boundingBox.height())
+ )
+ );
</ins><span class="cx"> }
</span><ins>+
+PassRefPtr<BasicShape> BasicShapeInset::blend(const BasicShape* other, double progress) const
+{
+ ASSERT(type() == other->type());
+
+ const BasicShapeInset* o = static_cast<const BasicShapeInset*>(other);
+ RefPtr<BasicShapeInset> result = BasicShapeInset::create();
+ result->setTop(m_top.blend(o->top(), progress));
+ result->setRight(m_right.blend(o->right(), progress));
+ result->setBottom(m_bottom.blend(o->bottom(), progress));
+ result->setLeft(m_left.blend(o->left(), progress));
+
+ result->setTopLeftRadius(m_topLeftRadius.blend(o->topLeftRadius(), progress));
+ result->setTopRightRadius(m_topRightRadius.blend(o->topRightRadius(), progress));
+ result->setBottomRightRadius(m_bottomRightRadius.blend(o->bottomRightRadius(), progress));
+ result->setBottomLeftRadius(m_bottomLeftRadius.blend(o->bottomLeftRadius(), progress));
+
+ return result.release();
+}
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleBasicShapesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/BasicShapes.h (159967 => 159968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/BasicShapes.h        2013-12-02 22:42:34 UTC (rev 159967)
+++ trunk/Source/WebCore/rendering/style/BasicShapes.h        2013-12-02 22:48:54 UTC (rev 159968)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #define BasicShapes_h
</span><span class="cx">
</span><span class="cx"> #include "Length.h"
</span><ins>+#include "LengthSize.h"
</ins><span class="cx"> #include "WindRule.h"
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/RefPtr.h>
</span><span class="lines">@@ -52,7 +53,8 @@
</span><span class="cx"> BasicShapePolygonType = 4,
</span><span class="cx"> BasicShapeInsetRectangleType = 5,
</span><span class="cx"> BasicShapeCircleType = 6,
</span><del>- BasicShapeEllipseType = 7
</del><ins>+ BasicShapeEllipseType = 7,
+ BasicShapeInsetType = 8
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> enum ReferenceBox {
</span><span class="lines">@@ -352,5 +354,48 @@
</span><span class="cx"> Length m_cornerRadiusX;
</span><span class="cx"> Length m_cornerRadiusY;
</span><span class="cx"> };
</span><ins>+
+class BasicShapeInset : public BasicShape {
+public:
+ static PassRefPtr<BasicShapeInset> create() { return adoptRef(new BasicShapeInset); }
+
+ const Length& top() const { return m_top; }
+ const Length& right() const { return m_right; }
+ const Length& bottom() const { return m_bottom; }
+ const Length& left() const { return m_left; }
+
+ const LengthSize& topLeftRadius() const { return m_topLeftRadius; }
+ const LengthSize& topRightRadius() const { return m_topRightRadius; }
+ const LengthSize& bottomRightRadius() const { return m_bottomRightRadius; }
+ const LengthSize& bottomLeftRadius() const { return m_bottomLeftRadius; }
+
+ void setTop(Length top) { m_top = std::move(top); }
+ void setRight(Length right) { m_right = std::move(right); }
+ void setBottom(Length bottom) { m_bottom = std::move(bottom); }
+ void setLeft(Length left) { m_left = std::move(left); }
+
+ void setTopLeftRadius(LengthSize radius) { m_topLeftRadius = std::move(radius); }
+ void setTopRightRadius(LengthSize radius) { m_topRightRadius = std::move(radius); }
+ void setBottomRightRadius(LengthSize radius) { m_bottomRightRadius = std::move(radius); }
+ void setBottomLeftRadius(LengthSize radius) { m_bottomLeftRadius = std::move(radius); }
+
+ virtual void path(Path&, const FloatRect&) OVERRIDE;
+ virtual PassRefPtr<BasicShape> blend(const BasicShape*, double) const OVERRIDE;
+
+ virtual Type type() const OVERRIDE { return BasicShapeInsetType; }
+private:
+ BasicShapeInset() { }
+
+ Length m_right;
+ Length m_top;
+ Length m_bottom;
+ Length m_left;
+
+ LengthSize m_topLeftRadius;
+ LengthSize m_topRightRadius;
+ LengthSize m_bottomRightRadius;
+ LengthSize m_bottomLeftRadius;
+};
+
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>
</body>
</html>