<!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>[163840] 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/163840">163840</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2014-02-10 17:20:28 -0800 (Mon, 10 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update aspect-ratio property to have constraining keywords
https://bugs.webkit.org/show_bug.cgi?id=128262

Reviewed by Simon Fraser.

Source/WebCore:

Add support for &quot;from-dimensions&quot; and &quot;from-intrinsic&quot;
property values to &quot;-webkit-aspect-ratio&quot;. I also changed
the default value from &quot;none&quot; to &quot;auto&quot;, because &quot;none&quot; doesn't
make sense any more.

Covered by enhancing existing tests.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue): New keywords.
* css/CSSParser.cpp:
(WebCore::CSSParser::parseAspectRatio): Support new keywords.
* css/CSSValueKeywords.in: Add from-dimensions and from-intrinsic.
* css/DeprecatedStyleBuilder.cpp: This now has to handle the new
values. I also changed &quot;none&quot; to &quot;auto&quot;.
(WebCore::ApplyPropertyAspectRatio::applyInheritValue):
(WebCore::ApplyPropertyAspectRatio::applyInitialValue):
(WebCore::ApplyPropertyAspectRatio::applyValue):
* rendering/style/RenderStyle.h: hasAspectRatio is now aspectRatioType
and indicates one of the three keywords, or a specified number.
* rendering/style/RenderStyleConstants.h: New enum.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:

LayoutTests:

Add tests for new from-intrinsic and from-dimensions
property values.

