<!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>[182270] 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/182270">182270</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-04-02 01:51:23 -0700 (Thu, 02 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[CSS MultiColumn] Parse &quot;columns: auto &lt;length&gt;&quot; shorthand property value properly
https://bugs.webkit.org/show_bug.cgi?id=143248

Patch by Joonghun Park &lt;jh718.park@samsung.com&gt; on 2015-04-02
Reviewed by Darin Adler.

Source/WebCore:

Test: fast/multicol/columns-shorthand-parsing-2.html

The two longhands for the 'columns' property ('column-count' and
'column-width') may both take 'auto' as a value. When we encounter
'auto' during parsing the value list of a declaration, we cannot just
make a guess at which property/properties that's meant for. Instead,
don't assign anything to 'auto' right away, but wait until all values
have been processed and at that point set the still unassigned
properties to 'auto'. If 'auto' isn't in the value list at all, set
unassigned properties to 'initial' for the 'columns' property, just
like we do for any other property.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseColumnWidth):
(WebCore::CSSParser::parseColumnCount):
(WebCore::CSSParser::parseColumnsShorthand):
* css/CSSParser.h:

LayoutTests:

* fast/css/getPropertyValue-columns-expected.txt:
* fast/css/getPropertyValue-columns.html:
* fast/multicol/columns-shorthand-parsing-2-expected.txt: Added.
* fast/multicol/columns-shorthand-parsing-2.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcssgetPropertyValuecolumnsexpectedtxt">trunk/LayoutTests/fast/css/getPropertyValue-columns-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgetPropertyValuecolumnshtml">trunk/LayoutTests/fast/css/getPropertyValue-columns.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastmulticolcolumnsshorthandparsing2expectedtxt">trunk/LayoutTests/fast/multicol/columns-shorthand-parsing-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastmulticolcolumnsshorthandparsing2html">trunk/LayoutTests/fast/multicol/columns-shorthand-parsing-2.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (182269 => 182270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-04-02 06:29:20 UTC (rev 182269)
+++ trunk/LayoutTests/ChangeLog        2015-04-02 08:51:23 UTC (rev 182270)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-04-02  Joonghun Park  &lt;jh718.park@samsung.com&gt;
+
+        [CSS MultiColumn] Parse &quot;columns: auto &lt;length&gt;&quot; shorthand property value properly
+        https://bugs.webkit.org/show_bug.cgi?id=143248
+
+        Reviewed by Darin Adler.
+
+        * fast/css/getPropertyValue-columns-expected.txt:
+        * fast/css/getPropertyValue-columns.html:
+        * fast/multicol/columns-shorthand-parsing-2-expected.txt: Added.
+        * fast/multicol/columns-shorthand-parsing-2.html: Added.
+
</ins><span class="cx"> 2015-04-01  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r182247.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgetPropertyValuecolumnsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/getPropertyValue-columns-expected.txt (182269 => 182270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/getPropertyValue-columns-expected.txt        2015-04-02 06:29:20 UTC (rev 182269)
+++ trunk/LayoutTests/fast/css/getPropertyValue-columns-expected.txt        2015-04-02 08:51:23 UTC (rev 182270)
</span><span class="lines">@@ -1,19 +1,19 @@
</span><del>-Bug 111011: getPropertyValue for -webkit-columns returns null, should compute the shorthand value
</del><ins>+Bug 111011: getPropertyValue for columns returns null, should compute the shorthand value
</ins><span class="cx"> 
</span><span class="cx"> On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-PASS webkitColumnsValue(&quot;columns1&quot;) is &quot;10px&quot;
-PASS webkitColumnsValue(&quot;columns2&quot;) is &quot;10&quot;
-PASS webkitColumnsValue(&quot;columns3&quot;) is &quot;10px auto&quot;
-PASS webkitColumnsValue(&quot;columns4&quot;) is &quot;auto&quot;
-PASS webkitColumnsValue(&quot;columns5&quot;) is &quot;auto 2&quot;
-PASS webkitColumnsValue(&quot;columns6&quot;) is &quot;10px 2&quot;
-PASS webkitColumnsValue(&quot;columns7&quot;) is &quot;auto auto&quot;
-NOTE: 'foo' is an illegal CSS value for '-webkit-columns'.
-PASS webkitColumnsValue(&quot;columns8&quot;) is null
</del><ins>+PASS columnsValue(&quot;columns1&quot;) is &quot;10px&quot;
+PASS columnsValue(&quot;columns2&quot;) is &quot;10&quot;
+PASS columnsValue(&quot;columns3&quot;) is &quot;10px auto&quot;
+PASS columnsValue(&quot;columns4&quot;) is &quot;auto&quot;
+PASS columnsValue(&quot;columns5&quot;) is &quot;auto 2&quot;
+PASS columnsValue(&quot;columns6&quot;) is &quot;10px 2&quot;
+PASS columnsValue(&quot;columns7&quot;) is &quot;auto auto&quot;
+NOTE: 'foo' is an illegal CSS value for 'columns'.
+PASS columnsValue(&quot;columns8&quot;) is null
</ins><span class="cx"> NOTE: If only few longhand properties are specified, getPropertyValue for shorthand property returns null.
</span><del>-PASS webkitColumnsValue(&quot;columns9&quot;) is null
</del><ins>+PASS columnsValue(&quot;columns9&quot;) is null
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgetPropertyValuecolumnshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/getPropertyValue-columns.html (182269 => 182270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/getPropertyValue-columns.html        2015-04-02 06:29:20 UTC (rev 182269)
+++ trunk/LayoutTests/fast/css/getPropertyValue-columns.html        2015-04-02 08:51:23 UTC (rev 182270)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> &lt;!DOCTYPE HTML&gt;
</span><span class="cx"> &lt;/html&gt;
</span><span class="cx">   &lt;head&gt;
</span><del>-    &lt;title&gt;-webkit-columns shorthand getPropertyValue test&lt;/title&gt;
</del><ins>+    &lt;title&gt;columns shorthand getPropertyValue test&lt;/title&gt;
</ins><span class="cx">     &lt;style&gt;
</span><span class="cx">       .test {
</span><span class="cx">         width: 100px;
</span><span class="lines">@@ -15,34 +15,34 @@
</span><span class="cx">     &lt;/script&gt;
</span><span class="cx">   &lt;/head&gt;
</span><span class="cx">   &lt;body&gt;
</span><del>-    &lt;div id=&quot;columns1&quot; class=&quot;test&quot; style=&quot;-webkit-columns: 10px;&quot;&gt;&lt;/div&gt;
-    &lt;div id=&quot;columns2&quot; class=&quot;test&quot; style=&quot;-webkit-columns: 10;&quot;&gt;&lt;/div&gt;
-    &lt;div id=&quot;columns3&quot; class=&quot;test&quot; style=&quot;-webkit-columns: 10px auto;&quot;&gt;&lt;/div&gt;
-    &lt;div id=&quot;columns4&quot; class=&quot;test&quot; style=&quot;-webkit-columns: auto;&quot;&gt;&lt;/div&gt;
-    &lt;div id=&quot;columns5&quot; class=&quot;test&quot; style=&quot;-webkit-columns: auto 2;&quot;&gt;&lt;/div&gt;
-    &lt;div id=&quot;columns6&quot; class=&quot;test&quot; style=&quot;-webkit-column-width: 10px; -webkit-column-count: 2;&quot;&gt;&lt;/div&gt;
-    &lt;div id=&quot;columns7&quot; class=&quot;test&quot; style=&quot;-webkit-column-width: auto; -webkit-column-count: auto;&quot;&gt;&lt;/div&gt;
-    &lt;div id=&quot;columns8&quot; class=&quot;test&quot; style=&quot;-webkit-columns: foo;&quot;&gt;&lt;/div&gt;
-    &lt;div id=&quot;columns9&quot; class=&quot;test&quot; style=&quot;-webkit-column-width: 10px;&quot;&gt;&lt;/div&gt;
</del><ins>+    &lt;div id=&quot;columns1&quot; class=&quot;test&quot; style=&quot;columns: 10px;&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;columns2&quot; class=&quot;test&quot; style=&quot;columns: 10;&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;columns3&quot; class=&quot;test&quot; style=&quot;columns: 10px auto;&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;columns4&quot; class=&quot;test&quot; style=&quot;columns: auto;&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;columns5&quot; class=&quot;test&quot; style=&quot;columns: auto 2;&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;columns6&quot; class=&quot;test&quot; style=&quot;column-width: 10px; column-count: 2;&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;columns7&quot; class=&quot;test&quot; style=&quot;column-width: auto; column-count: auto;&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;columns8&quot; class=&quot;test&quot; style=&quot;columns: foo;&quot;&gt;&lt;/div&gt;
+    &lt;div id=&quot;columns9&quot; class=&quot;test&quot; style=&quot;column-width: 10px;&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;script&gt;
</span><del>-      description(&quot;&lt;a href=\&quot;https://bugs.webkit.org/show_bug.cgi?id=111011\&quot;&gt;Bug 111011: getPropertyValue for -webkit-columns returns null, should compute the shorthand value&lt;/a&gt;&quot;);
</del><ins>+      description(&quot;&lt;a href=\&quot;https://bugs.webkit.org/show_bug.cgi?id=111011\&quot;&gt;Bug 111011: getPropertyValue for columns returns null, should compute the shorthand value&lt;/a&gt;&quot;);
</ins><span class="cx"> 
</span><del>-      function webkitColumnsValue(id) {
</del><ins>+      function columnsValue(id) {
</ins><span class="cx">         var element = document.getElementById(id);
</span><del>-        return element.style.getPropertyValue(&quot;-webkit-columns&quot;);
</del><ins>+        return element.style.getPropertyValue(&quot;columns&quot;);
</ins><span class="cx">       }
</span><span class="cx"> 
</span><del>-      shouldBeEqualToString('webkitColumnsValue(&quot;columns1&quot;)', '10px');
-      shouldBeEqualToString('webkitColumnsValue(&quot;columns2&quot;)', '10');
-      shouldBeEqualToString('webkitColumnsValue(&quot;columns3&quot;)', '10px auto');
-      shouldBeEqualToString('webkitColumnsValue(&quot;columns4&quot;)', 'auto');
-      shouldBeEqualToString('webkitColumnsValue(&quot;columns5&quot;)', 'auto 2');
-      shouldBeEqualToString('webkitColumnsValue(&quot;columns6&quot;)', '10px 2');
-      shouldBeEqualToString('webkitColumnsValue(&quot;columns7&quot;)', 'auto auto');
-      debug(&quot;NOTE: 'foo' is an illegal CSS value for '-webkit-columns'.&quot;);
-      shouldBe('webkitColumnsValue(&quot;columns8&quot;)', &quot;null&quot;);
</del><ins>+      shouldBeEqualToString('columnsValue(&quot;columns1&quot;)', '10px');
+      shouldBeEqualToString('columnsValue(&quot;columns2&quot;)', '10');
+      shouldBeEqualToString('columnsValue(&quot;columns3&quot;)', '10px auto');
+      shouldBeEqualToString('columnsValue(&quot;columns4&quot;)', 'auto');
+      shouldBeEqualToString('columnsValue(&quot;columns5&quot;)', 'auto 2');
+      shouldBeEqualToString('columnsValue(&quot;columns6&quot;)', '10px 2');
+      shouldBeEqualToString('columnsValue(&quot;columns7&quot;)', 'auto auto');
+      debug(&quot;NOTE: 'foo' is an illegal CSS value for 'columns'.&quot;);
+      shouldBe('columnsValue(&quot;columns8&quot;)', &quot;null&quot;);
</ins><span class="cx">       debug(&quot;NOTE: If only few longhand properties are specified, getPropertyValue for shorthand property returns null.&quot;)
</span><del>-      shouldBe('webkitColumnsValue(&quot;columns9&quot;)', &quot;null&quot;);
</del><ins>+      shouldBe('columnsValue(&quot;columns9&quot;)', &quot;null&quot;);
</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="trunkLayoutTestsfastmulticolcolumnsshorthandparsing2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/columns-shorthand-parsing-2-expected.txt (0 => 182270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/columns-shorthand-parsing-2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/multicol/columns-shorthand-parsing-2-expected.txt        2015-04-02 08:51:23 UTC (rev 182270)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+Test the behavior when 'auto' is part of the 'columns' property value. See http://www.w3.org/TR/css3-multicol/#columns
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS element.style.columnWidth is &quot;auto&quot;
+PASS element.style.columnCount is &quot;3&quot;
+PASS element.style.columns is &quot;auto 3&quot;
+PASS element.style.columnWidth is &quot;10em&quot;
+PASS element.style.columnCount is &quot;auto&quot;
+PASS element.style.columns is &quot;10em auto&quot;
+PASS element.style.columnWidth is &quot;auto&quot;
+PASS element.style.columnCount is &quot;3&quot;
+PASS element.style.columns is &quot;auto 3&quot;
+PASS element.style.columnWidth is &quot;10em&quot;
+PASS element.style.columnCount is &quot;auto&quot;
+PASS element.style.columns is &quot;10em auto&quot;
+PASS element.style.columnWidth is &quot;7em&quot;
+PASS element.style.columnCount is &quot;7&quot;
+PASS element.style.columns is &quot;7em 7&quot;
+PASS element.style.columnWidth is &quot;7em&quot;
+PASS element.style.columnCount is &quot;7&quot;
+PASS element.style.columns is &quot;7em 7&quot;
+PASS element.style.columnWidth is &quot;auto&quot;
+PASS element.style.columnCount is &quot;auto&quot;
+PASS element.style.columns is &quot;auto&quot;
+PASS element.style.columnWidth is &quot;auto&quot;
+PASS element.style.columnCount is &quot;auto&quot;
+PASS element.style.columns is &quot;auto auto&quot;
+PASS element.style.columnWidth is &quot;initial&quot;
+PASS element.style.columnCount is &quot;initial&quot;
+PASS element.style.columns is &quot;initial&quot;
+PASS element.style.columnWidth is &quot;auto&quot;
+PASS element.style.columnCount is &quot;auto&quot;
+PASS element.style.columns is &quot;auto&quot;
+PASS element.style.columnWidth is &quot;inherit&quot;
+PASS element.style.columnCount is &quot;inherit&quot;
+PASS element.style.columns is &quot;inherit&quot;
+PASS element.style.columnWidth is &quot;auto&quot;
+PASS element.style.columnCount is &quot;auto&quot;
+PASS element.style.columns is &quot;auto&quot;
+PASS element.style.columnWidth is &quot;auto&quot;
+PASS element.style.columnCount is &quot;7&quot;
+PASS element.style.columns is &quot;7&quot;
+PASS element.style.columnWidth is &quot;7em&quot;
+PASS element.style.columnCount is &quot;auto&quot;
+PASS element.style.columns is &quot;7em&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastmulticolcolumnsshorthandparsing2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/multicol/columns-shorthand-parsing-2.html (0 => 182270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/multicol/columns-shorthand-parsing-2.html                                (rev 0)
+++ trunk/LayoutTests/fast/multicol/columns-shorthand-parsing-2.html        2015-04-02 08:51:23 UTC (rev 182270)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;title&gt;'columns' property with 'auto' and something else&lt;/title&gt;
+    &lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+    &lt;script&gt;
+      description(&quot;Test the behavior when 'auto' is part of the 'columns' property value. See http://www.w3.org/TR/css3-multicol/#columns&quot;);
+      if (window.testRunner)
+        testRunner.dumpAsText();
+
+      function runTests() {
+          var tests = [[&quot;columns:auto 3;&quot;, &quot;auto&quot;, &quot;3&quot;, &quot;auto 3&quot;],
+                       [&quot;columns:auto 10em;&quot;, &quot;10em&quot;, &quot;auto&quot;, &quot;10em auto&quot;],
+                       [&quot;columns:3 auto;&quot;, &quot;auto&quot;, &quot;3&quot;, &quot;auto 3&quot;],
+                       [&quot;columns:10em auto;&quot;, &quot;10em&quot;, &quot;auto&quot;, &quot;10em auto&quot;],
+                       [&quot;columns:7 7em; columns:auto auto auto;&quot;, &quot;7em&quot;, &quot;7&quot;, &quot;7em 7&quot;],
+                       [&quot;columns:7 7em; columns:10em auto auto;&quot;, &quot;7em&quot;, &quot;7&quot;, &quot;7em 7&quot;],
+                       [&quot;columns:7 7em; columns:auto;&quot;, &quot;auto&quot;, &quot;auto&quot;, &quot;auto&quot;],
+                       [&quot;columns:7 7em; columns:auto auto;&quot;,  &quot;auto&quot;, &quot;auto&quot;, &quot;auto auto&quot;],
+                       [&quot;columns:auto; columns:initial;&quot;, &quot;initial&quot;, &quot;initial&quot;, &quot;initial&quot;],
+                       [&quot;columns:auto; columns:initial initial;&quot;, &quot;auto&quot;, &quot;auto&quot;, &quot;auto&quot;],
+                       [&quot;columns:auto; columns:inherit;&quot;, &quot;inherit&quot;, &quot;inherit&quot;, &quot;inherit&quot;],
+                       [&quot;columns:auto; columns:inherit inherit;&quot;, &quot;auto&quot;, &quot;auto&quot;, &quot;auto&quot;],
+                       [&quot;columns:7;&quot;, &quot;auto&quot;, &quot;7&quot;, &quot;7&quot;],
+                       [&quot;columns:7em;&quot;, &quot;7em&quot;, &quot;auto&quot;, &quot;7em&quot;]];
+
+          tests.forEach(function(test) {
+              element.style.cssText = test[0];
+              shouldBeEqualToString(&quot;element.style.columnWidth&quot;, test[1]);
+              shouldBeEqualToString(&quot;element.style.columnCount&quot;, test[2]);
+              shouldBeEqualToString(&quot;element.style.columns&quot;, test[3]);
+          });
+      }
+    &lt;/script&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+      &lt;div id=&quot;element&quot;&gt;&lt;/div&gt;
+      &lt;script&gt;
+          runTests();
+      &lt;/script&gt;
+  &lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (182269 => 182270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-02 06:29:20 UTC (rev 182269)
+++ trunk/Source/WebCore/ChangeLog        2015-04-02 08:51:23 UTC (rev 182270)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2015-04-02  Joonghun Park  &lt;jh718.park@samsung.com&gt;
+
+        [CSS MultiColumn] Parse &quot;columns: auto &lt;length&gt;&quot; shorthand property value properly
+        https://bugs.webkit.org/show_bug.cgi?id=143248
+
+        Reviewed by Darin Adler.
+
+        Test: fast/multicol/columns-shorthand-parsing-2.html
+
+        The two longhands for the 'columns' property ('column-count' and
+        'column-width') may both take 'auto' as a value. When we encounter
+        'auto' during parsing the value list of a declaration, we cannot just
+        make a guess at which property/properties that's meant for. Instead,
+        don't assign anything to 'auto' right away, but wait until all values
+        have been processed and at that point set the still unassigned
+        properties to 'auto'. If 'auto' isn't in the value list at all, set
+        unassigned properties to 'initial' for the 'columns' property, just
+        like we do for any other property.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        (WebCore::CSSParser::parseColumnWidth):
+        (WebCore::CSSParser::parseColumnCount):
+        (WebCore::CSSParser::parseColumnsShorthand):
+        * css/CSSParser.h:
+
</ins><span class="cx"> 2015-04-01  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r182247.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (182269 => 182270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2015-04-02 06:29:20 UTC (rev 182269)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2015-04-02 08:51:23 UTC (rev 182270)
</span><span class="lines">@@ -2763,10 +2763,7 @@
</span><span class="cx">             validPrimitive = !id &amp;&amp; validateUnit(valueWithCalculation, FNumber | FLength | FPercent);
</span><span class="cx">         break;
</span><span class="cx">     case CSSPropertyColumnCount:
</span><del>-        if (id == CSSValueAuto)
-            validPrimitive = true;
-        else
-            validPrimitive = !id &amp;&amp; validateUnit(valueWithCalculation, FPositiveInteger, CSSQuirksMode);
</del><ins>+        parsedValue = parseColumnCount();
</ins><span class="cx">         break;
</span><span class="cx">     case CSSPropertyColumnGap: // normal | &lt;length&gt;
</span><span class="cx">         if (id == CSSValueNormal)
</span><span class="lines">@@ -2791,12 +2788,7 @@
</span><span class="cx">         }
</span><span class="cx">         break;
</span><span class="cx">     case CSSPropertyColumnWidth: // auto | &lt;length&gt;
</span><del>-        if (id == CSSValueAuto)
-            validPrimitive = true;
-        else {
-            // Always parse this property in strict mode, since it would be ambiguous otherwise when used in the 'columns' shorthand property.
-            validPrimitive = validateUnit(valueWithCalculation, FLength | FNonNeg, CSSStrictMode) &amp;&amp; parsedDouble(valueWithCalculation);
-        }
</del><ins>+        parsedValue = parseColumnWidth();
</ins><span class="cx">         break;
</span><span class="cx">     // End of CSS3 properties
</span><span class="cx"> 
</span><span class="lines">@@ -2957,7 +2949,7 @@
</span><span class="cx">     case CSSPropertyListStyle:
</span><span class="cx">         return parseShorthand(propId, listStyleShorthand(), important);
</span><span class="cx">     case CSSPropertyColumns:
</span><del>-        return parseShorthand(propId, columnsShorthand(), important);
</del><ins>+        return parseColumnsShorthand(important);
</ins><span class="cx">     case CSSPropertyColumnRule:
</span><span class="cx">         return parseShorthand(propId, columnRuleShorthand(), important);
</span><span class="cx">     case CSSPropertyWebkitTextStroke:
</span><span class="lines">@@ -3611,6 +3603,76 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RefPtr&lt;CSSValue&gt; CSSParser::parseColumnWidth()
+{
+    ValueWithCalculation valueWithCalculation(*m_valueList-&gt;current());
+    CSSValueID id = valueWithCalculation.value().id;
+    // Always parse this property in strict mode, since it would be ambiguous otherwise when used in the 'columns' shorthand property.
+    if (id != CSSValueAuto &amp;&amp; !(validateUnit(valueWithCalculation, FLength | FNonNeg, CSSStrictMode) &amp;&amp; parsedDouble(valueWithCalculation)))
+        return nullptr;
+
+    RefPtr&lt;CSSValue&gt; parsedValue = parseValidPrimitive(id, valueWithCalculation);
+    m_valueList-&gt;next();
+    return parsedValue;
+}
+
+RefPtr&lt;CSSValue&gt; CSSParser::parseColumnCount()
+{
+    ValueWithCalculation valueWithCalculation(*m_valueList-&gt;current());
+    CSSValueID id = valueWithCalculation.value().id;
+
+    if (id != CSSValueAuto &amp;&amp; !validateUnit(valueWithCalculation, FPositiveInteger, CSSQuirksMode))
+        return nullptr;
+
+    RefPtr&lt;CSSValue&gt; parsedValue = parseValidPrimitive(id, valueWithCalculation);
+    m_valueList-&gt;next();
+    return parsedValue;
+}
+
+bool CSSParser::parseColumnsShorthand(bool important)
+{
+    RefPtr&lt;CSSValue&gt; columnWidth;
+    RefPtr&lt;CSSValue&gt; columnCount;
+    bool hasPendingExplicitAuto = false;
+
+    for (unsigned propertiesParsed = 0; CSSParserValue* value = m_valueList-&gt;current(); propertiesParsed++) {
+        if (propertiesParsed &gt;= 2)
+            return false; // Too many values for this shorthand. Invalid declaration.
+        if (!propertiesParsed &amp;&amp; value-&gt;id == CSSValueAuto) {
+            // 'auto' is a valid value for any of the two longhands, and at this point
+            // we don't know which one(s) it is meant for. We need to see if there are other values first.
+            m_valueList-&gt;next();
+            hasPendingExplicitAuto = true;
+        } else {
+            if (!columnWidth) {
+                if ((columnWidth = parseColumnWidth()))
+                    continue;
+            }
+            if (!columnCount) {
+                if ((columnCount = parseColumnCount()))
+                    continue;
+            }
+            // If we didn't find at least one match, this is an invalid shorthand and we have to ignore it.
+            return false;
+        }
+    }
+
+    // Any unassigned property at this point will become implicit 'auto'.
+    if (columnWidth)
+        addProperty(CSSPropertyColumnWidth, columnWidth, important);
+    else {
+        addProperty(CSSPropertyColumnWidth, cssValuePool().createIdentifierValue(CSSValueAuto), important, !hasPendingExplicitAuto /* implicit */);
+        hasPendingExplicitAuto = false;
+    }
+
+    if (columnCount)
+        addProperty(CSSPropertyColumnCount, columnCount, important);
+    else
+        addProperty(CSSPropertyColumnCount, cssValuePool().createIdentifierValue(CSSValueAuto), important, !hasPendingExplicitAuto /* implicit */);
+
+    return true;
+}
+
</ins><span class="cx"> bool CSSParser::parseTransitionShorthand(CSSPropertyID propId, bool important)
</span><span class="cx"> {
</span><span class="cx">     const unsigned numProperties = 4;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.h (182269 => 182270)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.h        2015-04-02 06:29:20 UTC (rev 182269)
+++ trunk/Source/WebCore/css/CSSParser.h        2015-04-02 08:51:23 UTC (rev 182270)
</span><span class="lines">@@ -192,6 +192,10 @@
</span><span class="cx">     bool parseTransitionShorthand(CSSPropertyID, bool important);
</span><span class="cx">     bool parseAnimationShorthand(CSSPropertyID, bool important);
</span><span class="cx"> 
</span><ins>+    RefPtr&lt;CSSValue&gt; parseColumnWidth();
+    RefPtr&lt;CSSValue&gt; parseColumnCount();
+    bool parseColumnsShorthand(bool important);
+
</ins><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx">     PassRefPtr&lt;CSSValue&gt; parseGridPosition();
</span><span class="cx">     bool parseGridItemPositionShorthand(CSSPropertyID, bool important);
</span></span></pre>
</div>
</div>

</body>
</html>