<!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>[177872] trunk/Source/WebCore</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/177872">177872</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-01-03 22:35:04 -0800 (Sat, 03 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move the CSS Grid properties to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=140051

Reviewed by Sam Weinig.

Move the CSS Grid properties from StyleResolver to the new
StyleBuilder.

This patch adds support for &quot;ConditionalConverter&quot; parameter in
CSSPropertyNames.in to support cases where we only want to call the
property setter conditionally. The converter function is then expected
to return a boolean to indicate if the setter should be called by the
StyleBuilder or not.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSPropertyNamesin">trunk/Source/WebCore/css/CSSPropertyNames.in</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderConverterh">trunk/Source/WebCore/css/StyleBuilderConverter.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderCustomh">trunk/Source/WebCore/css/StyleBuilderCustom.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorecssmakeproppl">trunk/Source/WebCore/css/makeprop.pl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (177871 => 177872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-04 03:47:25 UTC (rev 177871)
+++ trunk/Source/WebCore/ChangeLog        2015-01-04 06:35:04 UTC (rev 177872)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-01-03  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Move the CSS Grid properties to the new StyleBuilder
+        https://bugs.webkit.org/show_bug.cgi?id=140051
+
+        Reviewed by Sam Weinig.
+
+        Move the CSS Grid properties from StyleResolver to the new
+        StyleBuilder.
+
+        This patch adds support for &quot;ConditionalConverter&quot; parameter in
+        CSSPropertyNames.in to support cases where we only want to call the
+        property setter conditionally. The converter function is then expected
+        to return a boolean to indicate if the setter should be called by the
+        StyleBuilder or not.
+
</ins><span class="cx"> 2015-01-02  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Kill the DeprecatedStyleBuilder
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (177871 => 177872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPropertyNames.in        2015-01-04 03:47:25 UTC (rev 177871)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in        2015-01-04 06:35:04 UTC (rev 177872)
</span><span class="lines">@@ -44,6 +44,10 @@
</span><span class="cx"> // can indicate that a Converter helper function in
</span><span class="cx"> // css/StyleBuilderConverter.h should be used.
</span><span class="cx"> //
</span><ins>+// * ConditionalConverter=XXX:
+// Similar to Converter=XXX but the converter function returns a boolean
+// to indicate if the property setter should be called or not.
+//
</ins><span class="cx"> // * Custom=[Initial|Value|Inherit|All]:
</span><span class="cx"> // Custom=Initial option is used to indicate that the CSS property requires
</span><span class="cx"> // special handling to set its initial value.
</span><span class="lines">@@ -425,19 +429,19 @@
</span><span class="cx"> #if defined(ENABLE_CSS_GRID_LAYOUT) &amp;&amp; ENABLE_CSS_GRID_LAYOUT
</span><span class="cx"> -webkit-grid [LegacyStyleBuilder]
</span><span class="cx"> -webkit-grid-area [LegacyStyleBuilder]
</span><del>--webkit-grid-auto-columns [LegacyStyleBuilder]
--webkit-grid-auto-rows [LegacyStyleBuilder]
--webkit-grid-column-end [LegacyStyleBuilder]
--webkit-grid-column-start [LegacyStyleBuilder]
</del><ins>+-webkit-grid-auto-columns [ConditionalConverter=GridTrackSize, TypeName=GridTrackSize]
+-webkit-grid-auto-rows [ConditionalConverter=GridTrackSize, TypeName=GridTrackSize]
+-webkit-grid-column-end [ConditionalConverter=GridPosition, TypeName=GridPosition, NameForMethods=GridItemColumnEnd]
+-webkit-grid-column-start [ConditionalConverter=GridPosition, TypeName=GridPosition, NameForMethods=GridItemColumnStart]
</ins><span class="cx"> -webkit-grid-template [LegacyStyleBuilder]
</span><del>--webkit-grid-template-columns [LegacyStyleBuilder]
--webkit-grid-template-rows [LegacyStyleBuilder]
--webkit-grid-row-end [LegacyStyleBuilder]
--webkit-grid-row-start [LegacyStyleBuilder]
</del><ins>+-webkit-grid-template-columns [Custom=All]
+-webkit-grid-template-rows [Custom=All]
+-webkit-grid-row-end [ConditionalConverter=GridPosition, TypeName=GridPosition, NameForMethods=GridItemRowEnd]
+-webkit-grid-row-start [ConditionalConverter=GridPosition, TypeName=GridPosition, NameForMethods=GridItemRowStart]
</ins><span class="cx"> -webkit-grid-column [LegacyStyleBuilder]
</span><span class="cx"> -webkit-grid-row [LegacyStyleBuilder]
</span><del>--webkit-grid-template-areas [LegacyStyleBuilder]
--webkit-grid-auto-flow [LegacyStyleBuilder]
</del><ins>+-webkit-grid-template-areas [Custom=All]
+-webkit-grid-auto-flow [Converter=GridAutoFlow]
</ins><span class="cx"> #endif
</span><span class="cx"> -webkit-hyphenate-character [Inherited, NameForMethods=HyphenationString, Converter=StringOrAuto]
</span><span class="cx"> -webkit-hyphenate-limit-after [Inherited, NameForMethods=HyphenationLimitAfter, Converter=Number&lt;short&gt;]
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderConverterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderConverter.h (177871 => 177872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderConverter.h        2015-01-04 03:47:25 UTC (rev 177871)
+++ trunk/Source/WebCore/css/StyleBuilderConverter.h        2015-01-04 06:35:04 UTC (rev 177872)
</span><span class="lines">@@ -29,6 +29,9 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;BasicShapeFunctions.h&quot;
</span><span class="cx"> #include &quot;CSSCalculationValue.h&quot;
</span><ins>+#include &quot;CSSFunctionValue.h&quot;
+#include &quot;CSSGridLineNamesValue.h&quot;
+#include &quot;CSSGridTemplateAreasValue.h&quot;
</ins><span class="cx"> #include &quot;CSSImageGeneratorValue.h&quot;
</span><span class="cx"> #include &quot;CSSImageSetValue.h&quot;
</span><span class="cx"> #include &quot;CSSImageValue.h&quot;
</span><span class="lines">@@ -78,11 +81,25 @@
</span><span class="cx">     static LineBoxContain convertLineBoxContain(StyleResolver&amp;, CSSValue&amp;);
</span><span class="cx">     static TextDecorationSkip convertTextDecorationSkip(StyleResolver&amp;, CSSValue&amp;);
</span><span class="cx">     static PassRefPtr&lt;ShapeValue&gt; convertShapeValue(StyleResolver&amp;, CSSValue&amp;);
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+    static bool convertGridTrackSize(StyleResolver&amp;, CSSValue&amp;, GridTrackSize&amp;);
+    static bool convertGridPosition(StyleResolver&amp;, CSSValue&amp;, GridPosition&amp;);
+    static GridAutoFlow convertGridAutoFlow(StyleResolver&amp;, CSSValue&amp;);
+#endif // ENABLE(CSS_GRID_LAYOUT)
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    friend class StyleBuilderCustom;
+
</ins><span class="cx">     static Length convertToRadiusLength(CSSToLengthConversionData&amp;, CSSPrimitiveValue&amp;);
</span><span class="cx">     static TextEmphasisPosition valueToEmphasisPosition(CSSPrimitiveValue&amp;);
</span><span class="cx">     static TextDecorationSkip valueToDecorationSkip(const CSSPrimitiveValue&amp;);
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+    static bool createGridTrackBreadth(CSSPrimitiveValue&amp;, StyleResolver&amp;, GridLength&amp;);
+    static bool createGridTrackSize(CSSValue&amp;, GridTrackSize&amp;, StyleResolver&amp;);
+    static bool createGridTrackList(CSSValue&amp;, Vector&lt;GridTrackSize&gt;&amp; trackSizes, NamedGridLinesMap&amp;, OrderedNamedGridLinesMap&amp;, StyleResolver&amp;);
+    static bool createGridPosition(CSSValue&amp;, GridPosition&amp;);
+    static void createImplicitNamedGridLinesFromGridArea(const NamedGridAreaMap&amp;, NamedGridLinesMap&amp;, GridTrackSizingDirection);
+#endif // ENABLE(CSS_GRID_LAYOUT)
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline Length StyleBuilderConverter::convertLength(StyleResolver&amp; styleResolver, CSSValue&amp; value)
</span><span class="lines">@@ -638,6 +655,203 @@
</span><span class="cx"> }
</span><span class="cx"> #endif // ENABLE(CSS_SHAPES)
</span><span class="cx"> 
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+bool StyleBuilderConverter::createGridTrackBreadth(CSSPrimitiveValue&amp; primitiveValue, StyleResolver&amp; styleResolver, GridLength&amp; workingLength)
+{
+    if (primitiveValue.getValueID() == CSSValueWebkitMinContent) {
+        workingLength = Length(MinContent);
+        return true;
+    }
+
+    if (primitiveValue.getValueID() == CSSValueWebkitMaxContent) {
+        workingLength = Length(MaxContent);
+        return true;
+    }
+
+    if (primitiveValue.isFlex()) {
+        // Fractional unit.
+        workingLength.setFlex(primitiveValue.getDoubleValue());
+        return true;
+    }
+
+    workingLength = primitiveValue.convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion | AutoConversion&gt;(styleResolver.state().cssToLengthConversionData());
+    if (workingLength.length().isUndefined())
+        return false;
+
+    if (primitiveValue.isLength())
+        workingLength.length().setHasQuirk(primitiveValue.isQuirkValue());
+
+    return true;
+}
+
+bool StyleBuilderConverter::createGridTrackSize(CSSValue&amp; value, GridTrackSize&amp; trackSize, StyleResolver&amp; styleResolver)
+{
+    if (is&lt;CSSPrimitiveValue&gt;(value)) {
+        GridLength workingLength;
+        if (!createGridTrackBreadth(downcast&lt;CSSPrimitiveValue&gt;(value), styleResolver, workingLength))
+            return false;
+
+        trackSize.setLength(workingLength);
+        return true;
+    }
+
+    CSSValueList&amp; arguments = *downcast&lt;CSSFunctionValue&gt;(value).arguments();
+    ASSERT_WITH_SECURITY_IMPLICATION(arguments.length() == 2);
+
+    GridLength minTrackBreadth;
+    GridLength maxTrackBreadth;
+    if (!createGridTrackBreadth(downcast&lt;CSSPrimitiveValue&gt;(*arguments.itemWithoutBoundsCheck(0)), styleResolver, minTrackBreadth) || !createGridTrackBreadth(downcast&lt;CSSPrimitiveValue&gt;(*arguments.itemWithoutBoundsCheck(1)), styleResolver, maxTrackBreadth))
+        return false;
+
+    trackSize.setMinMax(minTrackBreadth, maxTrackBreadth);
+    return true;
+}
+
+bool StyleBuilderConverter::createGridTrackList(CSSValue&amp; value, Vector&lt;GridTrackSize&gt;&amp; trackSizes, NamedGridLinesMap&amp; namedGridLines, OrderedNamedGridLinesMap&amp; orderedNamedGridLines, StyleResolver&amp; styleResolver)
+{
+    // Handle 'none'.
+    if (is&lt;CSSPrimitiveValue&gt;(value))
+        return downcast&lt;CSSPrimitiveValue&gt;(value).getValueID() == CSSValueNone;
+
+    if (!is&lt;CSSValueList&gt;(value))
+        return false;
+
+    unsigned currentNamedGridLine = 0;
+    for (auto&amp; currentValue : downcast&lt;CSSValueList&gt;(value)) {
+        if (is&lt;CSSGridLineNamesValue&gt;(currentValue.get())) {
+            for (auto&amp; currentGridLineName : downcast&lt;CSSGridLineNamesValue&gt;(currentValue.get())) {
+                String namedGridLine = downcast&lt;CSSPrimitiveValue&gt;(currentGridLineName.get()).getStringValue();
+                NamedGridLinesMap::AddResult result = namedGridLines.add(namedGridLine, Vector&lt;unsigned&gt;());
+                result.iterator-&gt;value.append(currentNamedGridLine);
+                OrderedNamedGridLinesMap::AddResult orderedResult = orderedNamedGridLines.add(currentNamedGridLine, Vector&lt;String&gt;());
+                orderedResult.iterator-&gt;value.append(namedGridLine);
+            }
+            continue;
+        }
+
+        ++currentNamedGridLine;
+        GridTrackSize trackSize;
+        if (!createGridTrackSize(currentValue, trackSize, styleResolver))
+            return false;
+
+        trackSizes.append(trackSize);
+    }
+
+    // The parser should have rejected any &lt;track-list&gt; without any &lt;track-size&gt; as
+    // this is not conformant to the syntax.
+    ASSERT(!trackSizes.isEmpty());
+    return true;
+}
+
+bool StyleBuilderConverter::createGridPosition(CSSValue&amp; value, GridPosition&amp; position)
+{
+    // We accept the specification's grammar:
+    // auto | &lt;custom-ident&gt; | [ &lt;integer&gt; &amp;&amp; &lt;custom-ident&gt;? ] | [ span &amp;&amp; [ &lt;integer&gt; || &lt;custom-ident&gt; ] ]
+    if (is&lt;CSSPrimitiveValue&gt;(value)) {
+        auto&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(value);
+        // We translate &lt;ident&gt; to &lt;string&gt; during parsing as it makes handling it simpler.
+        if (primitiveValue.isString()) {
+            position.setNamedGridArea(primitiveValue.getStringValue());
+            return true;
+        }
+
+        ASSERT(primitiveValue.getValueID() == CSSValueAuto);
+        return true;
+    }
+
+    auto&amp; values = downcast&lt;CSSValueList&gt;(value);
+    ASSERT(values.length());
+
+    auto it = values.begin();
+    CSSPrimitiveValue* currentValue = &amp;downcast&lt;CSSPrimitiveValue&gt;(it-&gt;get());
+    bool isSpanPosition = false;
+    if (currentValue-&gt;getValueID() == CSSValueSpan) {
+        isSpanPosition = true;
+        ++it;
+        currentValue = it != values.end() ? &amp;downcast&lt;CSSPrimitiveValue&gt;(it-&gt;get()) : nullptr;
+    }
+
+    int gridLineNumber = 0;
+    if (currentValue &amp;&amp; currentValue-&gt;isNumber()) {
+        gridLineNumber = currentValue-&gt;getIntValue();
+        ++it;
+        currentValue = it != values.end() ? &amp;downcast&lt;CSSPrimitiveValue&gt;(it-&gt;get()) : nullptr;
+    }
+
+    String gridLineName;
+    if (currentValue &amp;&amp; currentValue-&gt;isString()) {
+        gridLineName = currentValue-&gt;getStringValue();
+        ++it;
+    }
+
+    ASSERT(it == values.end());
+    if (isSpanPosition)
+        position.setSpanPosition(gridLineNumber ? gridLineNumber : 1, gridLineName);
+    else
+        position.setExplicitPosition(gridLineNumber, gridLineName);
+
+    return true;
+}
+
+void StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(const NamedGridAreaMap&amp; namedGridAreas, NamedGridLinesMap&amp; namedGridLines, GridTrackSizingDirection direction)
+{
+    for (auto&amp; area : namedGridAreas) {
+        GridSpan areaSpan = direction == ForRows ? area.value.rows : area.value.columns;
+        {
+            auto&amp; startVector = namedGridLines.add(area.key + &quot;-start&quot;, Vector&lt;unsigned&gt;()).iterator-&gt;value;
+            startVector.append(areaSpan.resolvedInitialPosition.toInt());
+            std::sort(startVector.begin(), startVector.end());
+        }
+        {
+            auto&amp; endVector = namedGridLines.add(area.key + &quot;-end&quot;, Vector&lt;unsigned&gt;()).iterator-&gt;value;
+            endVector.append(areaSpan.resolvedFinalPosition.next().toInt());
+            std::sort(endVector.begin(), endVector.end());
+        }
+    }
+}
+
+inline bool StyleBuilderConverter::convertGridTrackSize(StyleResolver&amp; styleResolver, CSSValue&amp; value, GridTrackSize&amp; trackSize)
+{
+    return createGridTrackSize(value, trackSize, styleResolver);
+}
+
+inline bool StyleBuilderConverter::convertGridPosition(StyleResolver&amp;, CSSValue&amp; value, GridPosition&amp; gridPosition)
+{
+    return createGridPosition(value, gridPosition);
+}
+
+inline GridAutoFlow StyleBuilderConverter::convertGridAutoFlow(StyleResolver&amp;, CSSValue&amp; value)
+{
+    auto&amp; list = downcast&lt;CSSValueList&gt;(value);
+    if (!list.length())
+        return RenderStyle::initialGridAutoFlow();
+
+    CSSPrimitiveValue&amp; first = downcast&lt;CSSPrimitiveValue&gt;(*list.item(0));
+    CSSPrimitiveValue* second = downcast&lt;CSSPrimitiveValue&gt;(list.item(1));
+
+    GridAutoFlow autoFlow = RenderStyle::initialGridAutoFlow();
+    switch (first.getValueID()) {
+    case CSSValueRow:
+        if (second &amp;&amp; second-&gt;getValueID() == CSSValueDense)
+            autoFlow =  AutoFlowRowDense;
+        else
+            autoFlow = AutoFlowRow;
+        break;
+    case CSSValueColumn:
+        if (second &amp;&amp; second-&gt;getValueID() == CSSValueDense)
+            autoFlow = AutoFlowColumnDense;
+        else
+            autoFlow = AutoFlowColumn;
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+        break;
+    }
+
+    return autoFlow;
+}
+#endif // ENABLE(CSS_GRID_LAYOUT)
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // StyleBuilderConverter_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (177871 => 177872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderCustom.h        2015-01-04 03:47:25 UTC (rev 177871)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h        2015-01-04 06:35:04 UTC (rev 177872)
</span><span class="lines">@@ -78,6 +78,11 @@
</span><span class="cx">     DECLARE_PROPERTY_CUSTOM_HANDLERS(WebkitAspectRatio);
</span><span class="cx">     DECLARE_PROPERTY_CUSTOM_HANDLERS(WebkitBoxShadow);
</span><span class="cx">     DECLARE_PROPERTY_CUSTOM_HANDLERS(WebkitFontVariantLigatures);
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+    DECLARE_PROPERTY_CUSTOM_HANDLERS(WebkitGridTemplateAreas);
+    DECLARE_PROPERTY_CUSTOM_HANDLERS(WebkitGridTemplateColumns);
+    DECLARE_PROPERTY_CUSTOM_HANDLERS(WebkitGridTemplateRows);
+#endif // ENABLE(CSS_GRID_LAYOUT)
</ins><span class="cx">     DECLARE_PROPERTY_CUSTOM_HANDLERS(WebkitMaskBoxImageOutset);
</span><span class="cx">     DECLARE_PROPERTY_CUSTOM_HANDLERS(WebkitMaskBoxImageRepeat);
</span><span class="cx">     DECLARE_PROPERTY_CUSTOM_HANDLERS(WebkitMaskBoxImageSlice);
</span><span class="lines">@@ -1402,6 +1407,104 @@
</span><span class="cx">     styleResolver.setFontDescription(fontDescription);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+inline void StyleBuilderCustom::applyInitialWebkitGridTemplateAreas(StyleResolver&amp; styleResolver)
+{
+    styleResolver.style()-&gt;setNamedGridArea(RenderStyle::initialNamedGridArea());
+    styleResolver.style()-&gt;setNamedGridAreaRowCount(RenderStyle::initialNamedGridAreaCount());
+    styleResolver.style()-&gt;setNamedGridAreaColumnCount(RenderStyle::initialNamedGridAreaCount());
+}
+
+inline void StyleBuilderCustom::applyInheritWebkitGridTemplateAreas(StyleResolver&amp; styleResolver)
+{
+    styleResolver.style()-&gt;setNamedGridArea(styleResolver.parentStyle()-&gt;namedGridArea());
+    styleResolver.style()-&gt;setNamedGridAreaRowCount(styleResolver.parentStyle()-&gt;namedGridAreaRowCount());
+    styleResolver.style()-&gt;setNamedGridAreaColumnCount(styleResolver.parentStyle()-&gt;namedGridAreaColumnCount());
+}
+
+inline void StyleBuilderCustom::applyValueWebkitGridTemplateAreas(StyleResolver&amp; styleResolver, CSSValue&amp; value)
+{
+    if (is&lt;CSSPrimitiveValue&gt;(value)) {
+        ASSERT(downcast&lt;CSSPrimitiveValue&gt;(value).getValueID() == CSSValueNone);
+        return;
+    }
+
+    auto&amp; gridTemplateAreasValue = downcast&lt;CSSGridTemplateAreasValue&gt;(value);
+    const NamedGridAreaMap&amp; newNamedGridAreas = gridTemplateAreasValue.gridAreaMap();
+
+    NamedGridLinesMap namedGridColumnLines = styleResolver.style()-&gt;namedGridColumnLines();
+    NamedGridLinesMap namedGridRowLines = styleResolver.style()-&gt;namedGridRowLines();
+    StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(newNamedGridAreas, namedGridColumnLines, ForColumns);
+    StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(newNamedGridAreas, namedGridRowLines, ForRows);
+    styleResolver.style()-&gt;setNamedGridColumnLines(namedGridColumnLines);
+    styleResolver.style()-&gt;setNamedGridRowLines(namedGridRowLines);
+
+    styleResolver.style()-&gt;setNamedGridArea(gridTemplateAreasValue.gridAreaMap());
+    styleResolver.style()-&gt;setNamedGridAreaRowCount(gridTemplateAreasValue.rowCount());
+    styleResolver.style()-&gt;setNamedGridAreaColumnCount(gridTemplateAreasValue.columnCount());
+}
+
+inline void StyleBuilderCustom::applyInitialWebkitGridTemplateColumns(StyleResolver&amp; styleResolver)
+{
+    styleResolver.style()-&gt;setGridColumns(RenderStyle::initialGridColumns());
+    styleResolver.style()-&gt;setNamedGridColumnLines(RenderStyle::initialNamedGridColumnLines());
+    styleResolver.style()-&gt;setOrderedNamedGridColumnLines(RenderStyle::initialOrderedNamedGridColumnLines());
+}
+
+inline void StyleBuilderCustom::applyInheritWebkitGridTemplateColumns(StyleResolver&amp; styleResolver)
+{
+    styleResolver.style()-&gt;setGridColumns(styleResolver.parentStyle()-&gt;gridColumns());
+    styleResolver.style()-&gt;setNamedGridColumnLines(styleResolver.parentStyle()-&gt;namedGridColumnLines());
+    styleResolver.style()-&gt;setOrderedNamedGridColumnLines(styleResolver.parentStyle()-&gt;orderedNamedGridColumnLines());
+}
+
+inline void StyleBuilderCustom::applyValueWebkitGridTemplateColumns(StyleResolver&amp; styleResolver, CSSValue&amp; value)
+{
+    Vector&lt;GridTrackSize&gt; trackSizes;
+    NamedGridLinesMap namedGridLines;
+    OrderedNamedGridLinesMap orderedNamedGridLines;
+    if (!StyleBuilderConverter::createGridTrackList(value, trackSizes, namedGridLines, orderedNamedGridLines, styleResolver))
+        return;
+    const NamedGridAreaMap&amp; namedGridAreas = styleResolver.style()-&gt;namedGridArea();
+    if (!namedGridAreas.isEmpty())
+        StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(namedGridAreas, namedGridLines, ForColumns);
+
+    styleResolver.style()-&gt;setGridColumns(trackSizes);
+    styleResolver.style()-&gt;setNamedGridColumnLines(namedGridLines);
+    styleResolver.style()-&gt;setOrderedNamedGridColumnLines(orderedNamedGridLines);
+}
+
+inline void StyleBuilderCustom::applyInitialWebkitGridTemplateRows(StyleResolver&amp; styleResolver)
+{
+    styleResolver.style()-&gt;setGridRows(RenderStyle::initialGridRows());
+    styleResolver.style()-&gt;setNamedGridRowLines(RenderStyle::initialNamedGridRowLines());
+    styleResolver.style()-&gt;setOrderedNamedGridRowLines(RenderStyle::initialOrderedNamedGridRowLines());
+}
+
+inline void StyleBuilderCustom::applyInheritWebkitGridTemplateRows(StyleResolver&amp; styleResolver)
+{
+    styleResolver.style()-&gt;setGridRows(styleResolver.parentStyle()-&gt;gridRows());
+    styleResolver.style()-&gt;setNamedGridRowLines(styleResolver.parentStyle()-&gt;namedGridRowLines());
+    styleResolver.style()-&gt;setOrderedNamedGridRowLines(styleResolver.parentStyle()-&gt;orderedNamedGridRowLines());
+}
+
+inline void StyleBuilderCustom::applyValueWebkitGridTemplateRows(StyleResolver&amp; styleResolver, CSSValue&amp; value)
+{
+    Vector&lt;GridTrackSize&gt; trackSizes;
+    NamedGridLinesMap namedGridLines;
+    OrderedNamedGridLinesMap orderedNamedGridLines;
+    if (!StyleBuilderConverter::createGridTrackList(value, trackSizes, namedGridLines, orderedNamedGridLines, styleResolver))
+        return;
+    const NamedGridAreaMap&amp; namedGridAreas = styleResolver.style()-&gt;namedGridArea();
+    if (!namedGridAreas.isEmpty())
+        StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(namedGridAreas, namedGridLines, ForRows);
+
+    styleResolver.style()-&gt;setGridRows(trackSizes);
+    styleResolver.style()-&gt;setNamedGridRowLines(namedGridLines);
+    styleResolver.style()-&gt;setOrderedNamedGridRowLines(orderedNamedGridLines);
+}
+#endif // ENABLE(CSS_GRID_LAYOUT)
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // StyleBuilderCustom_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (177871 => 177872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2015-01-04 03:47:25 UTC (rev 177871)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2015-01-04 06:35:04 UTC (rev 177872)
</span><span class="lines">@@ -1947,167 +1947,6 @@
</span><span class="cx">     return is&lt;SVGElement&gt;(m_state.element()) &amp;&amp; !(is&lt;SVGSVGElement&gt;(*m_state.element()) &amp;&amp; m_state.element()-&gt;parentNode());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(CSS_GRID_LAYOUT)
-static void createImplicitNamedGridLinesFromGridArea(const NamedGridAreaMap&amp; namedGridAreas, NamedGridLinesMap&amp; namedGridLines, GridTrackSizingDirection direction)
-{
-    for (auto&amp; area : namedGridAreas) {
-        GridSpan areaSpan = direction == ForRows ? area.value.rows : area.value.columns;
-        {
-            auto&amp; startVector = namedGridLines.add(area.key + &quot;-start&quot;, Vector&lt;unsigned&gt;()).iterator-&gt;value;
-            startVector.append(areaSpan.resolvedInitialPosition.toInt());
-            std::sort(startVector.begin(), startVector.end());
-        }
-        {
-            auto&amp; endVector = namedGridLines.add(area.key + &quot;-end&quot;, Vector&lt;unsigned&gt;()).iterator-&gt;value;
-            endVector.append(areaSpan.resolvedFinalPosition.next().toInt());
-            std::sort(endVector.begin(), endVector.end());
-        }
-    }
-}
-
-static bool createGridTrackBreadth(CSSPrimitiveValue* primitiveValue, const StyleResolver::State&amp; state, GridLength&amp; workingLength)
-{
-    if (primitiveValue-&gt;getValueID() == CSSValueWebkitMinContent) {
-        workingLength = Length(MinContent);
-        return true;
-    }
-
-    if (primitiveValue-&gt;getValueID() == CSSValueWebkitMaxContent) {
-        workingLength = Length(MaxContent);
-        return true;
-    }
-
-    if (primitiveValue-&gt;isFlex()) {
-        // Fractional unit.
-        workingLength.setFlex(primitiveValue-&gt;getDoubleValue());
-        return true;
-    }
-
-    workingLength = primitiveValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion | AutoConversion&gt;(state.cssToLengthConversionData());
-    if (workingLength.length().isUndefined())
-        return false;
-
-    if (primitiveValue-&gt;isLength())
-        workingLength.length().setHasQuirk(primitiveValue-&gt;isQuirkValue());
-
-    return true;
-}
-
-static bool createGridTrackSize(CSSValue&amp; value, GridTrackSize&amp; trackSize, const StyleResolver::State&amp; state)
-{
-    if (is&lt;CSSPrimitiveValue&gt;(value)) {
-        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(value);
-        GridLength workingLength;
-        if (!createGridTrackBreadth(&amp;primitiveValue, state, workingLength))
-            return false;
-
-        trackSize.setLength(workingLength);
-        return true;
-    }
-
-    CSSFunctionValue&amp; minmaxFunction = downcast&lt;CSSFunctionValue&gt;(value);
-    CSSValueList* arguments = minmaxFunction.arguments();
-    ASSERT_WITH_SECURITY_IMPLICATION(arguments-&gt;length() == 2);
-    GridLength minTrackBreadth;
-    GridLength maxTrackBreadth;
-    if (!createGridTrackBreadth(downcast&lt;CSSPrimitiveValue&gt;(arguments-&gt;itemWithoutBoundsCheck(0)), state, minTrackBreadth) || !createGridTrackBreadth(downcast&lt;CSSPrimitiveValue&gt;(arguments-&gt;itemWithoutBoundsCheck(1)), state, maxTrackBreadth))
-        return false;
-
-    trackSize.setMinMax(minTrackBreadth, maxTrackBreadth);
-    return true;
-}
-
-static bool createGridTrackList(CSSValue* value, Vector&lt;GridTrackSize&gt;&amp; trackSizes, NamedGridLinesMap&amp; namedGridLines, OrderedNamedGridLinesMap&amp; orderedNamedGridLines, const StyleResolver::State&amp; state)
-{
-    // Handle 'none'.
-    if (is&lt;CSSPrimitiveValue&gt;(*value)) {
-        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
-        return primitiveValue.getValueID() == CSSValueNone;
-    }
-
-    if (!is&lt;CSSValueList&gt;(*value))
-        return false;
-
-    unsigned currentNamedGridLine = 0;
-    for (auto&amp; currentValue : downcast&lt;CSSValueList&gt;(*value)) {
-        if (is&lt;CSSGridLineNamesValue&gt;(currentValue.get())) {
-            for (auto&amp; currentGridLineName : downcast&lt;CSSGridLineNamesValue&gt;(currentValue.get())) {
-                String namedGridLine = downcast&lt;CSSPrimitiveValue&gt;(currentGridLineName.get()).getStringValue();
-                NamedGridLinesMap::AddResult result = namedGridLines.add(namedGridLine, Vector&lt;unsigned&gt;());
-                result.iterator-&gt;value.append(currentNamedGridLine);
-                OrderedNamedGridLinesMap::AddResult orderedResult = orderedNamedGridLines.add(currentNamedGridLine, Vector&lt;String&gt;());
-                orderedResult.iterator-&gt;value.append(namedGridLine);
-            }
-            continue;
-        }
-
-        ++currentNamedGridLine;
-        GridTrackSize trackSize;
-        if (!createGridTrackSize(currentValue, trackSize, state))
-            return false;
-
-        trackSizes.append(trackSize);
-    }
-
-    // The parser should have rejected any &lt;track-list&gt; without any &lt;track-size&gt; as
-    // this is not conformant to the syntax.
-    ASSERT(!trackSizes.isEmpty());
-    return true;
-}
-
-
-static bool createGridPosition(CSSValue* value, GridPosition&amp; position)
-{
-    // We accept the specification's grammar:
-    // auto | &lt;custom-ident&gt; | [ &lt;integer&gt; &amp;&amp; &lt;custom-ident&gt;? ] | [ span &amp;&amp; [ &lt;integer&gt; || &lt;custom-ident&gt; ] ]
-    if (is&lt;CSSPrimitiveValue&gt;(*value)) {
-        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
-        // We translate &lt;ident&gt; to &lt;string&gt; during parsing as it makes handling it simpler.
-        if (primitiveValue.isString()) {
-            position.setNamedGridArea(primitiveValue.getStringValue());
-            return true;
-        }
-
-        ASSERT(primitiveValue.getValueID() == CSSValueAuto);
-        return true;
-    }
-
-    auto&amp; values = downcast&lt;CSSValueList&gt;(*value);
-    ASSERT(values.length());
-
-    bool isSpanPosition = false;
-    int gridLineNumber = 0;
-    String gridLineName;
-
-    auto it = values.begin();
-    CSSPrimitiveValue* currentValue = &amp;downcast&lt;CSSPrimitiveValue&gt;(it-&gt;get());
-    if (currentValue-&gt;getValueID() == CSSValueSpan) {
-        isSpanPosition = true;
-        ++it;
-        currentValue = it != values.end() ? &amp;downcast&lt;CSSPrimitiveValue&gt;(it-&gt;get()) : nullptr;
-    }
-
-    if (currentValue &amp;&amp; currentValue-&gt;isNumber()) {
-        gridLineNumber = currentValue-&gt;getIntValue();
-        ++it;
-        currentValue = it != values.end() ? &amp;downcast&lt;CSSPrimitiveValue&gt;(it-&gt;get()) : nullptr;
-    }
-
-    if (currentValue &amp;&amp; currentValue-&gt;isString()) {
-        gridLineName = currentValue-&gt;getStringValue();
-        ++it;
-    }
-
-    ASSERT(it == values.end());
-    if (isSpanPosition)
-        position.setSpanPosition(gridLineNumber ? gridLineNumber : 1, gridLineName);
-    else
-        position.setExplicitPosition(gridLineNumber, gridLineName);
-
-    return true;
-}
-#endif /* ENABLE(CSS_GRID_LAYOUT) */
-
</del><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="cx"> 
</span><span class="cx"> Length StyleResolver::parseSnapCoordinate(CSSPrimitiveValue&amp; value)
</span><span class="lines">@@ -2592,182 +2431,6 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-#if ENABLE(CSS_GRID_LAYOUT)
-    case CSSPropertyWebkitGridAutoColumns: {
-        HANDLE_INHERIT_AND_INITIAL(gridAutoColumns, GridAutoColumns);
-        GridTrackSize trackSize;
-        if (!createGridTrackSize(*value, trackSize, state))
-            return;
-        state.style()-&gt;setGridAutoColumns(trackSize);
-        return;
-    }
-    case CSSPropertyWebkitGridAutoRows: {
-        HANDLE_INHERIT_AND_INITIAL(gridAutoRows, GridAutoRows);
-        GridTrackSize trackSize;
-        if (!createGridTrackSize(*value, trackSize, state))
-            return;
-        state.style()-&gt;setGridAutoRows(trackSize);
-        return;
-    }
-    case CSSPropertyWebkitGridTemplateColumns: {
-        if (isInherit) {
-            m_state.style()-&gt;setGridColumns(m_state.parentStyle()-&gt;gridColumns());
-            m_state.style()-&gt;setNamedGridColumnLines(m_state.parentStyle()-&gt;namedGridColumnLines());
-            m_state.style()-&gt;setOrderedNamedGridColumnLines(m_state.parentStyle()-&gt;orderedNamedGridColumnLines());
-            return;
-        }
-        if (isInitial) {
-            m_state.style()-&gt;setGridColumns(RenderStyle::initialGridColumns());
-            m_state.style()-&gt;setNamedGridColumnLines(RenderStyle::initialNamedGridColumnLines());
-            m_state.style()-&gt;setOrderedNamedGridColumnLines(RenderStyle::initialOrderedNamedGridColumnLines());
-            return;
-        }
-        Vector&lt;GridTrackSize&gt; trackSizes;
-        NamedGridLinesMap namedGridLines;
-        OrderedNamedGridLinesMap orderedNamedGridLines;
-        if (!createGridTrackList(value, trackSizes, namedGridLines, orderedNamedGridLines, state))
-            return;
-        const NamedGridAreaMap&amp; namedGridAreas = state.style()-&gt;namedGridArea();
-        if (!namedGridAreas.isEmpty())
-            createImplicitNamedGridLinesFromGridArea(namedGridAreas, namedGridLines, ForColumns);
-
-        state.style()-&gt;setGridColumns(trackSizes);
-        state.style()-&gt;setNamedGridColumnLines(namedGridLines);
-        state.style()-&gt;setOrderedNamedGridColumnLines(orderedNamedGridLines);
-        return;
-    }
-    case CSSPropertyWebkitGridTemplateRows: {
-        if (isInherit) {
-            m_state.style()-&gt;setGridRows(m_state.parentStyle()-&gt;gridRows());
-            m_state.style()-&gt;setNamedGridRowLines(m_state.parentStyle()-&gt;namedGridRowLines());
-            m_state.style()-&gt;setOrderedNamedGridRowLines(m_state.parentStyle()-&gt;orderedNamedGridRowLines());
-            return;
-        }
-        if (isInitial) {
-            m_state.style()-&gt;setGridRows(RenderStyle::initialGridRows());
-            m_state.style()-&gt;setNamedGridRowLines(RenderStyle::initialNamedGridRowLines());
-            m_state.style()-&gt;setOrderedNamedGridRowLines(RenderStyle::initialOrderedNamedGridRowLines());
-            return;
-        }
-        Vector&lt;GridTrackSize&gt; trackSizes;
-        NamedGridLinesMap namedGridLines;
-        OrderedNamedGridLinesMap orderedNamedGridLines;
-        if (!createGridTrackList(value, trackSizes, namedGridLines, orderedNamedGridLines, state))
-            return;
-        const NamedGridAreaMap&amp; namedGridAreas = state.style()-&gt;namedGridArea();
-        if (!namedGridAreas.isEmpty())
-            createImplicitNamedGridLinesFromGridArea(namedGridAreas, namedGridLines, ForRows);
-
-        state.style()-&gt;setGridRows(trackSizes);
-        state.style()-&gt;setNamedGridRowLines(namedGridLines);
-        state.style()-&gt;setOrderedNamedGridRowLines(orderedNamedGridLines);
-        return;
-    }
-
-    case CSSPropertyWebkitGridColumnStart: {
-        HANDLE_INHERIT_AND_INITIAL(gridItemColumnStart, GridItemColumnStart);
-        GridPosition columnStartPosition;
-        if (!createGridPosition(value, columnStartPosition))
-            return;
-        state.style()-&gt;setGridItemColumnStart(columnStartPosition);
-        return;
-    }
-    case CSSPropertyWebkitGridColumnEnd: {
-        HANDLE_INHERIT_AND_INITIAL(gridItemColumnEnd, GridItemColumnEnd);
-        GridPosition columnEndPosition;
-        if (!createGridPosition(value, columnEndPosition))
-            return;
-        state.style()-&gt;setGridItemColumnEnd(columnEndPosition);
-        return;
-    }
-
-    case CSSPropertyWebkitGridRowStart: {
-        HANDLE_INHERIT_AND_INITIAL(gridItemRowStart, GridItemRowStart);
-        GridPosition rowStartPosition;
-        if (!createGridPosition(value, rowStartPosition))
-            return;
-        state.style()-&gt;setGridItemRowStart(rowStartPosition);
-        return;
-    }
-    case CSSPropertyWebkitGridRowEnd: {
-        HANDLE_INHERIT_AND_INITIAL(gridItemRowEnd, GridItemRowEnd);
-        GridPosition rowEndPosition;
-        if (!createGridPosition(value, rowEndPosition))
-            return;
-        state.style()-&gt;setGridItemRowEnd(rowEndPosition);
-        return;
-    }
-    case CSSPropertyWebkitGridTemplateAreas: {
-        if (isInherit) {
-            state.style()-&gt;setNamedGridArea(state.parentStyle()-&gt;namedGridArea());
-            state.style()-&gt;setNamedGridAreaRowCount(state.parentStyle()-&gt;namedGridAreaRowCount());
-            state.style()-&gt;setNamedGridAreaColumnCount(state.parentStyle()-&gt;namedGridAreaColumnCount());
-            return;
-        }
-        if (isInitial) {
-            state.style()-&gt;setNamedGridArea(RenderStyle::initialNamedGridArea());
-            state.style()-&gt;setNamedGridAreaRowCount(RenderStyle::initialNamedGridAreaCount());
-            state.style()-&gt;setNamedGridAreaColumnCount(RenderStyle::initialNamedGridAreaCount());
-            return;
-        }
-
-        if (primitiveValue) {
-            ASSERT(primitiveValue-&gt;getValueID() == CSSValueNone);
-            return;
-        }
-
-        CSSGridTemplateAreasValue&amp; gridTemplateAreasValue = downcast&lt;CSSGridTemplateAreasValue&gt;(*value);
-        const NamedGridAreaMap&amp; newNamedGridAreas = gridTemplateAreasValue.gridAreaMap();
-
-        NamedGridLinesMap namedGridColumnLines = state.style()-&gt;namedGridColumnLines();
-        NamedGridLinesMap namedGridRowLines = state.style()-&gt;namedGridRowLines();
-        createImplicitNamedGridLinesFromGridArea(newNamedGridAreas, namedGridColumnLines, ForColumns);
-        createImplicitNamedGridLinesFromGridArea(newNamedGridAreas, namedGridRowLines, ForRows);
-        state.style()-&gt;setNamedGridColumnLines(namedGridColumnLines);
-        state.style()-&gt;setNamedGridRowLines(namedGridRowLines);
-
-        state.style()-&gt;setNamedGridArea(gridTemplateAreasValue.gridAreaMap());
-        state.style()-&gt;setNamedGridAreaRowCount(gridTemplateAreasValue.rowCount());
-        state.style()-&gt;setNamedGridAreaColumnCount(gridTemplateAreasValue.columnCount());
-        return;
-    }
-    case CSSPropertyWebkitGridAutoFlow: {
-        HANDLE_INHERIT_AND_INITIAL(gridAutoFlow, GridAutoFlow);
-        if (!is&lt;CSSValueList&gt;(*value))
-            return;
-        CSSValueList&amp; list = downcast&lt;CSSValueList&gt;(*value);
-
-        if (!list.length()) {
-            state.style()-&gt;setGridAutoFlow(RenderStyle::initialGridAutoFlow());
-            return;
-        }
-
-        CSSPrimitiveValue&amp; first = downcast&lt;CSSPrimitiveValue&gt;(*list.item(0));
-        CSSPrimitiveValue* second = list.length() == 2 ? downcast&lt;CSSPrimitiveValue&gt;(list.item(1)) : nullptr;
-
-        GridAutoFlow autoFlow = RenderStyle::initialGridAutoFlow();
-        switch (first.getValueID()) {
-        case CSSValueRow:
-            if (second &amp;&amp; second-&gt;getValueID() == CSSValueDense)
-                autoFlow =  AutoFlowRowDense;
-            else
-                autoFlow = AutoFlowRow;
-            break;
-        case CSSValueColumn:
-            if (second &amp;&amp; second-&gt;getValueID() == CSSValueDense)
-                autoFlow = AutoFlowColumnDense;
-            else
-                autoFlow = AutoFlowColumn;
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-            break;
-        }
-
-        state.style()-&gt;setGridAutoFlow(autoFlow);
-        return;
-    }
-#endif /* ENABLE(CSS_GRID_LAYOUT) */
</del><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="cx">     case CSSPropertyWebkitScrollSnapType:
</span><span class="cx">         HANDLE_INHERIT_AND_INITIAL(scrollSnapType, ScrollSnapType);
</span><span class="lines">@@ -3086,6 +2749,18 @@
</span><span class="cx">     case CSSPropertyOrientation:
</span><span class="cx">     case CSSPropertyUserZoom:
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+    case CSSPropertyWebkitGridAutoColumns:
+    case CSSPropertyWebkitGridAutoRows:
+    case CSSPropertyWebkitGridTemplateColumns:
+    case CSSPropertyWebkitGridTemplateRows:
+    case CSSPropertyWebkitGridColumnStart:
+    case CSSPropertyWebkitGridColumnEnd:
+    case CSSPropertyWebkitGridRowStart:
+    case CSSPropertyWebkitGridRowEnd:
+    case CSSPropertyWebkitGridTemplateAreas:
+    case CSSPropertyWebkitGridAutoFlow:
+#endif // ENABLE(CSS_GRID_LAYOUT)
</ins><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">         return;
</span><span class="cx">     default:
</span></span></pre></div>
<a id="trunkSourceWebCorecssmakeproppl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/makeprop.pl (177871 => 177872)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/makeprop.pl        2015-01-04 03:47:25 UTC (rev 177871)
+++ trunk/Source/WebCore/css/makeprop.pl        2015-01-04 06:35:04 UTC (rev 177872)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> my %styleBuilderOptions = (
</span><span class="cx">   AnimationProperty =&gt; 1, # Defined in Source/WebCore/css/StyleBuilderConverter.h
</span><span class="cx">   AutoFunctions =&gt; 1,
</span><ins>+  ConditionalConverter =&gt; 1,
</ins><span class="cx">   Converter =&gt; 1,
</span><span class="cx">   Custom =&gt; 1,
</span><span class="cx">   FillLayerProperty =&gt; 1,
</span><span class="lines">@@ -772,6 +773,9 @@
</span><span class="cx">   my $convertedValue;
</span><span class="cx">   if (exists($propertiesWithStyleBuilderOptions{$name}{&quot;Converter&quot;})) {
</span><span class="cx">     $convertedValue = &quot;StyleBuilderConverter::convert&quot; . $propertiesWithStyleBuilderOptions{$name}{&quot;Converter&quot;} . &quot;(styleResolver, value)&quot;;
</span><ins>+  } elsif (exists($propertiesWithStyleBuilderOptions{$name}{&quot;ConditionalConverter&quot;})) {
+    $setterContent .= $indent . &quot;    &quot; . $propertiesWithStyleBuilderOptions{$name}{&quot;TypeName&quot;} . &quot; convertedValue;\n&quot;;
+    $convertedValue = &quot;convertedValue&quot;;
</ins><span class="cx">   } else {
</span><span class="cx">     $convertedValue = &quot;static_cast&lt;&quot; . $propertiesWithStyleBuilderOptions{$name}{&quot;TypeName&quot;} . &quot;&gt;(downcast&lt;CSSPrimitiveValue&gt;(value))&quot;;
</span><span class="cx">   }
</span><span class="lines">@@ -806,6 +810,10 @@
</span><span class="cx">   }
</span><span class="cx">   if (!$didCallSetValue) {
</span><span class="cx">     my $setValue = $style . &quot;-&gt;&quot; . $setter;
</span><ins>+    if (exists($propertiesWithStyleBuilderOptions{$name}{&quot;ConditionalConverter&quot;})) {
+      $setterContent .= $indent . &quot;    if (StyleBuilderConverter::convert&quot; . $propertiesWithStyleBuilderOptions{$name}{&quot;ConditionalConverter&quot;} . &quot;(styleResolver, value, &quot; . $convertedValue . &quot;))\n&quot;;
+      $setterContent .= &quot;    &quot;;
+    }
</ins><span class="cx">     $setterContent .= $indent . &quot;    &quot; . $setValue . &quot;(&quot; . $convertedValue . &quot;);\n&quot;;
</span><span class="cx">   }
</span><span class="cx">   $setterContent .= $indent . &quot;}\n&quot;;
</span></span></pre>
</div>
</div>

</body>
</html>