<!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>[177630] 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/177630">177630</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-12-22 02:38:57 -0800 (Mon, 22 Dec 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Move "Auto" CSS properties to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=139858
Reviewed by Antti Koivisto.
Move "Auto" CSS properties from DeprecatedStyleBuilder to the new
StyleBuilder, by adding support in the generator for using hasAutoXXX()
/ setHasAutoXXX() methods on RenderStyle.
No new tests, no web-exposed behavior change.
* css/CSSPropertyNames.in:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
(WebCore::ApplyPropertyAuto::setValue): Deleted.
(WebCore::ApplyPropertyAuto::value): Deleted.
(WebCore::ApplyPropertyAuto::hasAuto): Deleted.
(WebCore::ApplyPropertyAuto::setAuto): Deleted.
(WebCore::ApplyPropertyAuto::applyInheritValue): Deleted.
(WebCore::ApplyPropertyAuto::applyInitialValue): Deleted.
(WebCore::ApplyPropertyAuto::applyValue): Deleted.
(WebCore::ApplyPropertyAuto::createHandler): Deleted.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialColumnGap):
(WebCore::StyleBuilderCustom::applyInheritColumnGap):
(WebCore::StyleBuilderCustom::applyValueColumnGap):
* css/makeprop.pl:
(getNameForMethods):
(getAutoGetter):
(getAutoSetter):
(generateInitialValueSetter):
(generateInheritValueSetter):
(generateValueSetter):</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="#trunkSourceWebCorecssDeprecatedStyleBuildercpp">trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderCustomh">trunk/Source/WebCore/css/StyleBuilderCustom.h</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 (177629 => 177630)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-12-22 02:00:04 UTC (rev 177629)
+++ trunk/Source/WebCore/ChangeLog        2014-12-22 10:38:57 UTC (rev 177630)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2014-12-22 Chris Dumez <cdumez@apple.com>
+
+ Move "Auto" CSS properties to the new StyleBuilder
+ https://bugs.webkit.org/show_bug.cgi?id=139858
+
+ Reviewed by Antti Koivisto.
+
+ Move "Auto" CSS properties from DeprecatedStyleBuilder to the new
+ StyleBuilder, by adding support in the generator for using hasAutoXXX()
+ / setHasAutoXXX() methods on RenderStyle.
+
+ No new tests, no web-exposed behavior change.
+
+ * css/CSSPropertyNames.in:
+ * css/DeprecatedStyleBuilder.cpp:
+ (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
+ (WebCore::ApplyPropertyAuto::setValue): Deleted.
+ (WebCore::ApplyPropertyAuto::value): Deleted.
+ (WebCore::ApplyPropertyAuto::hasAuto): Deleted.
+ (WebCore::ApplyPropertyAuto::setAuto): Deleted.
+ (WebCore::ApplyPropertyAuto::applyInheritValue): Deleted.
+ (WebCore::ApplyPropertyAuto::applyInitialValue): Deleted.
+ (WebCore::ApplyPropertyAuto::applyValue): Deleted.
+ (WebCore::ApplyPropertyAuto::createHandler): Deleted.
+ * css/StyleBuilderCustom.h:
+ (WebCore::StyleBuilderCustom::applyInitialColumnGap):
+ (WebCore::StyleBuilderCustom::applyInheritColumnGap):
+ (WebCore::StyleBuilderCustom::applyValueColumnGap):
+ * css/makeprop.pl:
+ (getNameForMethods):
+ (getAutoGetter):
+ (getAutoSetter):
+ (generateInitialValueSetter):
+ (generateInheritValueSetter):
+ (generateValueSetter):
+
</ins><span class="cx"> 2014-12-21 Shivakumar JM <shiva.jm@samsung.com>
</span><span class="cx">
</span><span class="cx"> HTMLSelectElement add() should support adding group of options element (HTMLOptGroupElement).
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (177629 => 177630)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPropertyNames.in        2014-12-22 02:00:04 UTC (rev 177629)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in        2014-12-22 10:38:57 UTC (rev 177630)
</span><span class="lines">@@ -56,6 +56,10 @@
</span><span class="cx"> // If special handling is also needed to apply inherit or initial value, use
</span><span class="cx"> // Custom=All. Alternatively, several '|'-separated options can be passed:
</span><span class="cx"> // e.g. 'Custom=Inherit|Value".
</span><ins>+//
+// * AutoFunctions:
+// Indicates that this CSS property requires handling of "auto" and has
+// corresponding hasAutoXXX() / setHasAutoXXX() methods on RenderStyle.
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> // high-priority property names have to be listed first, to simplify the check
</span><span class="lines">@@ -203,7 +207,7 @@
</span><span class="cx"> // Honor -webkit-opacity as a synonym for opacity. This was the only syntax that worked in Safari 1.1,
</span><span class="cx"> // and may be in use on some websites and widgets.
</span><span class="cx"> -webkit-opacity = opacity
</span><del>-orphans [Inherited, LegacyStyleBuilder]
</del><ins>+orphans [Inherited, TypeName=short, AutoFunctions]
</ins><span class="cx"> outline [LegacyStyleBuilder]
</span><span class="cx"> outline-color [LegacyStyleBuilder]
</span><span class="cx"> outline-offset [Converter=ComputedLength<int>]
</span><span class="lines">@@ -267,13 +271,13 @@
</span><span class="cx"> vertical-align [Custom=Value]
</span><span class="cx"> visibility [Inherited]
</span><span class="cx"> white-space [Inherited]
</span><del>-widows [Inherited, LegacyStyleBuilder]
</del><ins>+widows [Inherited, TypeName=short, AutoFunctions]
</ins><span class="cx"> width [Initial=initialSize, Converter=LengthSizing]
</span><span class="cx"> word-break [Inherited]
</span><span class="cx"> -epub-word-break = word-break
</span><span class="cx"> word-spacing [Inherited, Custom=Value]
</span><span class="cx"> word-wrap [Inherited=EOverflowWrap, NameForMethods=OverflowWrap]
</span><del>-z-index [LegacyStyleBuilder]
</del><ins>+z-index [TypeName=int, AutoFunctions]
</ins><span class="cx"> alt [LegacyStyleBuilder]
</span><span class="cx"> -webkit-alt = alt
</span><span class="cx"> -webkit-animation [LegacyStyleBuilder]
</span><span class="lines">@@ -337,11 +341,11 @@
</span><span class="cx"> -webkit-column-break-after [TypeName=EPageBreak, Initial=initialPageBreak]
</span><span class="cx"> -webkit-column-break-before [TypeName=EPageBreak, Initial=initialPageBreak]
</span><span class="cx"> -webkit-column-break-inside [TypeName=EPageBreak, Initial=initialPageBreak]
</span><del>-column-count [LegacyStyleBuilder]
</del><ins>+column-count [TypeName=unsigned short, AutoFunctions]
</ins><span class="cx"> -webkit-column-count = column-count
</span><span class="cx"> column-fill [TypeName=ColumnFill]
</span><span class="cx"> -webkit-column-fill = column-fill
</span><del>-column-gap [LegacyStyleBuilder]
</del><ins>+column-gap [Custom=All]
</ins><span class="cx"> -webkit-column-gap = column-gap
</span><span class="cx"> column-progression [TypeName=ColumnProgression]
</span><span class="cx"> -webkit-column-progression = column-progression
</span><span class="lines">@@ -355,7 +359,7 @@
</span><span class="cx"> -webkit-column-rule-width = column-rule-width
</span><span class="cx"> column-span [TypeName=ColumnSpan]
</span><span class="cx"> -webkit-column-span = column-span
</span><del>-column-width [LegacyStyleBuilder]
</del><ins>+column-width [TypeName=float, AutoFunctions, Converter=ComputedLength<float>]
</ins><span class="cx"> -webkit-column-width = column-width
</span><span class="cx"> columns [LegacyStyleBuilder]
</span><span class="cx"> -webkit-columns = columns
</span></span></pre></div>
<a id="trunkSourceWebCorecssDeprecatedStyleBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (177629 => 177630)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-12-22 02:00:04 UTC (rev 177629)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-12-22 10:38:57 UTC (rev 177630)
</span><span class="lines">@@ -41,42 +41,6 @@
</span><span class="cx">
</span><span class="cx"> using namespace HTMLNames;
</span><span class="cx">
</span><del>-enum AutoValueType {Number = 0, ComputeLength};
-template <typename T, T (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(T), bool (RenderStyle::*hasAutoFunction)() const, void (RenderStyle::*setAutoFunction)(), AutoValueType valueType = Number, int autoIdentity = CSSValueAuto>
-class ApplyPropertyAuto {
-public:
- static void setValue(RenderStyle* style, T value) { (style->*setterFunction)(value); }
- static T value(RenderStyle* style) { return (style->*getterFunction)(); }
- static bool hasAuto(RenderStyle* style) { return (style->*hasAutoFunction)(); }
- static void setAuto(RenderStyle* style) { (style->*setAutoFunction)(); }
-
- static void applyInheritValue(CSSPropertyID, StyleResolver* styleResolver)
- {
- if (hasAuto(styleResolver->parentStyle()))
- setAuto(styleResolver->style());
- else
- setValue(styleResolver->style(), value(styleResolver->parentStyle()));
- }
-
- static void applyInitialValue(CSSPropertyID, StyleResolver* styleResolver) { setAuto(styleResolver->style()); }
-
- static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
- {
- if (!is<CSSPrimitiveValue>(*value))
- return;
-
- CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
- if (primitiveValue.getValueID() == autoIdentity)
- setAuto(styleResolver->style());
- else if (valueType == Number)
- setValue(styleResolver->style(), primitiveValue);
- else if (valueType == ComputeLength)
- setValue(styleResolver->style(), primitiveValue.computeLength<T>(styleResolver->state().cssToLengthConversionData()));
- }
-
- static PropertyHandler createHandler() { return PropertyHandler(&applyInheritValue, &applyInitialValue, &applyValue); }
-};
-
</del><span class="cx"> enum ColorInherit {NoInheritFromParent = 0, InheritFromParent};
</span><span class="cx"> Color defaultInitialColor();
</span><span class="cx"> Color defaultInitialColor() { return Color(); }
</span><span class="lines">@@ -586,7 +550,6 @@
</span><span class="cx"> setPropertyHandler(CSSPropertyFontSize, ApplyPropertyFontSize::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyFontStyle, ApplyPropertyFont<FontItalic, &FontDescription::italic, &FontDescription::setItalic, FontItalicOff>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyFontVariant, ApplyPropertyFont<FontSmallCaps, &FontDescription::smallCaps, &FontDescription::setSmallCaps, FontSmallCapsOff>::createHandler());
</span><del>- setPropertyHandler(CSSPropertyOrphans, ApplyPropertyAuto<short, &RenderStyle::orphans, &RenderStyle::setOrphans, &RenderStyle::hasAutoOrphans, &RenderStyle::setHasAutoOrphans>::createHandler());
</del><span class="cx"> setPropertyHandler(CSSPropertyOutlineColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::setVisitedLinkOutlineColor, &RenderStyle::color>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitTextDecorationColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textDecorationColor, &RenderStyle::setTextDecorationColor, &RenderStyle::setVisitedLinkTextDecorationColor, &RenderStyle::color>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
</span><span class="lines">@@ -612,10 +575,7 @@
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitBackgroundComposite, ApplyPropertyFillLayer<CompositeOperator, CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &RenderStyle::accessBackgroundLayers, &RenderStyle::backgroundLayers, &FillLayer::isCompositeSet, &FillLayer::composite, &FillLayer::setComposite, &FillLayer::clearComposite, &FillLayer::initialFillComposite, &CSSToStyleMap::mapFillComposite>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin);
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize);
</span><del>- setPropertyHandler(CSSPropertyColumnCount, ApplyPropertyAuto<unsigned short, &RenderStyle::columnCount, &RenderStyle::setColumnCount, &RenderStyle::hasAutoColumnCount, &RenderStyle::setHasAutoColumnCount>::createHandler());
- setPropertyHandler(CSSPropertyColumnGap, ApplyPropertyAuto<float, &RenderStyle::columnGap, &RenderStyle::setColumnGap, &RenderStyle::hasNormalColumnGap, &RenderStyle::setHasNormalColumnGap, ComputeLength, CSSValueNormal>::createHandler());
</del><span class="cx"> setPropertyHandler(CSSPropertyColumnRuleColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle::setVisitedLinkColumnRuleColor, &RenderStyle::color>::createHandler());
</span><del>- setPropertyHandler(CSSPropertyColumnWidth, ApplyPropertyAuto<float, &RenderStyle::columnWidth, &RenderStyle::setColumnWidth, &RenderStyle::hasAutoColumnWidth, &RenderStyle::setHasAutoColumnWidth, ComputeLength>::createHandler());
</del><span class="cx"> setPropertyHandler(CSSPropertyWebkitFontKerning, ApplyPropertyFont<FontDescription::Kerning, &FontDescription::kerning, &FontDescription::setKerning, FontDescription::AutoKerning>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitFontSmoothing, ApplyPropertyFont<FontSmoothingMode, &FontDescription::fontSmoothing, &FontDescription::setFontSmoothing, AutoSmoothing>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitFontVariantLigatures, ApplyPropertyFontVariantLigatures::createHandler());
</span><span class="lines">@@ -635,10 +595,6 @@
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitTransitionDuration, ApplyPropertyAnimation<double, &Animation::duration, &Animation::setDuration, &Animation::isDurationSet, &Animation::clearDuration, &Animation::initialAnimationDuration, &CSSToStyleMap::mapAnimationDuration, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitTransitionProperty, ApplyPropertyAnimation<CSSPropertyID, &Animation::property, &Animation::setProperty, &Animation::isPropertySet, &Animation::clearProperty, &Animation::initialAnimationProperty, &CSSToStyleMap::mapAnimationProperty, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitTransitionTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
</span><del>- setPropertyHandler(CSSPropertyWidows, ApplyPropertyAuto<short, &RenderStyle::widows, &RenderStyle::setWidows, &RenderStyle::hasAutoWidows, &RenderStyle::setHasAutoWidows>::createHandler());
-
- setPropertyHandler(CSSPropertyZIndex, ApplyPropertyAuto<int, &RenderStyle::zIndex, &RenderStyle::setZIndex, &RenderStyle::hasAutoZIndex, &RenderStyle::setHasAutoZIndex>::createHandler());
</del><span class="cx"> }
</span><span class="cx">
</span><del>-
</del><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (177629 => 177630)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderCustom.h        2014-12-22 02:00:04 UTC (rev 177629)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h        2014-12-22 10:38:57 UTC (rev 177630)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include "LocaleToScriptMapping.h"
</span><span class="cx"> #include "Rect.h"
</span><span class="cx"> #include "SVGElement.h"
</span><ins>+#include "StyleBuilderConverter.h"
</ins><span class="cx"> #include "StyleFontSizeFunctions.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="cx">
</span><span class="lines">@@ -55,6 +56,7 @@
</span><span class="cx"> DECLARE_PROPERTY_CUSTOM_HANDLERS(BorderImageWidth);
</span><span class="cx"> DECLARE_PROPERTY_CUSTOM_HANDLERS(BoxShadow);
</span><span class="cx"> DECLARE_PROPERTY_CUSTOM_HANDLERS(Clip);
</span><ins>+ DECLARE_PROPERTY_CUSTOM_HANDLERS(ColumnGap);
</ins><span class="cx"> DECLARE_PROPERTY_CUSTOM_HANDLERS(CounterIncrement);
</span><span class="cx"> DECLARE_PROPERTY_CUSTOM_HANDLERS(CounterReset);
</span><span class="cx"> DECLARE_PROPERTY_CUSTOM_HANDLERS(Cursor);
</span><span class="lines">@@ -1179,6 +1181,27 @@
</span><span class="cx"> styleResolver.setFontDescription(fontDescription);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+inline void StyleBuilderCustom::applyInitialColumnGap(StyleResolver& styleResolver)
+{
+ styleResolver.style()->setHasNormalColumnGap();
+}
+
+inline void StyleBuilderCustom::applyInheritColumnGap(StyleResolver& styleResolver)
+{
+ if (styleResolver.parentStyle()->hasNormalColumnGap())
+ styleResolver.style()->setHasNormalColumnGap();
+ else
+ styleResolver.style()->setColumnGap(styleResolver.parentStyle()->columnGap());
+}
+
+inline void StyleBuilderCustom::applyValueColumnGap(StyleResolver& styleResolver, CSSValue& value)
+{
+ if (downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNormal)
+ styleResolver.style()->setHasNormalColumnGap();
+ else
+ styleResolver.style()->setColumnGap(StyleBuilderConverter::convertComputedLength<float>(styleResolver, value));
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // StyleBuilderCustom_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssmakeproppl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/makeprop.pl (177629 => 177630)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/makeprop.pl        2014-12-22 02:00:04 UTC (rev 177629)
+++ trunk/Source/WebCore/css/makeprop.pl        2014-12-22 10:38:57 UTC (rev 177630)
</span><span class="lines">@@ -43,7 +43,8 @@
</span><span class="cx"> my %nameIsInherited;
</span><span class="cx"> my %propertiesWithStyleBuilderOptions;
</span><span class="cx"> my %styleBuilderOptions = (
</span><del>- Converter => 1, # Defined in Source/WebCore/css/StyleBuilderConverter.h
</del><ins>+ AutoFunctions => 1, # Defined in Source/WebCore/css/StyleBuilderConverter.h
+ Converter => 1,
</ins><span class="cx"> Custom => 1,
</span><span class="cx"> Getter => 1,
</span><span class="cx"> Initial => 1,
</span><span class="lines">@@ -337,11 +338,36 @@
</span><span class="cx"> return $propertiesWithStyleBuilderOptions{$name}{"Custom"}{$builderFunction} ? "StyleBuilderCustom" : "StyleBuilderFunctions";
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub getNameForMethods {
+ my $name = shift;
+
+ my $nameForMethods = $nameToId{$name};
+ $nameForMethods =~ s/Webkit//g;
+ if (exists($propertiesWithStyleBuilderOptions{$name}{"NameForMethods"})) {
+ $nameForMethods = $propertiesWithStyleBuilderOptions{$name}{"NameForMethods"};
+ }
+ return $nameForMethods;
+}
+
+sub getAutoGetter {
+ my $name = shift;
+ my $renderStyle = shift;
+
+ return $renderStyle . "->hasAuto" . getNameForMethods($name) . "()";
+}
+
+sub getAutoSetter {
+ my $name = shift;
+ my $renderStyle = shift;
+
+ return $renderStyle . "->setHasAuto" . getNameForMethods($name) . "()";
+}
+
</ins><span class="cx"> foreach my $name (@names) {
</span><span class="cx"> # Skip properties still using the legacy style builder.
</span><span class="cx"> next unless exists($propertiesWithStyleBuilderOptions{$name});
</span><span class="cx">
</span><del>- my $nameForMethods = $nameToId{$name};
</del><ins>+ my $nameForMethods = getNameForMethods($name);
</ins><span class="cx"> $nameForMethods =~ s/Webkit//g;
</span><span class="cx"> if (exists($propertiesWithStyleBuilderOptions{$name}{"NameForMethods"})) {
</span><span class="cx"> $nameForMethods = $propertiesWithStyleBuilderOptions{$name}{"NameForMethods"};
</span><span class="lines">@@ -368,6 +394,74 @@
</span><span class="cx"> $propertiesWithStyleBuilderOptions{$name}{"Custom"} = \%customValues;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+sub generateInitialValueSetter {
+ my $name = shift;
+ my $indent = shift;
+
+ my $setterContent = "";
+ $setterContent .= $indent . "inline void applyInitial" . $nameToId{$name} . "(StyleResolver& styleResolver)\n";
+ $setterContent .= $indent . "{\n";
+ my $style = "styleResolver.style()";
+ if (exists $propertiesWithStyleBuilderOptions{$name}{"AutoFunctions"}) {
+ $setterContent .= $indent . " " . getAutoSetter($name, $style) . ";\n";
+ } else {
+ my $setValue = $style . "->" . $propertiesWithStyleBuilderOptions{$name}{"Setter"};
+ $setterContent .= $indent . " " . $setValue . "(RenderStyle::" . $propertiesWithStyleBuilderOptions{$name}{"Initial"} . "());\n";
+ }
+ $setterContent .= $indent . "}\n";
+
+ return $setterContent;
+}
+
+sub generateInheritValueSetter {
+ my $name = shift;
+ my $indent = shift;
+
+ my $setterContent = "";
+ $setterContent .= $indent . "inline void applyInherit" . $nameToId{$name} . "(StyleResolver& styleResolver)\n";
+ $setterContent .= $indent . "{\n";
+ my $parentStyle = "styleResolver.parentStyle()";
+ my $style = "styleResolver.style()";
+ if (exists $propertiesWithStyleBuilderOptions{$name}{"AutoFunctions"}) {
+ $setterContent .= $indent . " if (" . getAutoGetter($name, $parentStyle) . ") {\n";
+ $setterContent .= $indent . " " . getAutoSetter($name, $style) . ";\n";
+ $setterContent .= $indent . " return;\n";
+ $setterContent .= $indent . " }\n";
+ }
+ my $setValue = $style . "->" . $propertiesWithStyleBuilderOptions{$name}{"Setter"};
+ $setterContent .= $indent . " " . $setValue . "(" . $parentStyle . "->" . $propertiesWithStyleBuilderOptions{$name}{"Getter"} . "());\n";
+ $setterContent .= $indent . "}\n";
+
+ return $setterContent;
+}
+
+sub generateValueSetter {
+ my $name = shift;
+ my $indent = shift;
+
+ my $setterContent = "";
+ $setterContent .= $indent . "inline void applyValue" . $nameToId{$name} . "(StyleResolver& styleResolver, CSSValue& value)\n";
+ $setterContent .= $indent . "{\n";
+ my $convertedValue;
+ if (exists($propertiesWithStyleBuilderOptions{$name}{"Converter"})) {
+ $convertedValue = "StyleBuilderConverter::convert" . $propertiesWithStyleBuilderOptions{$name}{"Converter"} . "(styleResolver, value)";
+ } else {
+ $convertedValue = "static_cast<" . $propertiesWithStyleBuilderOptions{$name}{"TypeName"} . ">(downcast<CSSPrimitiveValue>(value))";
+ }
+ my $style = "styleResolver.style()";
+ if (exists $propertiesWithStyleBuilderOptions{$name}{"AutoFunctions"}) {
+ $setterContent .= $indent . " if (downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueAuto) {\n";
+ $setterContent .= $indent . " ". getAutoSetter($name, $style) . ";\n";
+ $setterContent .= $indent . " return;\n";
+ $setterContent .= $indent . " }\n";
+ }
+ my $setValue = $style . "->" . $propertiesWithStyleBuilderOptions{$name}{"Setter"};
+ $setterContent .= $indent . " " . $setValue . "(" . $convertedValue . ");\n";
+ $setterContent .= $indent . "}\n";
+
+ return $setterContent;
+}
+
</ins><span class="cx"> open STYLEBUILDER, ">StyleBuilder.cpp" || die "Could not open StyleBuilder.cpp for writing";
</span><span class="cx"> print STYLEBUILDER << "EOF";
</span><span class="cx"> /* This file is automatically generated from CSSPropertyNames.in by makeprop, do not edit */
</span><span class="lines">@@ -391,30 +485,15 @@
</span><span class="cx"> # Skip properties still using the legacy style builder.
</span><span class="cx"> next unless exists($propertiesWithStyleBuilderOptions{$name});
</span><span class="cx">
</span><del>- my $setValue = "styleResolver.style()->" . $propertiesWithStyleBuilderOptions{$name}{"Setter"};
</del><ins>+ my $indent = " ";
</ins><span class="cx"> if (!$propertiesWithStyleBuilderOptions{$name}{"Custom"}{"Initial"}) {
</span><del>- print STYLEBUILDER " inline void applyInitial" . $nameToId{$name} . "(StyleResolver& styleResolver)\n";
- print STYLEBUILDER " {\n";
- print STYLEBUILDER " " . $setValue . "(RenderStyle::" . $propertiesWithStyleBuilderOptions{$name}{"Initial"} . "());\n";
- print STYLEBUILDER " }\n";
</del><ins>+ print STYLEBUILDER generateInitialValueSetter($name, $indent);
</ins><span class="cx"> }
</span><span class="cx"> if (!$propertiesWithStyleBuilderOptions{$name}{"Custom"}{"Inherit"}) {
</span><del>- print STYLEBUILDER " inline void applyInherit" . $nameToId{$name} . "(StyleResolver& styleResolver)\n";
- print STYLEBUILDER " {\n";
- print STYLEBUILDER " " . $setValue . "(styleResolver.parentStyle()->" . $propertiesWithStyleBuilderOptions{$name}{"Getter"} . "());\n";
- print STYLEBUILDER " }\n";
</del><ins>+ print STYLEBUILDER generateInheritValueSetter($name, $indent);
</ins><span class="cx"> }
</span><span class="cx"> if (!$propertiesWithStyleBuilderOptions{$name}{"Custom"}{"Value"}) {
</span><del>- print STYLEBUILDER " inline void applyValue" . $nameToId{$name} . "(StyleResolver& styleResolver, CSSValue& value)\n";
- print STYLEBUILDER " {\n";
- my $convertedValue;
- if (exists($propertiesWithStyleBuilderOptions{$name}{"Converter"})) {
- $convertedValue = "StyleBuilderConverter::convert" . $propertiesWithStyleBuilderOptions{$name}{"Converter"} . "(styleResolver, value)";
- } else {
- $convertedValue = "static_cast<" . $propertiesWithStyleBuilderOptions{$name}{"TypeName"} . ">(downcast<CSSPrimitiveValue>(value))";
- }
- print STYLEBUILDER " " . $setValue . "(" . $convertedValue . ");\n";
- print STYLEBUILDER " }\n";
</del><ins>+ print STYLEBUILDER generateValueSetter($name, $indent);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>