* fast/css/aspect-ratio-inheritance-expected.txt:
* fast/css/aspect-ratio-inheritance.html:
* fast/css/aspect-ratio-parsing-tests-expected.txt:
* fast/css/aspect-ratio-parsing-tests.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcssaspectratioinheritanceexpectedtxt">trunk/LayoutTests/fast/css/aspect-ratio-inheritance-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssaspectratioinheritancehtml">trunk/LayoutTests/fast/css/aspect-ratio-inheritance.html</a></li>
<li><a href="#trunkLayoutTestsfastcssaspectratioparsingtestsexpectedtxt">trunk/LayoutTests/fast/css/aspect-ratio-parsing-tests-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssaspectratioparsingtestshtml">trunk/LayoutTests/fast/css/aspect-ratio-parsing-tests.html</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="#trunkSourceWebCorecssCSSValueKeywordsin">trunk/Source/WebCore/css/CSSValueKeywords.in</a></li>
<li><a href="#trunkSourceWebCorecssDeprecatedStyleBuildercpp">trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleh">trunk/Source/WebCore/rendering/style/RenderStyle.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleConstantsh">trunk/Source/WebCore/rendering/style/RenderStyleConstants.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStyleRareNonInheritedDatacpp">trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStyleRareNonInheritedDatah">trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (163839 => 163840)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-02-11 01:10:18 UTC (rev 163839)
+++ trunk/LayoutTests/ChangeLog        2014-02-11 01:20:28 UTC (rev 163840)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2014-02-09  Dean Jackson  &lt;dino@apple.com&gt;
+
+        Update aspect-ratio property to have constraining keywords
+        https://bugs.webkit.org/show_bug.cgi?id=128262
+
+        Reviewed by Simon Fraser.
+
+        Add tests for new from-intrinsic and from-dimensions
+        property values.
+
+        * fast/css/aspect-ratio-inheritance-expected.txt:
+        * fast/css/aspect-ratio-inheritance.html:
+        * fast/css/aspect-ratio-parsing-tests-expected.txt:
+        * fast/css/aspect-ratio-parsing-tests.html:
+
</ins><span class="cx"> 2014-02-10  Mark Lam  &lt;mark.lam@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r163660-r163664): js/dom/stack-trace.html fails.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssaspectratioinheritanceexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/aspect-ratio-inheritance-expected.txt (163839 => 163840)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/aspect-ratio-inheritance-expected.txt        2014-02-11 01:10:18 UTC (rev 163839)
+++ trunk/LayoutTests/fast/css/aspect-ratio-inheritance-expected.txt        2014-02-11 01:20:28 UTC (rev 163840)
</span><span class="lines">@@ -1,6 +1,10 @@
</span><del>-PASS testComputedValue(&quot;aspectRatioTest&quot;, &quot;1 / 4&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;1/4&quot;
-PASS testComputedValue(&quot;aspectRatioTest&quot;, &quot;inherit&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;1/2&quot;
-PASS testComputedValue(&quot;aspectRatioTest&quot;, &quot;none&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;none&quot;
</del><ins>+PASS testComputedValue(&quot;aspectRatioTest1&quot;, &quot;1 / 4&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;1/4&quot;
+PASS testComputedValue(&quot;aspectRatioTest1&quot;, &quot;inherit&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;1/2&quot;
+PASS testComputedValue(&quot;aspectRatioTest1&quot;, &quot;auto&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;auto&quot;
+PASS testComputedValue(&quot;aspectRatioTest2&quot;, &quot;1 / 4&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;1/4&quot;
+PASS testComputedValue(&quot;aspectRatioTest2&quot;, &quot;inherit&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;from-dimensions&quot;
+PASS testComputedValue(&quot;aspectRatioTest3&quot;, &quot;1 / 4&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;1/4&quot;
+PASS testComputedValue(&quot;aspectRatioTest3&quot;, &quot;inherit&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;from-intrinsic&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssaspectratioinheritancehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/aspect-ratio-inheritance.html (163839 => 163840)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/aspect-ratio-inheritance.html        2014-02-11 01:10:18 UTC (rev 163839)
+++ trunk/LayoutTests/fast/css/aspect-ratio-inheritance.html        2014-02-11 01:20:28 UTC (rev 163840)
</span><span class="lines">@@ -1,8 +1,14 @@
</span><span class="cx"> &lt;!DOCTYPE html&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;div style=&quot;-webkit-aspect-ratio: 1 / 2;&quot;&gt;
</span><del>-  &lt;div id=&quot;aspectRatioTest&quot;&gt;&lt;/div&gt;
</del><ins>+  &lt;div id=&quot;aspectRatioTest1&quot;&gt;&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><ins>+&lt;div style=&quot;-webkit-aspect-ratio: from-dimensions;&quot;&gt;
+  &lt;div id=&quot;aspectRatioTest2&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;-webkit-aspect-ratio: from-intrinsic;&quot;&gt;
+  &lt;div id=&quot;aspectRatioTest3&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins><span class="cx"> &lt;script&gt;
</span><span class="cx">     function testComputedValue(elementId, value, styleAttribute)
</span><span class="cx">     {
</span><span class="lines">@@ -11,8 +17,12 @@
</span><span class="cx">         var computedValue = window.getComputedStyle(div)[styleAttribute];
</span><span class="cx">         return computedValue;
</span><span class="cx">     }
</span><del>-    shouldBeEqualToString('testComputedValue(&quot;aspectRatioTest&quot;, &quot;1 / 4&quot;, &quot;-webkit-aspect-ratio&quot;)', '1/4');
-    shouldBeEqualToString('testComputedValue(&quot;aspectRatioTest&quot;, &quot;inherit&quot;, &quot;-webkit-aspect-ratio&quot;)', '1/2');
-    shouldBeEqualToString('testComputedValue(&quot;aspectRatioTest&quot;, &quot;none&quot;, &quot;-webkit-aspect-ratio&quot;)', 'none');
</del><ins>+    shouldBeEqualToString('testComputedValue(&quot;aspectRatioTest1&quot;, &quot;1 / 4&quot;, &quot;-webkit-aspect-ratio&quot;)', '1/4');
+    shouldBeEqualToString('testComputedValue(&quot;aspectRatioTest1&quot;, &quot;inherit&quot;, &quot;-webkit-aspect-ratio&quot;)', '1/2');
+    shouldBeEqualToString('testComputedValue(&quot;aspectRatioTest1&quot;, &quot;auto&quot;, &quot;-webkit-aspect-ratio&quot;)', 'auto');
+    shouldBeEqualToString('testComputedValue(&quot;aspectRatioTest2&quot;, &quot;1 / 4&quot;, &quot;-webkit-aspect-ratio&quot;)', '1/4');
+    shouldBeEqualToString('testComputedValue(&quot;aspectRatioTest2&quot;, &quot;inherit&quot;, &quot;-webkit-aspect-ratio&quot;)', 'from-dimensions');
+    shouldBeEqualToString('testComputedValue(&quot;aspectRatioTest3&quot;, &quot;1 / 4&quot;, &quot;-webkit-aspect-ratio&quot;)', '1/4');
+    shouldBeEqualToString('testComputedValue(&quot;aspectRatioTest3&quot;, &quot;inherit&quot;, &quot;-webkit-aspect-ratio&quot;)', 'from-intrinsic');
</ins><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssaspectratioparsingtestsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/aspect-ratio-parsing-tests-expected.txt (163839 => 163840)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/aspect-ratio-parsing-tests-expected.txt        2014-02-11 01:10:18 UTC (rev 163839)
+++ trunk/LayoutTests/fast/css/aspect-ratio-parsing-tests-expected.txt        2014-02-11 01:20:28 UTC (rev 163840)
</span><span class="lines">@@ -10,18 +10,21 @@
</span><span class="cx"> PASS testParsing(&quot;aspectRatioTest&quot;, &quot;1.2 / 2&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;1.2/2&quot;
</span><span class="cx"> PASS testParsing(&quot;aspectRatioTest&quot;, &quot;2 / 0.5&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;2/0.5&quot;
</span><span class="cx"> PASS testParsing(&quot;aspectRatioTest&quot;, &quot;inherit&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;inherit&quot;
</span><del>-PASS testParsing(&quot;aspectRatioTest&quot;, &quot;none&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;none&quot;
-PASS testParsing(&quot;aspectRatioTest&quot;, &quot;1 2&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;none&quot;
-PASS testParsing(&quot;aspectRatioTest&quot;, &quot;a/1&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;none&quot;
-PASS testParsing(&quot;aspectRatioTest&quot;, &quot;1/a&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;none&quot;
-PASS testParsing(&quot;aspectRatioTest&quot;, &quot;abc123&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;none&quot;
-PASS testParsing(&quot;aspectRatioTest&quot;, &quot;1&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;none&quot;
-PASS testParsing(&quot;aspectRatioTest&quot;, &quot;1 / 0&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;none&quot;
-PASS testParsing(&quot;aspectRatioTest&quot;, &quot;0 / 1&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;none&quot;
-PASS testParsing(&quot;aspectRatioTest&quot;, &quot;0 / 0&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;none&quot;
-PASS testParsing(&quot;aspectRatioTest&quot;, &quot;-1 / 8&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;none&quot;
-PASS testParsing(&quot;aspectRatioTest&quot;, &quot;1 / -9&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;none&quot;
-PASS testParsing(&quot;aspectRatioTest&quot;, &quot;-1 / -4&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;none&quot;
</del><ins>+PASS testParsing(&quot;aspectRatioTest&quot;, &quot;from-dimensions&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;from-dimensions&quot;
+PASS testParsing(&quot;aspectRatioTest&quot;, &quot;from-intrinsic&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;from-intrinsic&quot;
+PASS testParsing(&quot;aspectRatioTest&quot;, &quot;auto&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;auto&quot;
+PASS testParsing(&quot;aspectRatioTest&quot;, &quot;none&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;auto&quot;
+PASS testParsing(&quot;aspectRatioTest&quot;, &quot;1 2&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;auto&quot;
+PASS testParsing(&quot;aspectRatioTest&quot;, &quot;a/1&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;auto&quot;
+PASS testParsing(&quot;aspectRatioTest&quot;, &quot;1/a&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;auto&quot;
+PASS testParsing(&quot;aspectRatioTest&quot;, &quot;abc123&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;auto&quot;
+PASS testParsing(&quot;aspectRatioTest&quot;, &quot;1&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;auto&quot;
+PASS testParsing(&quot;aspectRatioTest&quot;, &quot;1 / 0&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;auto&quot;
+PASS testParsing(&quot;aspectRatioTest&quot;, &quot;0 / 1&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;auto&quot;
+PASS testParsing(&quot;aspectRatioTest&quot;, &quot;0 / 0&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;auto&quot;
+PASS testParsing(&quot;aspectRatioTest&quot;, &quot;-1 / 8&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;auto&quot;
+PASS testParsing(&quot;aspectRatioTest&quot;, &quot;1 / -9&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;auto&quot;
+PASS testParsing(&quot;aspectRatioTest&quot;, &quot;-1 / -4&quot;, &quot;-webkit-aspect-ratio&quot;) is &quot;auto&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssaspectratioparsingtestshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/aspect-ratio-parsing-tests.html (163839 => 163840)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/aspect-ratio-parsing-tests.html        2014-02-11 01:10:18 UTC (rev 163839)
+++ trunk/LayoutTests/fast/css/aspect-ratio-parsing-tests.html        2014-02-11 01:20:28 UTC (rev 163840)
</span><span class="lines">@@ -23,20 +23,23 @@
</span><span class="cx">       shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;1.2 / 2&quot;, &quot;-webkit-aspect-ratio&quot;)', '1.2/2');
</span><span class="cx">       shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;2 / 0.5&quot;, &quot;-webkit-aspect-ratio&quot;)', '2/0.5');
</span><span class="cx">       shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;inherit&quot;, &quot;-webkit-aspect-ratio&quot;)', 'inherit');
</span><del>-      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;none&quot;, &quot;-webkit-aspect-ratio&quot;)', 'none');
</del><ins>+      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;from-dimensions&quot;, &quot;-webkit-aspect-ratio&quot;)', 'from-dimensions');
+      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;from-intrinsic&quot;, &quot;-webkit-aspect-ratio&quot;)', 'from-intrinsic');
+      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;auto&quot;, &quot;-webkit-aspect-ratio&quot;)', 'auto');
</ins><span class="cx"> 
</span><span class="cx">       // The following are invalid and should get ignored.
</span><del>-      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;1 2&quot;, &quot;-webkit-aspect-ratio&quot;)', 'none');
-      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;a/1&quot;, &quot;-webkit-aspect-ratio&quot;)', 'none');
-      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;1/a&quot;, &quot;-webkit-aspect-ratio&quot;)', 'none');
-      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;abc123&quot;, &quot;-webkit-aspect-ratio&quot;)', 'none');
-      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;1&quot;, &quot;-webkit-aspect-ratio&quot;)', 'none');
-      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;1 / 0&quot;, &quot;-webkit-aspect-ratio&quot;)', 'none');
-      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;0 / 1&quot;, &quot;-webkit-aspect-ratio&quot;)', 'none');
-      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;0 / 0&quot;, &quot;-webkit-aspect-ratio&quot;)', 'none');
-      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;-1 / 8&quot;, &quot;-webkit-aspect-ratio&quot;)', 'none');
-      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;1 / -9&quot;, &quot;-webkit-aspect-ratio&quot;)', 'none');
-      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;-1 / -4&quot;, &quot;-webkit-aspect-ratio&quot;)', 'none');
</del><ins>+      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;none&quot;, &quot;-webkit-aspect-ratio&quot;)', 'auto');
+      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;1 2&quot;, &quot;-webkit-aspect-ratio&quot;)', 'auto');
+      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;a/1&quot;, &quot;-webkit-aspect-ratio&quot;)', 'auto');
+      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;1/a&quot;, &quot;-webkit-aspect-ratio&quot;)', 'auto');
+      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;abc123&quot;, &quot;-webkit-aspect-ratio&quot;)', 'auto');
+      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;1&quot;, &quot;-webkit-aspect-ratio&quot;)', 'auto');
+      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;1 / 0&quot;, &quot;-webkit-aspect-ratio&quot;)', 'auto');
+      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;0 / 1&quot;, &quot;-webkit-aspect-ratio&quot;)', 'auto');
+      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;0 / 0&quot;, &quot;-webkit-aspect-ratio&quot;)', 'auto');
+      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;-1 / 8&quot;, &quot;-webkit-aspect-ratio&quot;)', 'auto');
+      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;1 / -9&quot;, &quot;-webkit-aspect-ratio&quot;)', 'auto');
+      shouldBeEqualToString('testParsing(&quot;aspectRatioTest&quot;, &quot;-1 / -4&quot;, &quot;-webkit-aspect-ratio&quot;)', 'auto');
</ins><span class="cx">     &lt;/script&gt;
</span><span class="cx">     &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span><span class="cx">   &lt;/body&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (163839 => 163840)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-11 01:10:18 UTC (rev 163839)
+++ trunk/Source/WebCore/ChangeLog        2014-02-11 01:20:28 UTC (rev 163840)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2014-02-09  Dean Jackson  &lt;dino@apple.com&gt;
+
+        Update aspect-ratio property to have constraining keywords
+        https://bugs.webkit.org/show_bug.cgi?id=128262
+
+        Reviewed by Simon Fraser.
+
+        Add support for &quot;from-dimensions&quot; and &quot;from-intrinsic&quot;
+        property values to &quot;-webkit-aspect-ratio&quot;. I also changed
+        the default value from &quot;none&quot; to &quot;auto&quot;, because &quot;none&quot; doesn't
+        make sense any more.
+
+        Covered by enhancing existing tests.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::propertyValue): New keywords.
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseAspectRatio): Support new keywords.
+        * css/CSSValueKeywords.in: Add from-dimensions and from-intrinsic.
+        * css/DeprecatedStyleBuilder.cpp: This now has to handle the new
+        values. I also changed &quot;none&quot; to &quot;auto&quot;.
+        (WebCore::ApplyPropertyAspectRatio::applyInheritValue):
+        (WebCore::ApplyPropertyAspectRatio::applyInitialValue):
+        (WebCore::ApplyPropertyAspectRatio::applyValue):
+        * rendering/style/RenderStyle.h: hasAspectRatio is now aspectRatioType
+        and indicates one of the three keywords, or a specified number.
+        * rendering/style/RenderStyleConstants.h: New enum.
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        (WebCore::StyleRareNonInheritedData::operator==):
+        * rendering/style/StyleRareNonInheritedData.h:
+
</ins><span class="cx"> 2014-02-10  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WK2] Add support for image document viewport configuration
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (163839 => 163840)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-02-11 01:10:18 UTC (rev 163839)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-02-11 01:20:28 UTC (rev 163840)
</span><span class="lines">@@ -2583,8 +2583,12 @@
</span><span class="cx">         case CSSPropertyWebkitAppearance:
</span><span class="cx">             return cssValuePool().createValue(style-&gt;appearance());
</span><span class="cx">         case CSSPropertyWebkitAspectRatio:
</span><del>-            if (!style-&gt;hasAspectRatio())
-                return cssValuePool().createIdentifierValue(CSSValueNone);
</del><ins>+            if (style-&gt;aspectRatioType() == AspectRatioAuto)
+                return cssValuePool().createIdentifierValue(CSSValueAuto);
+            if (style-&gt;aspectRatioType() == AspectRatioFromDimensions)
+                return cssValuePool().createIdentifierValue(CSSValueFromDimensions);
+            if (style-&gt;aspectRatioType() == AspectRatioFromIntrinsic)
+                return cssValuePool().createIdentifierValue(CSSValueFromIntrinsic);
</ins><span class="cx">             return CSSAspectRatioValue::create(style-&gt;aspectRatioNumerator(), style-&gt;aspectRatioDenominator());
</span><span class="cx">         case CSSPropertyWebkitBackfaceVisibility:
</span><span class="cx">             return cssValuePool().createIdentifierValue((style-&gt;backfaceVisibility() == BackfaceVisibilityHidden) ? CSSValueHidden : CSSValueVisible);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (163839 => 163840)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2014-02-11 01:10:18 UTC (rev 163839)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2014-02-11 01:20:28 UTC (rev 163840)
</span><span class="lines">@@ -7707,9 +7707,12 @@
</span><span class="cx"> bool CSSParser::parseAspectRatio(bool important)
</span><span class="cx"> {
</span><span class="cx">     unsigned num = m_valueList-&gt;size();
</span><del>-    if (num == 1 &amp;&amp; m_valueList-&gt;valueAt(0)-&gt;id == CSSValueNone) {
-        addProperty(CSSPropertyWebkitAspectRatio, cssValuePool().createIdentifierValue(CSSValueNone), important);
-        return true;
</del><ins>+    if (num == 1) {
+        CSSValueID valueId = m_valueList-&gt;valueAt(0)-&gt;id;
+        if (valueId == CSSValueAuto || valueId == CSSValueFromDimensions || valueId == CSSValueFromIntrinsic) {
+            addProperty(CSSPropertyWebkitAspectRatio, cssValuePool().createIdentifierValue(valueId), important);
+            return true;
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (num != 3)
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueKeywordsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (163839 => 163840)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValueKeywords.in        2014-02-11 01:10:18 UTC (rev 163839)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in        2014-02-11 01:20:28 UTC (rev 163840)
</span><span class="lines">@@ -1050,3 +1050,7 @@
</span><span class="cx"> 
</span><span class="cx"> // -webkit-column-fill
</span><span class="cx"> balance
</span><ins>+
+// -webkit-aspect-ratio
+from-dimensions
+from-intrinsic
</ins></span></pre></div>
<a id="trunkSourceWebCorecssDeprecatedStyleBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (163839 => 163840)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-02-11 01:10:18 UTC (rev 163839)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-02-11 01:20:28 UTC (rev 163840)
</span><span class="lines">@@ -1982,28 +1982,40 @@
</span><span class="cx"> public:
</span><span class="cx">     static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
</span><span class="cx">     {
</span><del>-        if (!styleResolver-&gt;parentStyle()-&gt;hasAspectRatio())
</del><ins>+        if (styleResolver-&gt;parentStyle()-&gt;aspectRatioType() == AspectRatioAuto)
</ins><span class="cx">             return;
</span><del>-        styleResolver-&gt;style()-&gt;setHasAspectRatio(true);
</del><ins>+        styleResolver-&gt;style()-&gt;setAspectRatioType(styleResolver-&gt;parentStyle()-&gt;aspectRatioType());
</ins><span class="cx">         styleResolver-&gt;style()-&gt;setAspectRatioDenominator(styleResolver-&gt;parentStyle()-&gt;aspectRatioDenominator());
</span><span class="cx">         styleResolver-&gt;style()-&gt;setAspectRatioNumerator(styleResolver-&gt;parentStyle()-&gt;aspectRatioNumerator());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver)
</span><span class="cx">     {
</span><del>-        styleResolver-&gt;style()-&gt;setHasAspectRatio(RenderStyle::initialHasAspectRatio());
</del><ins>+        styleResolver-&gt;style()-&gt;setAspectRatioType(RenderStyle::initialAspectRatioType());
</ins><span class="cx">         styleResolver-&gt;style()-&gt;setAspectRatioDenominator(RenderStyle::initialAspectRatioDenominator());
</span><span class="cx">         styleResolver-&gt;style()-&gt;setAspectRatioNumerator(RenderStyle::initialAspectRatioNumerator());
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="cx">     {
</span><ins>+        if (value-&gt;isPrimitiveValue()) {
+            CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+
+            if (primitiveValue-&gt;getValueID() == CSSValueAuto)
+                return styleResolver-&gt;style()-&gt;setAspectRatioType(AspectRatioAuto);
+            if (primitiveValue-&gt;getValueID() == CSSValueFromDimensions)
+                return styleResolver-&gt;style()-&gt;setAspectRatioType(AspectRatioFromDimensions);
+            if (primitiveValue-&gt;getValueID() == CSSValueFromIntrinsic)
+                return styleResolver-&gt;style()-&gt;setAspectRatioType(AspectRatioFromIntrinsic);
+        }
+
</ins><span class="cx">         if (!value-&gt;isAspectRatioValue()) {
</span><del>-            styleResolver-&gt;style()-&gt;setHasAspectRatio(false);
</del><ins>+            styleResolver-&gt;style()-&gt;setAspectRatioType(AspectRatioAuto);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><ins>+
</ins><span class="cx">         CSSAspectRatioValue* aspectRatioValue = toCSSAspectRatioValue(value);
</span><del>-        styleResolver-&gt;style()-&gt;setHasAspectRatio(true);
</del><ins>+        styleResolver-&gt;style()-&gt;setAspectRatioType(AspectRatioSpecified);
</ins><span class="cx">         styleResolver-&gt;style()-&gt;setAspectRatioDenominator(aspectRatioValue-&gt;denominatorValue());
</span><span class="cx">         styleResolver-&gt;style()-&gt;setAspectRatioNumerator(aspectRatioValue-&gt;numeratorValue());
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (163839 => 163840)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2014-02-11 01:10:18 UTC (rev 163839)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2014-02-11 01:20:28 UTC (rev 163840)
</span><span class="lines">@@ -743,8 +743,7 @@
</span><span class="cx">     ColorSpace colorSpace() const { return static_cast&lt;ColorSpace&gt;(rareInheritedData-&gt;colorSpace); }
</span><span class="cx">     float opacity() const { return rareNonInheritedData-&gt;opacity; }
</span><span class="cx">     ControlPart appearance() const { return static_cast&lt;ControlPart&gt;(rareNonInheritedData-&gt;m_appearance); }
</span><del>-    // aspect ratio convenience method
-    bool hasAspectRatio() const { return rareNonInheritedData-&gt;m_hasAspectRatio; }
</del><ins>+    AspectRatioType aspectRatioType() const { return static_cast&lt;AspectRatioType&gt;(rareNonInheritedData-&gt;m_aspectRatioType); }
</ins><span class="cx">     float aspectRatio() const { return aspectRatioNumerator() / aspectRatioDenominator(); }
</span><span class="cx">     float aspectRatioDenominator() const { return rareNonInheritedData-&gt;m_aspectRatioDenominator; }
</span><span class="cx">     float aspectRatioNumerator() const { return rareNonInheritedData-&gt;m_aspectRatioNumerator; }
</span><span class="lines">@@ -1214,7 +1213,7 @@
</span><span class="cx">     void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
</span><span class="cx">     void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; }
</span><span class="cx"> 
</span><del>-    void setHasAspectRatio(bool b) { SET_VAR(rareNonInheritedData, m_hasAspectRatio, b); }
</del><ins>+    void setAspectRatioType(AspectRatioType aspectRatioType) { SET_VAR(rareNonInheritedData, m_aspectRatioType, aspectRatioType); }
</ins><span class="cx">     void setAspectRatioDenominator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioDenominator, v); }
</span><span class="cx">     void setAspectRatioNumerator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioNumerator, v); }
</span><span class="cx"> 
</span><span class="lines">@@ -1723,7 +1722,7 @@
</span><span class="cx">     static EBorderFit initialBorderFit() { return BorderFitBorder; }
</span><span class="cx">     static EResize initialResize() { return RESIZE_NONE; }
</span><span class="cx">     static ControlPart initialAppearance() { return NoControlPart; }
</span><del>-    static bool initialHasAspectRatio() { return false; }
</del><ins>+    static AspectRatioType initialAspectRatioType() { return AspectRatioAuto; }
</ins><span class="cx">     static float initialAspectRatioDenominator() { return 1; }
</span><span class="cx">     static float initialAspectRatioNumerator() { return 1; }
</span><span class="cx">     static Order initialRTLOrdering() { return LogicalOrder; }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleConstantsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (163839 => 163840)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h        2014-02-11 01:10:18 UTC (rev 163839)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h        2014-02-11 01:20:28 UTC (rev 163840)
</span><span class="lines">@@ -214,6 +214,10 @@
</span><span class="cx">     ObjectFitFill, ObjectFitContain, ObjectFitCover, ObjectFitNone, ObjectFitScaleDown
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+enum AspectRatioType {
+    AspectRatioAuto, AspectRatioFromIntrinsic, AspectRatioFromDimensions, AspectRatioSpecified
+};
+
</ins><span class="cx"> // Word Break Values. Matches WinIE, rather than CSS3
</span><span class="cx"> 
</span><span class="cx"> enum EWordBreak {
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleRareNonInheritedDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (163839 => 163840)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp        2014-02-11 01:10:18 UTC (rev 163839)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp        2014-02-11 01:20:28 UTC (rev 163840)
</span><span class="lines">@@ -89,7 +89,7 @@
</span><span class="cx">     , m_wrapFlow(RenderStyle::initialWrapFlow())
</span><span class="cx">     , m_wrapThrough(RenderStyle::initialWrapThrough())
</span><span class="cx">     , m_runningAcceleratedAnimation(false)
</span><del>-    , m_hasAspectRatio(false)
</del><ins>+    , m_aspectRatioType(RenderStyle::initialAspectRatioType())
</ins><span class="cx"> #if ENABLE(CSS_COMPOSITING)
</span><span class="cx">     , m_effectiveBlendMode(RenderStyle::initialBlendMode())
</span><span class="cx"> #endif
</span><span class="lines">@@ -169,7 +169,7 @@
</span><span class="cx">     , m_wrapFlow(o.m_wrapFlow)
</span><span class="cx">     , m_wrapThrough(o.m_wrapThrough)
</span><span class="cx">     , m_runningAcceleratedAnimation(o.m_runningAcceleratedAnimation)
</span><del>-    , m_hasAspectRatio(o.m_hasAspectRatio)
</del><ins>+    , m_aspectRatioType(o.m_aspectRatioType)
</ins><span class="cx"> #if ENABLE(CSS_COMPOSITING)
</span><span class="cx">     , m_effectiveBlendMode(o.m_effectiveBlendMode)
</span><span class="cx"> #endif
</span><span class="lines">@@ -263,7 +263,7 @@
</span><span class="cx"> #if ENABLE(CSS_COMPOSITING)
</span><span class="cx">         &amp;&amp; m_effectiveBlendMode == o.m_effectiveBlendMode
</span><span class="cx"> #endif
</span><del>-        &amp;&amp; m_hasAspectRatio == o.m_hasAspectRatio
</del><ins>+        &amp;&amp; m_aspectRatioType == o.m_aspectRatioType
</ins><span class="cx">         &amp;&amp; m_objectFit == o.m_objectFit;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleRareNonInheritedDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (163839 => 163840)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h        2014-02-11 01:10:18 UTC (rev 163839)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h        2014-02-11 01:20:28 UTC (rev 163840)
</span><span class="lines">@@ -190,7 +190,7 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned m_runningAcceleratedAnimation : 1;
</span><span class="cx"> 
</span><del>-    unsigned m_hasAspectRatio : 1; // Whether or not an aspect ratio has been specified.
</del><ins>+    unsigned m_aspectRatioType : 2;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_COMPOSITING)
</span><span class="cx">     unsigned m_effectiveBlendMode: 5; // EBlendMode
</span></span></pre>
</div>
</div>

</body>
</html>