<!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 "ConditionalConverter" 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 <cdumez@apple.com>
+
+ 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 "ConditionalConverter" 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 <cdumez@apple.com>
</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) && 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<short>]
</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 "BasicShapeFunctions.h"
</span><span class="cx"> #include "CSSCalculationValue.h"
</span><ins>+#include "CSSFunctionValue.h"
+#include "CSSGridLineNamesValue.h"
+#include "CSSGridTemplateAreasValue.h"
</ins><span class="cx"> #include "CSSImageGeneratorValue.h"
</span><span class="cx"> #include "CSSImageSetValue.h"
</span><span class="cx"> #include "CSSImageValue.h"
</span><span class="lines">@@ -78,11 +81,25 @@
</span><span class="cx"> static LineBoxContain convertLineBoxContain(StyleResolver&, CSSValue&);
</span><span class="cx"> static TextDecorationSkip convertTextDecorationSkip(StyleResolver&, CSSValue&);
</span><span class="cx"> static PassRefPtr<ShapeValue> convertShapeValue(StyleResolver&, CSSValue&);
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+ static bool convertGridTrackSize(StyleResolver&, CSSValue&, GridTrackSize&);
+ static bool convertGridPosition(StyleResolver&, CSSValue&, GridPosition&);
+ static GridAutoFlow convertGridAutoFlow(StyleResolver&, CSSValue&);
+#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&, CSSPrimitiveValue&);
</span><span class="cx"> static TextEmphasisPosition valueToEmphasisPosition(CSSPrimitiveValue&);
</span><span class="cx"> static TextDecorationSkip valueToDecorationSkip(const CSSPrimitiveValue&);
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+ static bool createGridTrackBreadth(CSSPrimitiveValue&, StyleResolver&, GridLength&);
+ static bool createGridTrackSize(CSSValue&, GridTrackSize&, StyleResolver&);
+ static bool createGridTrackList(CSSValue&, Vector<GridTrackSize>& trackSizes, NamedGridLinesMap&, OrderedNamedGridLinesMap&, StyleResolver&);
+ static bool createGridPosition(CSSValue&, GridPosition&);
+ static void createImplicitNamedGridLinesFromGridArea(const NamedGridAreaMap&, NamedGridLinesMap&, GridTrackSizingDirection);
+#endif // ENABLE(CSS_GRID_LAYOUT)
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> inline Length StyleBuilderConverter::convertLength(StyleResolver& styleResolver, CSSValue& 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& primitiveValue, StyleResolver& styleResolver, GridLength& 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<FixedIntegerConversion | PercentConversion | CalculatedConversion | AutoConversion>(styleResolver.state().cssToLengthConversionData());
+ if (workingLength.length().isUndefined())
+ return false;
+
+ if (primitiveValue.isLength())
+ workingLength.length().setHasQuirk(primitiveValue.isQuirkValue());
+
+ return true;
+}
+
+bool StyleBuilderConverter::createGridTrackSize(CSSValue& value, GridTrackSize& trackSize, StyleResolver& styleResolver)
+{
+ if (is<CSSPrimitiveValue>(value)) {
+ GridLength workingLength;
+ if (!createGridTrackBreadth(downcast<CSSPrimitiveValue>(value), styleResolver, workingLength))
+ return false;
+
+ trackSize.setLength(workingLength);
+ return true;
+ }
+
+ CSSValueList& arguments = *downcast<CSSFunctionValue>(value).arguments();
+ ASSERT_WITH_SECURITY_IMPLICATION(arguments.length() == 2);
+
+ GridLength minTrackBreadth;
+ GridLength maxTrackBreadth;
+ if (!createGridTrackBreadth(downcast<CSSPrimitiveValue>(*arguments.itemWithoutBoundsCheck(0)), styleResolver, minTrackBreadth) || !createGridTrackBreadth(downcast<CSSPrimitiveValue>(*arguments.itemWithoutBoundsCheck(1)), styleResolver, maxTrackBreadth))
+ return false;
+
+ trackSize.setMinMax(minTrackBreadth, maxTrackBreadth);
+ return true;
+}
+
+bool StyleBuilderConverter::createGridTrackList(CSSValue& value, Vector<GridTrackSize>& trackSizes, NamedGridLinesMap& namedGridLines, OrderedNamedGridLinesMap& orderedNamedGridLines, StyleResolver& styleResolver)
+{
+ // Handle 'none'.
+ if (is<CSSPrimitiveValue>(value))
+ return downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNone;
+
+ if (!is<CSSValueList>(value))
+ return false;
+
+ unsigned currentNamedGridLine = 0;
+ for (auto& currentValue : downcast<CSSValueList>(value)) {
+ if (is<CSSGridLineNamesValue>(currentValue.get())) {
+ for (auto& currentGridLineName : downcast<CSSGridLineNamesValue>(currentValue.get())) {
+ String namedGridLine = downcast<CSSPrimitiveValue>(currentGridLineName.get()).getStringValue();
+ NamedGridLinesMap::AddResult result = namedGridLines.add(namedGridLine, Vector<unsigned>());
+ result.iterator->value.append(currentNamedGridLine);
+ OrderedNamedGridLinesMap::AddResult orderedResult = orderedNamedGridLines.add(currentNamedGridLine, Vector<String>());
+ orderedResult.iterator->value.append(namedGridLine);
+ }
+ continue;
+ }
+
+ ++currentNamedGridLine;
+ GridTrackSize trackSize;
+ if (!createGridTrackSize(currentValue, trackSize, styleResolver))
+ return false;
+
+ trackSizes.append(trackSize);
+ }
+
+ // The parser should have rejected any <track-list> without any <track-size> as
+ // this is not conformant to the syntax.
+ ASSERT(!trackSizes.isEmpty());
+ return true;
+}
+
+bool StyleBuilderConverter::createGridPosition(CSSValue& value, GridPosition& position)
+{
+ // We accept the specification's grammar:
+ // auto | <custom-ident> | [ <integer> && <custom-ident>? ] | [ span && [ <integer> || <custom-ident> ] ]
+ if (is<CSSPrimitiveValue>(value)) {
+ auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
+ // We translate <ident> to <string> during parsing as it makes handling it simpler.
+ if (primitiveValue.isString()) {
+ position.setNamedGridArea(primitiveValue.getStringValue());
+ return true;
+ }
+
+ ASSERT(primitiveValue.getValueID() == CSSValueAuto);
+ return true;
+ }
+
+ auto& values = downcast<CSSValueList>(value);
+ ASSERT(values.length());
+
+ auto it = values.begin();
+ CSSPrimitiveValue* currentValue = &downcast<CSSPrimitiveValue>(it->get());
+ bool isSpanPosition = false;
+ if (currentValue->getValueID() == CSSValueSpan) {
+ isSpanPosition = true;
+ ++it;
+ currentValue = it != values.end() ? &downcast<CSSPrimitiveValue>(it->get()) : nullptr;
+ }
+
+ int gridLineNumber = 0;
+ if (currentValue && currentValue->isNumber()) {
+ gridLineNumber = currentValue->getIntValue();
+ ++it;
+ currentValue = it != values.end() ? &downcast<CSSPrimitiveValue>(it->get()) : nullptr;
+ }
+
+ String gridLineName;
+ if (currentValue && currentValue->isString()) {
+ gridLineName = currentValue->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& namedGridAreas, NamedGridLinesMap& namedGridLines, GridTrackSizingDirection direction)
+{
+ for (auto& area : namedGridAreas) {
+ GridSpan areaSpan = direction == ForRows ? area.value.rows : area.value.columns;
+ {
+ auto& startVector = namedGridLines.add(area.key + "-start", Vector<unsigned>()).iterator->value;
+ startVector.append(areaSpan.resolvedInitialPosition.toInt());
+ std::sort(startVector.begin(), startVector.end());
+ }
+ {
+ auto& endVector = namedGridLines.add(area.key + "-end", Vector<unsigned>()).iterator->value;
+ endVector.append(areaSpan.resolvedFinalPosition.next().toInt());
+ std::sort(endVector.begin(), endVector.end());
+ }
+ }
+}
+
+inline bool StyleBuilderConverter::convertGridTrackSize(StyleResolver& styleResolver, CSSValue& value, GridTrackSize& trackSize)
+{
+ return createGridTrackSize(value, trackSize, styleResolver);
+}
+
+inline bool StyleBuilderConverter::convertGridPosition(StyleResolver&, CSSValue& value, GridPosition& gridPosition)
+{
+ return createGridPosition(value, gridPosition);
+}
+
+inline GridAutoFlow StyleBuilderConverter::convertGridAutoFlow(StyleResolver&, CSSValue& value)
+{
+ auto& list = downcast<CSSValueList>(value);
+ if (!list.length())
+ return RenderStyle::initialGridAutoFlow();
+
+ CSSPrimitiveValue& first = downcast<CSSPrimitiveValue>(*list.item(0));
+ CSSPrimitiveValue* second = downcast<CSSPrimitiveValue>(list.item(1));
+
+ GridAutoFlow autoFlow = RenderStyle::initialGridAutoFlow();
+ switch (first.getValueID()) {
+ case CSSValueRow:
+ if (second && second->getValueID() == CSSValueDense)
+ autoFlow = AutoFlowRowDense;
+ else
+ autoFlow = AutoFlowRow;
+ break;
+ case CSSValueColumn:
+ if (second && second->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& styleResolver)
+{
+ styleResolver.style()->setNamedGridArea(RenderStyle::initialNamedGridArea());
+ styleResolver.style()->setNamedGridAreaRowCount(RenderStyle::initialNamedGridAreaCount());
+ styleResolver.style()->setNamedGridAreaColumnCount(RenderStyle::initialNamedGridAreaCount());
+}
+
+inline void StyleBuilderCustom::applyInheritWebkitGridTemplateAreas(StyleResolver& styleResolver)
+{
+ styleResolver.style()->setNamedGridArea(styleResolver.parentStyle()->namedGridArea());
+ styleResolver.style()->setNamedGridAreaRowCount(styleResolver.parentStyle()->namedGridAreaRowCount());
+ styleResolver.style()->setNamedGridAreaColumnCount(styleResolver.parentStyle()->namedGridAreaColumnCount());
+}
+
+inline void StyleBuilderCustom::applyValueWebkitGridTemplateAreas(StyleResolver& styleResolver, CSSValue& value)
+{
+ if (is<CSSPrimitiveValue>(value)) {
+ ASSERT(downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNone);
+ return;
+ }
+
+ auto& gridTemplateAreasValue = downcast<CSSGridTemplateAreasValue>(value);
+ const NamedGridAreaMap& newNamedGridAreas = gridTemplateAreasValue.gridAreaMap();
+
+ NamedGridLinesMap namedGridColumnLines = styleResolver.style()->namedGridColumnLines();
+ NamedGridLinesMap namedGridRowLines = styleResolver.style()->namedGridRowLines();
+ StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(newNamedGridAreas, namedGridColumnLines, ForColumns);
+ StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(newNamedGridAreas, namedGridRowLines, ForRows);
+ styleResolver.style()->setNamedGridColumnLines(namedGridColumnLines);
+ styleResolver.style()->setNamedGridRowLines(namedGridRowLines);
+
+ styleResolver.style()->setNamedGridArea(gridTemplateAreasValue.gridAreaMap());
+ styleResolver.style()->setNamedGridAreaRowCount(gridTemplateAreasValue.rowCount());
+ styleResolver.style()->setNamedGridAreaColumnCount(gridTemplateAreasValue.columnCount());
+}
+
+inline void StyleBuilderCustom::applyInitialWebkitGridTemplateColumns(StyleResolver& styleResolver)
+{
+ styleResolver.style()->setGridColumns(RenderStyle::initialGridColumns());
+ styleResolver.style()->setNamedGridColumnLines(RenderStyle::initialNamedGridColumnLines());
+ styleResolver.style()->setOrderedNamedGridColumnLines(RenderStyle::initialOrderedNamedGridColumnLines());
+}
+
+inline void StyleBuilderCustom::applyInheritWebkitGridTemplateColumns(StyleResolver& styleResolver)
+{
+ styleResolver.style()->setGridColumns(styleResolver.parentStyle()->gridColumns());
+ styleResolver.style()->setNamedGridColumnLines(styleResolver.parentStyle()->namedGridColumnLines());
+ styleResolver.style()->setOrderedNamedGridColumnLines(styleResolver.parentStyle()->orderedNamedGridColumnLines());
+}
+
+inline void StyleBuilderCustom::applyValueWebkitGridTemplateColumns(StyleResolver& styleResolver, CSSValue& value)
+{
+ Vector<GridTrackSize> trackSizes;
+ NamedGridLinesMap namedGridLines;
+ OrderedNamedGridLinesMap orderedNamedGridLines;
+ if (!StyleBuilderConverter::createGridTrackList(value, trackSizes, namedGridLines, orderedNamedGridLines, styleResolver))
+ return;
+ const NamedGridAreaMap& namedGridAreas = styleResolver.style()->namedGridArea();
+ if (!namedGridAreas.isEmpty())
+ StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(namedGridAreas, namedGridLines, ForColumns);
+
+ styleResolver.style()->setGridColumns(trackSizes);
+ styleResolver.style()->setNamedGridColumnLines(namedGridLines);
+ styleResolver.style()->setOrderedNamedGridColumnLines(orderedNamedGridLines);
+}
+
+inline void StyleBuilderCustom::applyInitialWebkitGridTemplateRows(StyleResolver& styleResolver)
+{
+ styleResolver.style()->setGridRows(RenderStyle::initialGridRows());
+ styleResolver.style()->setNamedGridRowLines(RenderStyle::initialNamedGridRowLines());
+ styleResolver.style()->setOrderedNamedGridRowLines(RenderStyle::initialOrderedNamedGridRowLines());
+}
+
+inline void StyleBuilderCustom::applyInheritWebkitGridTemplateRows(StyleResolver& styleResolver)
+{
+ styleResolver.style()->setGridRows(styleResolver.parentStyle()->gridRows());
+ styleResolver.style()->setNamedGridRowLines(styleResolver.parentStyle()->namedGridRowLines());
+ styleResolver.style()->setOrderedNamedGridRowLines(styleResolver.parentStyle()->orderedNamedGridRowLines());
+}
+
+inline void StyleBuilderCustom::applyValueWebkitGridTemplateRows(StyleResolver& styleResolver, CSSValue& value)
+{
+ Vector<GridTrackSize> trackSizes;
+ NamedGridLinesMap namedGridLines;
+ OrderedNamedGridLinesMap orderedNamedGridLines;
+ if (!StyleBuilderConverter::createGridTrackList(value, trackSizes, namedGridLines, orderedNamedGridLines, styleResolver))
+ return;
+ const NamedGridAreaMap& namedGridAreas = styleResolver.style()->namedGridArea();
+ if (!namedGridAreas.isEmpty())
+ StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(namedGridAreas, namedGridLines, ForRows);
+
+ styleResolver.style()->setGridRows(trackSizes);
+ styleResolver.style()->setNamedGridRowLines(namedGridLines);
+ styleResolver.style()->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<SVGElement>(m_state.element()) && !(is<SVGSVGElement>(*m_state.element()) && m_state.element()->parentNode());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if ENABLE(CSS_GRID_LAYOUT)
-static void createImplicitNamedGridLinesFromGridArea(const NamedGridAreaMap& namedGridAreas, NamedGridLinesMap& namedGridLines, GridTrackSizingDirection direction)
-{
- for (auto& area : namedGridAreas) {
- GridSpan areaSpan = direction == ForRows ? area.value.rows : area.value.columns;
- {
- auto& startVector = namedGridLines.add(area.key + "-start", Vector<unsigned>()).iterator->value;
- startVector.append(areaSpan.resolvedInitialPosition.toInt());
- std::sort(startVector.begin(), startVector.end());
- }
- {
- auto& endVector = namedGridLines.add(area.key + "-end", Vector<unsigned>()).iterator->value;
- endVector.append(areaSpan.resolvedFinalPosition.next().toInt());
- std::sort(endVector.begin(), endVector.end());
- }
- }
-}
-
-static bool createGridTrackBreadth(CSSPrimitiveValue* primitiveValue, const StyleResolver::State& state, GridLength& 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<FixedIntegerConversion | PercentConversion | CalculatedConversion | AutoConversion>(state.cssToLengthConversionData());
- if (workingLength.length().isUndefined())
- return false;
-
- if (primitiveValue->isLength())
- workingLength.length().setHasQuirk(primitiveValue->isQuirkValue());
-
- return true;
-}
-
-static bool createGridTrackSize(CSSValue& value, GridTrackSize& trackSize, const StyleResolver::State& state)
-{
- if (is<CSSPrimitiveValue>(value)) {
- CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(value);
- GridLength workingLength;
- if (!createGridTrackBreadth(&primitiveValue, state, workingLength))
- return false;
-
- trackSize.setLength(workingLength);
- return true;
- }
-
- CSSFunctionValue& minmaxFunction = downcast<CSSFunctionValue>(value);
- CSSValueList* arguments = minmaxFunction.arguments();
- ASSERT_WITH_SECURITY_IMPLICATION(arguments->length() == 2);
- GridLength minTrackBreadth;
- GridLength maxTrackBreadth;
- if (!createGridTrackBreadth(downcast<CSSPrimitiveValue>(arguments->itemWithoutBoundsCheck(0)), state, minTrackBreadth) || !createGridTrackBreadth(downcast<CSSPrimitiveValue>(arguments->itemWithoutBoundsCheck(1)), state, maxTrackBreadth))
- return false;
-
- trackSize.setMinMax(minTrackBreadth, maxTrackBreadth);
- return true;
-}
-
-static bool createGridTrackList(CSSValue* value, Vector<GridTrackSize>& trackSizes, NamedGridLinesMap& namedGridLines, OrderedNamedGridLinesMap& orderedNamedGridLines, const StyleResolver::State& state)
-{
- // Handle 'none'.
- if (is<CSSPrimitiveValue>(*value)) {
- CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
- return primitiveValue.getValueID() == CSSValueNone;
- }
-
- if (!is<CSSValueList>(*value))
- return false;
-
- unsigned currentNamedGridLine = 0;
- for (auto& currentValue : downcast<CSSValueList>(*value)) {
- if (is<CSSGridLineNamesValue>(currentValue.get())) {
- for (auto& currentGridLineName : downcast<CSSGridLineNamesValue>(currentValue.get())) {
- String namedGridLine = downcast<CSSPrimitiveValue>(currentGridLineName.get()).getStringValue();
- NamedGridLinesMap::AddResult result = namedGridLines.add(namedGridLine, Vector<unsigned>());
- result.iterator->value.append(currentNamedGridLine);
- OrderedNamedGridLinesMap::AddResult orderedResult = orderedNamedGridLines.add(currentNamedGridLine, Vector<String>());
- orderedResult.iterator->value.append(namedGridLine);
- }
- continue;
- }
-
- ++currentNamedGridLine;
- GridTrackSize trackSize;
- if (!createGridTrackSize(currentValue, trackSize, state))
- return false;
-
- trackSizes.append(trackSize);
- }
-
- // The parser should have rejected any <track-list> without any <track-size> as
- // this is not conformant to the syntax.
- ASSERT(!trackSizes.isEmpty());
- return true;
-}
-
-
-static bool createGridPosition(CSSValue* value, GridPosition& position)
-{
- // We accept the specification's grammar:
- // auto | <custom-ident> | [ <integer> && <custom-ident>? ] | [ span && [ <integer> || <custom-ident> ] ]
- if (is<CSSPrimitiveValue>(*value)) {
- CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
- // We translate <ident> to <string> during parsing as it makes handling it simpler.
- if (primitiveValue.isString()) {
- position.setNamedGridArea(primitiveValue.getStringValue());
- return true;
- }
-
- ASSERT(primitiveValue.getValueID() == CSSValueAuto);
- return true;
- }
-
- auto& values = downcast<CSSValueList>(*value);
- ASSERT(values.length());
-
- bool isSpanPosition = false;
- int gridLineNumber = 0;
- String gridLineName;
-
- auto it = values.begin();
- CSSPrimitiveValue* currentValue = &downcast<CSSPrimitiveValue>(it->get());
- if (currentValue->getValueID() == CSSValueSpan) {
- isSpanPosition = true;
- ++it;
- currentValue = it != values.end() ? &downcast<CSSPrimitiveValue>(it->get()) : nullptr;
- }
-
- if (currentValue && currentValue->isNumber()) {
- gridLineNumber = currentValue->getIntValue();
- ++it;
- currentValue = it != values.end() ? &downcast<CSSPrimitiveValue>(it->get()) : nullptr;
- }
-
- if (currentValue && currentValue->isString()) {
- gridLineName = currentValue->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& 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()->setGridAutoColumns(trackSize);
- return;
- }
- case CSSPropertyWebkitGridAutoRows: {
- HANDLE_INHERIT_AND_INITIAL(gridAutoRows, GridAutoRows);
- GridTrackSize trackSize;
- if (!createGridTrackSize(*value, trackSize, state))
- return;
- state.style()->setGridAutoRows(trackSize);
- return;
- }
- case CSSPropertyWebkitGridTemplateColumns: {
- if (isInherit) {
- m_state.style()->setGridColumns(m_state.parentStyle()->gridColumns());
- m_state.style()->setNamedGridColumnLines(m_state.parentStyle()->namedGridColumnLines());
- m_state.style()->setOrderedNamedGridColumnLines(m_state.parentStyle()->orderedNamedGridColumnLines());
- return;
- }
- if (isInitial) {
- m_state.style()->setGridColumns(RenderStyle::initialGridColumns());
- m_state.style()->setNamedGridColumnLines(RenderStyle::initialNamedGridColumnLines());
- m_state.style()->setOrderedNamedGridColumnLines(RenderStyle::initialOrderedNamedGridColumnLines());
- return;
- }
- Vector<GridTrackSize> trackSizes;
- NamedGridLinesMap namedGridLines;
- OrderedNamedGridLinesMap orderedNamedGridLines;
- if (!createGridTrackList(value, trackSizes, namedGridLines, orderedNamedGridLines, state))
- return;
- const NamedGridAreaMap& namedGridAreas = state.style()->namedGridArea();
- if (!namedGridAreas.isEmpty())
- createImplicitNamedGridLinesFromGridArea(namedGridAreas, namedGridLines, ForColumns);
-
- state.style()->setGridColumns(trackSizes);
- state.style()->setNamedGridColumnLines(namedGridLines);
- state.style()->setOrderedNamedGridColumnLines(orderedNamedGridLines);
- return;
- }
- case CSSPropertyWebkitGridTemplateRows: {
- if (isInherit) {
- m_state.style()->setGridRows(m_state.parentStyle()->gridRows());
- m_state.style()->setNamedGridRowLines(m_state.parentStyle()->namedGridRowLines());
- m_state.style()->setOrderedNamedGridRowLines(m_state.parentStyle()->orderedNamedGridRowLines());
- return;
- }
- if (isInitial) {
- m_state.style()->setGridRows(RenderStyle::initialGridRows());
- m_state.style()->setNamedGridRowLines(RenderStyle::initialNamedGridRowLines());
- m_state.style()->setOrderedNamedGridRowLines(RenderStyle::initialOrderedNamedGridRowLines());
- return;
- }
- Vector<GridTrackSize> trackSizes;
- NamedGridLinesMap namedGridLines;
- OrderedNamedGridLinesMap orderedNamedGridLines;
- if (!createGridTrackList(value, trackSizes, namedGridLines, orderedNamedGridLines, state))
- return;
- const NamedGridAreaMap& namedGridAreas = state.style()->namedGridArea();
- if (!namedGridAreas.isEmpty())
- createImplicitNamedGridLinesFromGridArea(namedGridAreas, namedGridLines, ForRows);
-
- state.style()->setGridRows(trackSizes);
- state.style()->setNamedGridRowLines(namedGridLines);
- state.style()->setOrderedNamedGridRowLines(orderedNamedGridLines);
- return;
- }
-
- case CSSPropertyWebkitGridColumnStart: {
- HANDLE_INHERIT_AND_INITIAL(gridItemColumnStart, GridItemColumnStart);
- GridPosition columnStartPosition;
- if (!createGridPosition(value, columnStartPosition))
- return;
- state.style()->setGridItemColumnStart(columnStartPosition);
- return;
- }
- case CSSPropertyWebkitGridColumnEnd: {
- HANDLE_INHERIT_AND_INITIAL(gridItemColumnEnd, GridItemColumnEnd);
- GridPosition columnEndPosition;
- if (!createGridPosition(value, columnEndPosition))
- return;
- state.style()->setGridItemColumnEnd(columnEndPosition);
- return;
- }
-
- case CSSPropertyWebkitGridRowStart: {
- HANDLE_INHERIT_AND_INITIAL(gridItemRowStart, GridItemRowStart);
- GridPosition rowStartPosition;
- if (!createGridPosition(value, rowStartPosition))
- return;
- state.style()->setGridItemRowStart(rowStartPosition);
- return;
- }
- case CSSPropertyWebkitGridRowEnd: {
- HANDLE_INHERIT_AND_INITIAL(gridItemRowEnd, GridItemRowEnd);
- GridPosition rowEndPosition;
- if (!createGridPosition(value, rowEndPosition))
- return;
- state.style()->setGridItemRowEnd(rowEndPosition);
- return;
- }
- case CSSPropertyWebkitGridTemplateAreas: {
- if (isInherit) {
- state.style()->setNamedGridArea(state.parentStyle()->namedGridArea());
- state.style()->setNamedGridAreaRowCount(state.parentStyle()->namedGridAreaRowCount());
- state.style()->setNamedGridAreaColumnCount(state.parentStyle()->namedGridAreaColumnCount());
- return;
- }
- if (isInitial) {
- state.style()->setNamedGridArea(RenderStyle::initialNamedGridArea());
- state.style()->setNamedGridAreaRowCount(RenderStyle::initialNamedGridAreaCount());
- state.style()->setNamedGridAreaColumnCount(RenderStyle::initialNamedGridAreaCount());
- return;
- }
-
- if (primitiveValue) {
- ASSERT(primitiveValue->getValueID() == CSSValueNone);
- return;
- }
-
- CSSGridTemplateAreasValue& gridTemplateAreasValue = downcast<CSSGridTemplateAreasValue>(*value);
- const NamedGridAreaMap& newNamedGridAreas = gridTemplateAreasValue.gridAreaMap();
-
- NamedGridLinesMap namedGridColumnLines = state.style()->namedGridColumnLines();
- NamedGridLinesMap namedGridRowLines = state.style()->namedGridRowLines();
- createImplicitNamedGridLinesFromGridArea(newNamedGridAreas, namedGridColumnLines, ForColumns);
- createImplicitNamedGridLinesFromGridArea(newNamedGridAreas, namedGridRowLines, ForRows);
- state.style()->setNamedGridColumnLines(namedGridColumnLines);
- state.style()->setNamedGridRowLines(namedGridRowLines);
-
- state.style()->setNamedGridArea(gridTemplateAreasValue.gridAreaMap());
- state.style()->setNamedGridAreaRowCount(gridTemplateAreasValue.rowCount());
- state.style()->setNamedGridAreaColumnCount(gridTemplateAreasValue.columnCount());
- return;
- }
- case CSSPropertyWebkitGridAutoFlow: {
- HANDLE_INHERIT_AND_INITIAL(gridAutoFlow, GridAutoFlow);
- if (!is<CSSValueList>(*value))
- return;
- CSSValueList& list = downcast<CSSValueList>(*value);
-
- if (!list.length()) {
- state.style()->setGridAutoFlow(RenderStyle::initialGridAutoFlow());
- return;
- }
-
- CSSPrimitiveValue& first = downcast<CSSPrimitiveValue>(*list.item(0));
- CSSPrimitiveValue* second = list.length() == 2 ? downcast<CSSPrimitiveValue>(list.item(1)) : nullptr;
-
- GridAutoFlow autoFlow = RenderStyle::initialGridAutoFlow();
- switch (first.getValueID()) {
- case CSSValueRow:
- if (second && second->getValueID() == CSSValueDense)
- autoFlow = AutoFlowRowDense;
- else
- autoFlow = AutoFlowRow;
- break;
- case CSSValueColumn:
- if (second && second->getValueID() == CSSValueDense)
- autoFlow = AutoFlowColumnDense;
- else
- autoFlow = AutoFlowColumn;
- break;
- default:
- ASSERT_NOT_REACHED();
- break;
- }
-
- state.style()->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 => 1, # Defined in Source/WebCore/css/StyleBuilderConverter.h
</span><span class="cx"> AutoFunctions => 1,
</span><ins>+ ConditionalConverter => 1,
</ins><span class="cx"> Converter => 1,
</span><span class="cx"> Custom => 1,
</span><span class="cx"> FillLayerProperty => 1,
</span><span class="lines">@@ -772,6 +773,9 @@
</span><span class="cx"> my $convertedValue;
</span><span class="cx"> if (exists($propertiesWithStyleBuilderOptions{$name}{"Converter"})) {
</span><span class="cx"> $convertedValue = "StyleBuilderConverter::convert" . $propertiesWithStyleBuilderOptions{$name}{"Converter"} . "(styleResolver, value)";
</span><ins>+ } elsif (exists($propertiesWithStyleBuilderOptions{$name}{"ConditionalConverter"})) {
+ $setterContent .= $indent . " " . $propertiesWithStyleBuilderOptions{$name}{"TypeName"} . " convertedValue;\n";
+ $convertedValue = "convertedValue";
</ins><span class="cx"> } else {
</span><span class="cx"> $convertedValue = "static_cast<" . $propertiesWithStyleBuilderOptions{$name}{"TypeName"} . ">(downcast<CSSPrimitiveValue>(value))";
</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 . "->" . $setter;
</span><ins>+ if (exists($propertiesWithStyleBuilderOptions{$name}{"ConditionalConverter"})) {
+ $setterContent .= $indent . " if (StyleBuilderConverter::convert" . $propertiesWithStyleBuilderOptions{$name}{"ConditionalConverter"} . "(styleResolver, value, " . $convertedValue . "))\n";
+ $setterContent .= " ";
+ }
</ins><span class="cx"> $setterContent .= $indent . " " . $setValue . "(" . $convertedValue . ");\n";
</span><span class="cx"> }
</span><span class="cx"> $setterContent .= $indent . "}\n";
</span></span></pre>
</div>
</div>
</body>
</html>