<!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>[162475] 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/162475">162475</a></dd>
<dt>Author</dt> <dd>betravis@adobe.com</dd>
<dt>Date</dt> <dd>2014-01-21 14:23:53 -0800 (Tue, 21 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[CSS Shapes] Preserve box-shape order when serializing shape values
https://bugs.webkit.org/show_bug.cgi?id=127200
Reviewed by Dirk Schulze.
Source/WebCore:
Convert the parsed shape-box pair to a CSSValueList rather than directly
adding the box value to BasicShape. The CSSValueList preserves the
shape-box ordering, and cleans up a little bit of the code shared between
clip and shape values.
Modifying existing parsing tests.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::shapePropertyValue): Factor out code common to generating shape
values.
(WebCore::ComputedStyleExtractor::propertyValue): Generate a CSSValueList when
you have both a shape and a box.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseBasicShapeAndOrBox): Factor out code common to clip
paths and shape properties that parses the [basic-shape || box] syntax from
the CSS Shapes spec.
(WebCore::CSSParser::parseShapeProperty): Parse shape-box pairs as a CSSValueList.
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyShape::applyValue): Use the CSSValueList for shape-box pairs.
* css/CSSValueList.h:
(WebCore::CSSValueList::itemWithoutBoundsCheck): Add a const version.
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc): Specify a box when blending.
* rendering/style/ShapeValue.h:
(WebCore::ShapeValue::createShapeValue): Add a box parameter.
(WebCore::ShapeValue::ShapeValue): Ditto.
LayoutTests:
Modify the expectations for box shape pairs, preserving the order of
the arguments in non-computed values. Computed values are still a
shape followed by a box.
* 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="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</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="#trunkSourceWebCorecssCSSValueListh">trunk/Source/WebCore/css/CSSValueList.h</a></li>
<li><a href="#trunkSourceWebCorecssDeprecatedStyleBuildercpp">trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorepageanimationCSSPropertyAnimationcpp">trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleShapeValueh">trunk/Source/WebCore/rendering/style/ShapeValue.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (162474 => 162475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-01-21 22:14:37 UTC (rev 162474)
+++ trunk/LayoutTests/ChangeLog        2014-01-21 22:23:53 UTC (rev 162475)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2014-01-21 Bear Travis <betravis@adobe.com>
+
+ [CSS Shapes] Preserve box-shape order when serializing shape values
+ https://bugs.webkit.org/show_bug.cgi?id=127200
+
+ Reviewed by Dirk Schulze.
+
+ Modify the expectations for box shape pairs, preserving the order of
+ the arguments in non-computed values. Computed values are still a
+ shape followed by a box.
+
+ * 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"> 2014-01-21 Alexey Proskuryakov <ap@apple.com>
</span><span class="cx">
</span><span class="cx"> platform/mac/accessibility/iframe-aria-hidden.html is flaky
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesparsingparsingshapeinsideexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt (162474 => 162475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt        2014-01-21 22:14:37 UTC (rev 162474)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-shape-inside-expected.txt        2014-01-21 22:23:53 UTC (rev 162475)
</span><span class="lines">@@ -107,13 +107,13 @@
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) border-box") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) border-box"
</span><span class="cx"> PASS getCSSText("-webkit-shape-inside", "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) margin-box") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) margin-box"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) margin-box") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) margin-box"
</span><del>-PASS getCSSText("-webkit-shape-inside", "content-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) content-box"
</del><ins>+PASS getCSSText("-webkit-shape-inside", "content-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "content-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)"
</ins><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "content-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) content-box"
</span><del>-PASS getCSSText("-webkit-shape-inside", "padding-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) padding-box"
</del><ins>+PASS getCSSText("-webkit-shape-inside", "padding-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "padding-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)"
</ins><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "padding-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) padding-box"
</span><del>-PASS getCSSText("-webkit-shape-inside", "border-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) border-box"
</del><ins>+PASS getCSSText("-webkit-shape-inside", "border-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "border-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)"
</ins><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "border-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) border-box"
</span><del>-PASS getCSSText("-webkit-shape-inside", "margin-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) margin-box"
</del><ins>+PASS getCSSText("-webkit-shape-inside", "margin-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "margin-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)"
</ins><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "margin-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) margin-box"
</span><span class="cx"> PASS getCSSText("-webkit-shape-inside", "outside-shape") is "outside-shape"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-inside", "outside-shape") is "outside-shape"
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesparsingparsingshapeoutsideexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt (162474 => 162475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt        2014-01-21 22:14:37 UTC (rev 162474)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-shape-outside-expected.txt        2014-01-21 22:23:53 UTC (rev 162475)
</span><span class="lines">@@ -107,13 +107,13 @@
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) border-box") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) border-box"
</span><span class="cx"> PASS getCSSText("-webkit-shape-outside", "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) margin-box") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) margin-box"
</span><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) margin-box") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) margin-box"
</span><del>-PASS getCSSText("-webkit-shape-outside", "content-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) content-box"
</del><ins>+PASS getCSSText("-webkit-shape-outside", "content-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "content-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)"
</ins><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "content-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) content-box"
</span><del>-PASS getCSSText("-webkit-shape-outside", "padding-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) padding-box"
</del><ins>+PASS getCSSText("-webkit-shape-outside", "padding-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "padding-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)"
</ins><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "padding-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) padding-box"
</span><del>-PASS getCSSText("-webkit-shape-outside", "border-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) border-box"
</del><ins>+PASS getCSSText("-webkit-shape-outside", "border-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "border-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)"
</ins><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "border-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) border-box"
</span><del>-PASS getCSSText("-webkit-shape-outside", "margin-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) margin-box"
</del><ins>+PASS getCSSText("-webkit-shape-outside", "margin-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "margin-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)"
</ins><span class="cx"> PASS getComputedStyleValue("-webkit-shape-outside", "margin-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)") is "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) margin-box"
</span><span class="cx"> PASS removeBaseURL(getCSSText("-webkit-shape-outside", "url('image')")) is "url(image)"
</span><span class="cx"> PASS removeBaseURL(getComputedStyleValue("-webkit-shape-outside", "url('image')")) is "url(image)"
</span></span></pre></div>
<a id="trunkLayoutTestsfastshapesparsingparsingtestutilsjs"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js (162474 => 162475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js        2014-01-21 22:14:37 UTC (rev 162474)
+++ trunk/LayoutTests/fast/shapes/parsing/parsing-test-utils.js        2014-01-21 22:23:53 UTC (rev 162475)
</span><span class="lines">@@ -67,10 +67,10 @@
</span><span class="cx"> "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) border-box",
</span><span class="cx"> "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) margin-box",
</span><span class="cx">
</span><del>- ["content-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) content-box"],
- ["padding-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) padding-box"],
- ["border-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) border-box"],
- ["margin-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) margin-box"]
</del><ins>+ ["content-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "content-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) content-box"],
+ ["padding-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "padding-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) padding-box"],
+ ["border-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "border-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) border-box"],
+ ["margin-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "margin-box polygon(nonzero, 0px 0px, 10px 10px, 10px 0px)", "polygon(nonzero, 0px 0px, 10px 10px, 10px 0px) margin-box"]
</ins><span class="cx"> ];
</span><span class="cx">
</span><span class="cx"> // Invalid values for both shape-inside and shape-outside. When an invalid shape value is specified, the
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (162474 => 162475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-21 22:14:37 UTC (rev 162474)
+++ trunk/Source/WebCore/ChangeLog        2014-01-21 22:23:53 UTC (rev 162475)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2014-01-21 Bear Travis <betravis@adobe.com>
+
+ [CSS Shapes] Preserve box-shape order when serializing shape values
+ https://bugs.webkit.org/show_bug.cgi?id=127200
+
+ Reviewed by Dirk Schulze.
+
+ Convert the parsed shape-box pair to a CSSValueList rather than directly
+ adding the box value to BasicShape. The CSSValueList preserves the
+ shape-box ordering, and cleans up a little bit of the code shared between
+ clip and shape values.
+
+ Modifying existing parsing tests.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::shapePropertyValue): Factor out code common to generating shape
+ values.
+ (WebCore::ComputedStyleExtractor::propertyValue): Generate a CSSValueList when
+ you have both a shape and a box.
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseBasicShapeAndOrBox): Factor out code common to clip
+ paths and shape properties that parses the [basic-shape || box] syntax from
+ the CSS Shapes spec.
+ (WebCore::CSSParser::parseShapeProperty): Parse shape-box pairs as a CSSValueList.
+ * css/DeprecatedStyleBuilder.cpp:
+ (WebCore::ApplyPropertyShape::applyValue): Use the CSSValueList for shape-box pairs.
+ * css/CSSValueList.h:
+ (WebCore::CSSValueList::itemWithoutBoundsCheck): Add a const version.
+ * page/animation/CSSPropertyAnimation.cpp:
+ (WebCore::blendFunc): Specify a box when blending.
+ * rendering/style/ShapeValue.h:
+ (WebCore::ShapeValue::createShapeValue): Add a box parameter.
+ (WebCore::ShapeValue::ShapeValue): Ditto.
+
</ins><span class="cx"> 2014-01-21 Daniel Bates <dabates@apple.com>
</span><span class="cx">
</span><span class="cx"> Fix the iOS Simulator release build
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (162474 => 162475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-01-21 22:14:37 UTC (rev 162474)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-01-21 22:23:53 UTC (rev 162475)
</span><span class="lines">@@ -1763,6 +1763,31 @@
</span><span class="cx"> return styledNode->computedStyle(styledNode->isPseudoElement() ? NOPSEUDO : pseudoElementSpecifier);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ENABLE(CSS_SHAPES)
+static PassRefPtr<CSSValue> shapePropertyValue(const RenderStyle* style, const ShapeValue* shapeValue)
+{
+ if (!shapeValue)
+ return cssValuePool().createIdentifierValue(CSSValueNone);
+
+ if (shapeValue->type() == ShapeValue::Outside)
+ return cssValuePool().createIdentifierValue(CSSValueOutsideShape);
+
+ if (shapeValue->type() == ShapeValue::Box)
+ return cssValuePool().createValue(shapeValue->layoutBox());
+
+ if (shapeValue->type() == ShapeValue::Image)
+ return shapeValue->image() ? shapeValue->image()->cssValue() : cssValuePool().createIdentifierValue(CSSValueNone);
+
+ ASSERT(shapeValue->type() == ShapeValue::Shape);
+
+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ list->append(valueForBasicShape(style, shapeValue->shape()));
+ if (shapeValue->layoutBox() != BoxMissing)
+ list->append(cssValuePool().createValue(shapeValue->layoutBox()));
+ return list.release();
+}
+#endif
+
</ins><span class="cx"> PassRefPtr<CSSValue> ComputedStyleExtractor::propertyValue(CSSPropertyID propertyID, EUpdateLayout updateLayout) const
</span><span class="cx"> {
</span><span class="cx"> Node* styledNode = this->styledNode();
</span><span class="lines">@@ -2938,31 +2963,9 @@
</span><span class="cx"> case CSSPropertyWebkitShapeImageThreshold:
</span><span class="cx"> return cssValuePool().createValue(style->shapeImageThreshold(), CSSPrimitiveValue::CSS_NUMBER);
</span><span class="cx"> case CSSPropertyWebkitShapeInside:
</span><del>- if (!style->shapeInside())
- return cssValuePool().createIdentifierValue(CSSValueNone);
- if (style->shapeInside()->type() == ShapeValue::Box)
- return cssValuePool().createValue(style->shapeInside()->layoutBox());
- if (style->shapeInside()->type() == ShapeValue::Outside)
- return cssValuePool().createIdentifierValue(CSSValueOutsideShape);
- if (style->shapeInside()->type() == ShapeValue::Image) {
- if (style->shapeInside()->image())
- return style->shapeInside()->image()->cssValue();
- return cssValuePool().createIdentifierValue(CSSValueNone);
- }
- ASSERT(style->shapeInside()->type() == ShapeValue::Shape);
- return valueForBasicShape(style.get(), style->shapeInside()->shape());
</del><ins>+ return shapePropertyValue(style.get(), style->shapeInside());
</ins><span class="cx"> case CSSPropertyWebkitShapeOutside:
</span><del>- if (!style->shapeOutside())
- return cssValuePool().createIdentifierValue(CSSValueNone);
- if (style->shapeOutside()->type() == ShapeValue::Box)
- return cssValuePool().createValue(style->shapeOutside()->layoutBox());
- if (style->shapeOutside()->type() == ShapeValue::Image) {
- if (style->shapeOutside()->image())
- return style->shapeOutside()->image()->cssValue();
- return cssValuePool().createIdentifierValue(CSSValueNone);
- }
- ASSERT(style->shapeOutside()->type() == ShapeValue::Shape);
- return valueForBasicShape(style.get(), style->shapeOutside()->shape());
</del><ins>+ return shapePropertyValue(style.get(), style->shapeOutside());
</ins><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(CSS_FILTERS)
</span><span class="cx"> case CSSPropertyWebkitFilter:
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (162474 => 162475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2014-01-21 22:14:37 UTC (rev 162474)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2014-01-21 22:23:53 UTC (rev 162475)
</span><span class="lines">@@ -5843,7 +5843,7 @@
</span><span class="cx"> return shape;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static bool isBoxValue(CSSValueID valueId)
</del><ins>+static bool isBoxValue(CSSValueID valueId, CSSPropertyID propId)
</ins><span class="cx"> {
</span><span class="cx"> switch (valueId) {
</span><span class="cx"> case CSSValueContentBox:
</span><span class="lines">@@ -5851,12 +5851,48 @@
</span><span class="cx"> case CSSValueBorderBox:
</span><span class="cx"> case CSSValueMarginBox:
</span><span class="cx"> return true;
</span><ins>+ case CSSValueBoundingBox:
+ return propId == CSSPropertyWebkitClipPath;
</ins><span class="cx"> default: break;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+PassRefPtr<CSSValue> CSSParser::parseBasicShapeAndOrBox(CSSPropertyID propId)
+{
+ CSSParserValue* value = m_valueList->current();
+
+ bool shapeFound = false;
+ bool boxFound = false;
+ CSSValueID valueId;
+
+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ for (unsigned i = 0; i < 2; ++i) {
+ if (!value)
+ break;
+ valueId = value->id;
+ if (value->unit == CSSParserValue::Function && !shapeFound) {
+ // parseBasicShape already asks for the next value list item.
+ RefPtr<CSSPrimitiveValue> shapeValue = parseBasicShape();
+ if (!shapeValue)
+ return nullptr;
+ list->append(shapeValue.release());
+ shapeFound = true;
+ } else if (isBoxValue(valueId, propId) && !boxFound) {
+ list->append(parseValidPrimitive(valueId, value));
+ boxFound = true;
+ m_valueList->next();
+ } else
+ return nullptr;
+ value = m_valueList->current();
+ }
+
+ if (m_valueList->current())
+ return nullptr;
+ return list.release();
+}
+
</ins><span class="cx"> #if ENABLE(CSS_SHAPES)
</span><span class="cx"> PassRefPtr<CSSValue> CSSParser::parseShapeProperty(CSSPropertyID propId)
</span><span class="cx"> {
</span><span class="lines">@@ -5881,33 +5917,7 @@
</span><span class="cx"> return imageValue.release();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- if (value->unit == CSSParserValue::Function) {
- shapeValue = parseBasicShape();
- } else if (isBoxValue(valueId)) {
- keywordValue = parseValidPrimitive(valueId, value);
- m_valueList->next();
- } else
- return nullptr;
-
- value = m_valueList->current();
-
- if (value) {
- valueId = value->id;
- if (keywordValue && value->unit == CSSParserValue::Function) {
- shapeValue = parseBasicShape();
- } else if (shapeValue && isBoxValue(valueId)) {
- keywordValue = parseValidPrimitive(valueId, value);
- m_valueList->next();
- } else
- return nullptr;
- }
-
- ASSERT(!shapeValue || shapeValue->isShape());
-
- if (shapeValue && keywordValue)
- shapeValue->getShapeValue()->setLayoutBox(keywordValue.release());
-
- return shapeValue ? shapeValue.release() : keywordValue.release();
</del><ins>+ return parseBasicShapeAndOrBox(propId);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -5927,31 +5937,7 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- bool shapeFound = false;
- bool boxFound = false;
- RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
- for (unsigned i = 0; i < 2; ++i) {
- if (!value)
- break;
- valueId = value->id;
- if (value->unit == CSSParserValue::Function && !shapeFound) {
- // parseBasicShape already asks for the next value list item.
- RefPtr<CSSPrimitiveValue> shapeValue = parseBasicShape();
- if (!shapeValue)
- return nullptr;
- list->append(shapeValue.release());
- shapeFound = true;
- } else if ((isBoxValue(valueId) || valueId == CSSValueBoundingBox) && !boxFound) {
- list->append(parseValidPrimitive(valueId, value));
- boxFound = true;
- m_valueList->next();
- } else
- return nullptr;
- value = m_valueList->current();
- }
- if (value)
- return nullptr;
- return list.release();
</del><ins>+ return parseBasicShapeAndOrBox(CSSPropertyWebkitClipPath);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // FIXME This function is temporary to allow for an orderly transition between
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.h (162474 => 162475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.h        2014-01-21 22:14:37 UTC (rev 162474)
+++ trunk/Source/WebCore/css/CSSParser.h        2014-01-21 22:23:53 UTC (rev 162475)
</span><span class="lines">@@ -179,6 +179,7 @@
</span><span class="cx"> PassRefPtr<CSSValue> parseShapeProperty(CSSPropertyID);
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ PassRefPtr<CSSValue> parseBasicShapeAndOrBox(CSSPropertyID propId);
</ins><span class="cx"> PassRefPtr<CSSPrimitiveValue> parseBasicShape();
</span><span class="cx"> PassRefPtr<CSSPrimitiveValue> parseShapeRadius(CSSParserValue*);
</span><span class="cx"> PassRefPtr<CSSBasicShape> parseBasicShapeRectangle(CSSParserValueList*);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValueList.h (162474 => 162475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValueList.h        2014-01-21 22:14:37 UTC (rev 162474)
+++ trunk/Source/WebCore/css/CSSValueList.h        2014-01-21 22:23:53 UTC (rev 162475)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx"> CSSValue* item(size_t index) { return index < m_values.size() ? m_values[index].get() : 0; }
</span><span class="cx"> const CSSValue* item(size_t index) const { return index < m_values.size() ? m_values[index].get() : 0; }
</span><span class="cx"> CSSValue* itemWithoutBoundsCheck(size_t index) { return m_values[index].get(); }
</span><ins>+ const CSSValue* itemWithoutBoundsCheck(size_t index) const { ASSERT(index < m_values.size()); return m_values[index].get(); }
</ins><span class="cx">
</span><span class="cx"> void append(PassRefPtr<CSSValue> value) { m_values.append(value); }
</span><span class="cx"> void prepend(PassRefPtr<CSSValue> value) { m_values.insert(0, value); }
</span></span></pre></div>
<a id="trunkSourceWebCorecssDeprecatedStyleBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (162474 => 162475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-01-21 22:14:37 UTC (rev 162474)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-01-21 22:23:53 UTC (rev 162475)
</span><span class="lines">@@ -2182,23 +2182,36 @@
</span><span class="cx"> CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</span><span class="cx"> if (primitiveValue->getValueID() == CSSValueAuto)
</span><span class="cx"> setValue(styleResolver->style(), 0);
</span><del>- else if (primitiveValue->getValueID() == CSSValueContentBox
- || primitiveValue->getValueID() == CSSValueBorderBox
- || primitiveValue->getValueID() == CSSValuePaddingBox
- || primitiveValue->getValueID() == CSSValueMarginBox)
- setValue(styleResolver->style(), ShapeValue::createLayoutBoxValue(LayoutBox(*primitiveValue)));
</del><span class="cx"> else if (primitiveValue->getValueID() == CSSValueOutsideShape)
</span><span class="cx"> setValue(styleResolver->style(), ShapeValue::createOutsideValue());
</span><del>- else if (primitiveValue->isShape()) {
- RefPtr<ShapeValue> shape = ShapeValue::createShapeValue(basicShapeForValue(styleResolver->style(), styleResolver->rootElementStyle(), primitiveValue->getShapeValue()));
- setValue(styleResolver->style(), shape.release());
- }
</del><span class="cx"> } else if (value->isImageValue() || value->isImageSetValue()) {
</span><span class="cx"> RefPtr<ShapeValue> shape = ShapeValue::createImageValue(styleResolver->styleImage(property, value));
</span><span class="cx"> setValue(styleResolver->style(), shape.release());
</span><ins>+ } else if (value->isValueList()) {
+ RefPtr<BasicShape> shape;
+ LayoutBox layoutBox = BoxMissing;
+ CSSValueList* valueList = toCSSValueList(value);
+ for (unsigned i = 0; i < valueList->length(); ++i) {
+ CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(valueList->itemWithoutBoundsCheck(i));
+ if (primitiveValue->isShape())
+ shape = basicShapeForValue(styleResolver->style(), styleResolver->rootElementStyle(), primitiveValue->getShapeValue());
+ else if (primitiveValue->getValueID() == CSSValueContentBox
+ || primitiveValue->getValueID() == CSSValueBorderBox
+ || primitiveValue->getValueID() == CSSValuePaddingBox
+ || primitiveValue->getValueID() == CSSValueMarginBox)
+ layoutBox = LayoutBox(*primitiveValue);
+ else
+ return;
+ }
+
+ if (shape)
+ setValue(styleResolver->style(), ShapeValue::createShapeValue(shape.release(), layoutBox));
+ else if (layoutBox != BoxMissing)
+ setValue(styleResolver->style(), ShapeValue::createLayoutBoxValue(layoutBox));
+
</ins><span class="cx"> }
</span><ins>+ }
</ins><span class="cx">
</span><del>- }
</del><span class="cx"> static PropertyHandler createHandler()
</span><span class="cx"> {
</span><span class="cx"> PropertyHandler handler = ApplyPropertyDefaultBase<ShapeValue*, getterFunction, PassRefPtr<ShapeValue>, setterFunction, ShapeValue*, initialFunction>::createHandler();
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCSSPropertyAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (162474 => 162475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2014-01-21 22:14:37 UTC (rev 162474)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2014-01-21 22:23:53 UTC (rev 162475)
</span><span class="lines">@@ -153,13 +153,16 @@
</span><span class="cx"> if (from->type() != ShapeValue::Shape || to->type() != ShapeValue::Shape)
</span><span class="cx"> return to;
</span><span class="cx">
</span><ins>+ if (from->layoutBox() != to->layoutBox())
+ return to;
+
</ins><span class="cx"> const BasicShape* fromShape = from->shape();
</span><span class="cx"> const BasicShape* toShape = to->shape();
</span><span class="cx">
</span><span class="cx"> if (!fromShape->canBlend(toShape))
</span><span class="cx"> return to;
</span><span class="cx">
</span><del>- return ShapeValue::createShapeValue(toShape->blend(fromShape, progress));
</del><ins>+ return ShapeValue::createShapeValue(toShape->blend(fromShape, progress), to->layoutBox());
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleShapeValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/ShapeValue.h (162474 => 162475)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/ShapeValue.h        2014-01-21 22:14:37 UTC (rev 162474)
+++ trunk/Source/WebCore/rendering/style/ShapeValue.h        2014-01-21 22:23:53 UTC (rev 162475)
</span><span class="lines">@@ -48,9 +48,9 @@
</span><span class="cx"> Image
</span><span class="cx"> };
</span><span class="cx">
</span><del>- static PassRefPtr<ShapeValue> createShapeValue(PassRefPtr<BasicShape> shape)
</del><ins>+ static PassRefPtr<ShapeValue> createShapeValue(PassRefPtr<BasicShape> shape, LayoutBox layoutBox)
</ins><span class="cx"> {
</span><del>- return adoptRef(new ShapeValue(shape));
</del><ins>+ return adoptRef(new ShapeValue(shape, layoutBox));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static PassRefPtr<ShapeValue> createLayoutBoxValue(LayoutBox layoutBox)
</span><span class="lines">@@ -84,10 +84,10 @@
</span><span class="cx"> bool operator==(const ShapeValue& other) const { return type() == other.type(); }
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- ShapeValue(PassRefPtr<BasicShape> shape)
</del><ins>+ ShapeValue(PassRefPtr<BasicShape> shape, LayoutBox layoutBox)
</ins><span class="cx"> : m_type(Shape)
</span><span class="cx"> , m_shape(shape)
</span><del>- , m_layoutBox(m_shape->layoutBox())
</del><ins>+ , m_layoutBox(layoutBox)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> ShapeValue(ShapeValueType type)
</span></span></pre>
</div>
</div>
</body>
</html>