Move "Number" CSS properties to the new StyleBuilder
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Oct 2014 19:12:37 +0000 (19:12 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Oct 2014 19:12:37 +0000 (19:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=138125

Reviewed by Antti Koivisto.

Move "Number" CSS properties from DeprecatedStyleBuilder to the new
StyleBuilder:
-webkit-hyphenate-limit-after
-webkit-hyphenate-limit-before
-webkit-shape-image-threshold
-webkit-hyphenate-limit-lines

They are now generated from CSSPropertyNames.in

For -webkit-hyphenate-limit-lines, I used custom code instead of
the Number converter as it required special handling for the id
value. This patch thus adds support for [Custom=Value] to
CSSPropertyNames.in and the custom code goes into
css/StyleBuilderCustom.h.

No new tests, no behavior change.

* WebCore.xcodeproj/project.pbxproj:
* css/CSSPropertyNames.in:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
(WebCore::ApplyPropertyNumber::setValue): Deleted.
(WebCore::ApplyPropertyNumber::applyValue): Deleted.
(WebCore::ApplyPropertyNumber::createHandler): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertNumber):
* css/StyleBuilderCustom.h: Added.
(WebCore::StyleBuilderFunctions::applyValueWebkitHyphenateLimitLines):
* css/makeprop.pl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175267 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/DeprecatedStyleBuilder.cpp
Source/WebCore/css/StyleBuilderConverter.h
Source/WebCore/css/StyleBuilderCustom.h [new file with mode: 0644]
Source/WebCore/css/makeprop.pl

index 1000c22..87301f5 100644 (file)
@@ -1,3 +1,40 @@
+2014-10-28  Chris Dumez  <cdumez@apple.com>
+
+        Move "Number" CSS properties to the new StyleBuilder
+        https://bugs.webkit.org/show_bug.cgi?id=138125
+
+        Reviewed by Antti Koivisto.
+
+        Move "Number" CSS properties from DeprecatedStyleBuilder to the new
+        StyleBuilder:
+        -webkit-hyphenate-limit-after
+        -webkit-hyphenate-limit-before
+        -webkit-shape-image-threshold
+        -webkit-hyphenate-limit-lines
+
+        They are now generated from CSSPropertyNames.in
+
+        For -webkit-hyphenate-limit-lines, I used custom code instead of
+        the Number converter as it required special handling for the id
+        value. This patch thus adds support for [Custom=Value] to
+        CSSPropertyNames.in and the custom code goes into
+        css/StyleBuilderCustom.h.
+
+        No new tests, no behavior change.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSPropertyNames.in:
+        * css/DeprecatedStyleBuilder.cpp:
+        (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
+        (WebCore::ApplyPropertyNumber::setValue): Deleted.
+        (WebCore::ApplyPropertyNumber::applyValue): Deleted.
+        (WebCore::ApplyPropertyNumber::createHandler): Deleted.
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertNumber):
+        * css/StyleBuilderCustom.h: Added.
+        (WebCore::StyleBuilderFunctions::applyValueWebkitHyphenateLimitLines):
+        * css/makeprop.pl:
+
 2014-10-28  Zan Dobersek  <zdobersek@igalia.com>
 
         [WebCore] Remove uses of WTF::bind() in the Media Stream module
index d1ec37b..9fc5f7b 100644 (file)
                82E3D8DF122EA0D1003AE5BC /* CSSPropertySourceData.h in Headers */ = {isa = PBXBuildFile; fileRef = 82E3D8DD122EA0D1003AE5BC /* CSSPropertySourceData.h */; settings = {ATTRIBUTES = (Private, ); }; };
                832B843419D8E55100B26055 /* SVGAnimateElementBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 832B843319D8E55100B26055 /* SVGAnimateElementBase.h */; };
                832B843619D8E57400B26055 /* SVGAnimateElementBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 832B843519D8E57400B26055 /* SVGAnimateElementBase.cpp */; };
+               835D363719FF6193004C93AB /* StyleBuilderCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 835D363619FF6193004C93AB /* StyleBuilderCustom.h */; };
                836FBCEA178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */; };
                836FBCEC178C117F00B21A15 /* SVGAnimatedProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 836FBCEB178C117F00B21A15 /* SVGAnimatedProperty.cpp */; };
                8386A96D19F61B2E00E1EC4A /* StyleBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8386A96C19F61B2E00E1EC4A /* StyleBuilder.h */; };
                82E3D8DD122EA0D1003AE5BC /* CSSPropertySourceData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPropertySourceData.h; sourceTree = "<group>"; };
                832B843319D8E55100B26055 /* SVGAnimateElementBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimateElementBase.h; sourceTree = "<group>"; };
                832B843519D8E57400B26055 /* SVGAnimateElementBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimateElementBase.cpp; sourceTree = "<group>"; };
+               835D363619FF6193004C93AB /* StyleBuilderCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleBuilderCustom.h; sourceTree = "<group>"; };
                836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedTypeAnimator.cpp; sourceTree = "<group>"; };
                836FBCEB178C117F00B21A15 /* SVGAnimatedProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedProperty.cpp; sourceTree = "<group>"; };
                8386A96C19F61B2E00E1EC4A /* StyleBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleBuilder.h; sourceTree = "<group>"; };
                                536D5A26193F410B00CE4CAB /* SourceSizeList.h */,
                                8386A96C19F61B2E00E1EC4A /* StyleBuilder.h */,
                                83B9687919F8AB83004EF7AF /* StyleBuilderConverter.h */,
+                               835D363619FF6193004C93AB /* StyleBuilderCustom.h */,
                                E47A97CE163059FC005DCD99 /* StyleInvalidationAnalysis.cpp */,
                                E47A97CF163059FC005DCD99 /* StyleInvalidationAnalysis.h */,
                                0FF5026E102BA9660066F39A /* StyleMedia.cpp */,
                                FD31601A12B0267600C1A359 /* PannerNode.h in Headers */,
                                447958041643B49A001E0A7F /* ParsedContentType.h in Headers */,
                                BC76AC130DD7AD5C00415F34 /* ParserUtilities.h in Headers */,
+                               835D363719FF6193004C93AB /* StyleBuilderCustom.h in Headers */,
                                F55B3DCA1251F12D003EF269 /* PasswordInputType.h in Headers */,
                                4B2708C70AF19EE40065127F /* Pasteboard.h in Headers */,
                                C598905714E9C28000E8D18B /* PasteboardStrategy.h in Headers */,
index 4bd8fd8..e90f111 100644 (file)
@@ -7,6 +7,48 @@
 // Microsoft extensions are documented here:
 // http://msdn.microsoft.com/workshop/author/css/reference/attributes.asp
 // 
+// StyleBuilder options:
+// * NewStyleBuilder:
+// Indicates to makeprop.pl that this property should be generated
+// in the new StyleBuilder.cpp. This option is temporary until all
+// CSS properties are generated.
+//
+// * TypeName:
+// Overrides the type of the setter method argument on RenderStyle. By
+// default, 'E' + PropertyId is used (e.g. EBorderCollapse). This option
+// is not needed if the "Converter" option is used.
+//
+// * Initial:
+// Overrides the method name on RenderStyle to get the initial value for
+// the property. By default, initial' + PropertyId is used (e.g.
+// initialBorderCollapse()).
+//
+// * Getter:
+// Overrides the method name on RenderStyle to get the current value for
+// the property. By default, the PropertyId with first letter lowercased
+// is used (e.g. borderCollapse()).
+//
+// * Setter:
+// Overrides the method name on RenderStyle to set the current value for
+// the property. By default, 'set' + PropertyId is used (e.g.
+// setBorderCollapse()).
+//
+// * NameForMethods:
+// Overrides the Getter / Setter / Initial method names on RenderStyle.
+// For e.g. "NameForMethods=OverflowWrap" will use
+// "overflowWrap() / setOverflowWrap() / initialOverflowWrap()".
+//
+// * Converter=XXX:
+// If converting the input CSSValue into the setter method argument type
+// is not trivial (i.e. casting to TypeName does not suffice), then you
+// can indicate that a Converter helper function in
+// css/StyleBuilderConverter.h should be used.
+//
+// * Custom=Value:
+// This option is used to indicate that the CSS property requires special
+// handling to set its value, and a regular Converter helper cannot be
+// used. The Custom code for the property should be located in
+// css/StyleBuilderCustom.h and named applyValue[CSSPropertyName]().
 
 
 // high-priority property names have to be listed first, to simplify the check
@@ -335,9 +377,9 @@ justify-content [NewStyleBuilder]
 -webkit-grid-auto-flow
 #endif
 -webkit-hyphenate-character [Inherited]
--webkit-hyphenate-limit-after [Inherited]
--webkit-hyphenate-limit-before [Inherited]
--webkit-hyphenate-limit-lines [Inherited]
+-webkit-hyphenate-limit-after [Inherited, NewStyleBuilder, NameForMethods=HyphenationLimitAfter, Converter=Number<short>]
+-webkit-hyphenate-limit-before [Inherited, NewStyleBuilder, NameForMethods=HyphenationLimitBefore, Converter=Number<short>]
+-webkit-hyphenate-limit-lines [Inherited, NewStyleBuilder, NameForMethods=HyphenationLimitLines, Custom=Value]
 -webkit-hyphens [Inherited, NewStyleBuilder, TypeName=Hyphens]
 -epub-hyphens = -webkit-hyphens
 -webkit-initial-letter
@@ -461,7 +503,7 @@ text-emphasis-style = -webkit-text-emphasis-style
 #if defined(ENABLE_CSS_SHAPES) && ENABLE_CSS_SHAPES
 -webkit-shape-outside
 -webkit-shape-margin [NewStyleBuilder, Converter=Length]
--webkit-shape-image-threshold
+-webkit-shape-image-threshold [NewStyleBuilder, Converter=Number<float>]
 #endif
 #if defined(ENABLE_CSS_DEVICE_ADAPTATION) && ENABLE_CSS_DEVICE_ADAPTATION
 max-zoom
index c42039d..3ba4b8d 100644 (file)
@@ -160,28 +160,6 @@ public:
     }
 };
 
-template <typename NumberType, NumberType (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(NumberType), NumberType (*initialFunction)(), int idMapsToMinusOne = CSSValueAuto>
-class ApplyPropertyNumber {
-public:
-    static void setValue(RenderStyle* style, NumberType value) { (style->*setterFunction)(value); }
-    static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
-    {
-        if (!is<CSSPrimitiveValue>(*value))
-            return;
-
-        CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
-        if (primitiveValue.getValueID() == idMapsToMinusOne)
-            setValue(styleResolver->style(), -1);
-        else
-            setValue(styleResolver->style(), primitiveValue.getValue<NumberType>(CSSPrimitiveValue::CSS_NUMBER));
-    }
-    static PropertyHandler createHandler()
-    {
-        PropertyHandler handler = ApplyPropertyDefaultBase<NumberType, getterFunction, NumberType, setterFunction, NumberType, initialFunction>::createHandler();
-        return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
-    }
-};
-
 template <StyleImage* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<StyleImage>), StyleImage* (*initialFunction)(), CSSPropertyID property>
 class ApplyPropertyStyleImage {
 public:
@@ -2301,9 +2279,6 @@ DeprecatedStyleBuilder::DeprecatedStyleBuilder()
     setPropertyHandler(CSSPropertyWebkitFontSmoothing, ApplyPropertyFont<FontSmoothingMode, &FontDescription::fontSmoothing, &FontDescription::setFontSmoothing, AutoSmoothing>::createHandler());
     setPropertyHandler(CSSPropertyWebkitFontVariantLigatures, ApplyPropertyFontVariantLigatures::createHandler());
     setPropertyHandler(CSSPropertyWebkitHyphenateCharacter, ApplyPropertyString<MapAutoToNull, &RenderStyle::hyphenationString, &RenderStyle::setHyphenationString, &RenderStyle::initialHyphenationString>::createHandler());
-    setPropertyHandler(CSSPropertyWebkitHyphenateLimitAfter, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitAfter, &RenderStyle::setHyphenationLimitAfter, &RenderStyle::initialHyphenationLimitAfter>::createHandler());
-    setPropertyHandler(CSSPropertyWebkitHyphenateLimitBefore, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitBefore, &RenderStyle::setHyphenationLimitBefore, &RenderStyle::initialHyphenationLimitBefore>::createHandler());
-    setPropertyHandler(CSSPropertyWebkitHyphenateLimitLines, ApplyPropertyNumber<short, &RenderStyle::hyphenationLimitLines, &RenderStyle::setHyphenationLimitLines, &RenderStyle::initialHyphenationLimitLines, CSSValueNoLimit>::createHandler());
     setPropertyHandler(CSSPropertyWebkitLineGrid, ApplyPropertyString<MapNoneToNull, &RenderStyle::lineGrid, &RenderStyle::setLineGrid, &RenderStyle::initialLineGrid>::createHandler());
     setPropertyHandler(CSSPropertyWebkitMarqueeIncrement, ApplyPropertyMarqueeIncrement::createHandler());
     setPropertyHandler(CSSPropertyWebkitMarqueeRepetition, ApplyPropertyMarqueeRepetition::createHandler());
@@ -2336,7 +2311,6 @@ DeprecatedStyleBuilder::DeprecatedStyleBuilder()
     setPropertyHandler(CSSPropertyWebkitTransitionTimingFunction, ApplyPropertyAnimation<const PassRefPtr<TimingFunction>, &Animation::timingFunction, &Animation::setTimingFunction, &Animation::isTimingFunctionSet, &Animation::clearTimingFunction, &Animation::initialAnimationTimingFunction, &CSSToStyleMap::mapAnimationTimingFunction, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
     setPropertyHandler(CSSPropertyWebkitClipPath, ApplyPropertyClipPath<&RenderStyle::clipPath, &RenderStyle::setClipPath, &RenderStyle::initialClipPath>::createHandler());
 #if ENABLE(CSS_SHAPES)
-    setPropertyHandler(CSSPropertyWebkitShapeImageThreshold, ApplyPropertyNumber<float, &RenderStyle::shapeImageThreshold, &RenderStyle::setShapeImageThreshold, &RenderStyle::initialShapeImageThreshold>::createHandler());
     setPropertyHandler(CSSPropertyWebkitShapeOutside, ApplyPropertyShape<&RenderStyle::shapeOutside, &RenderStyle::setShapeOutside, &RenderStyle::initialShapeOutside>::createHandler());
 #endif
     setPropertyHandler(CSSPropertyWidows, ApplyPropertyAuto<short, &RenderStyle::widows, &RenderStyle::setWidows, &RenderStyle::hasAutoWidows, &RenderStyle::setHasAutoWidows>::createHandler());
index 3f32e5a..d405f78 100644 (file)
@@ -46,6 +46,7 @@ public:
     static float convertSpacing(StyleResolver&, CSSValue&);
     static LengthSize convertRadius(StyleResolver&, CSSValue&);
     static TextDecoration convertTextDecoration(StyleResolver&, CSSValue&);
+    template <typename T> static T convertNumber(StyleResolver&, CSSValue&);
 
 private:
     static Length convertToRadiusLength(CSSToLengthConversionData&, CSSPrimitiveValue&);
@@ -196,6 +197,15 @@ inline TextDecoration StyleBuilderConverter::convertTextDecoration(StyleResolver
     return result;
 }
 
+template <typename T>
+inline T StyleBuilderConverter::convertNumber(StyleResolver&, CSSValue& value)
+{
+    auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
+    if (primitiveValue.getValueID() == CSSValueAuto)
+        return -1;
+    return primitiveValue.getValue<T>(CSSPrimitiveValue::CSS_NUMBER);
+}
+
 } // namespace WebCore
 
 #endif // StyleBuilderConverter_h
diff --git a/Source/WebCore/css/StyleBuilderCustom.h b/Source/WebCore/css/StyleBuilderCustom.h
new file mode 100644 (file)
index 0000000..0dea928
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef StyleBuilderCustom_h
+#define StyleBuilderCustom_h
+
+#include "StyleResolver.h"
+
+namespace WebCore {
+
+namespace StyleBuilderFunctions {
+
+inline void applyValueWebkitHyphenateLimitLines(StyleResolver& styleResolver, CSSValue& value)
+{
+    auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
+    short number = -1;
+    if (primitiveValue.getValueID() != CSSValueNoLimit)
+        number = primitiveValue.getValue<short>(CSSPrimitiveValue::CSS_NUMBER);
+    styleResolver.style()->setHyphenationLimitLines(number);
+}
+
+} // namespace StyleBuilderFunctions
+
+} // namespace Value
+
+#endif // StyleBuilderCustom_h
index 1063288..90de4ad 100755 (executable)
@@ -46,6 +46,7 @@ my %nameIsInherited;
 my %propertiesUsingNewStyleBuilder;
 my %newStyleBuilderOptions = (
   Converter => 1, # Defined in Source/WebCore/css/StyleBuilderConverter.h
+  Custom => 1,
   Getter => 1,
   Initial => 1,
   NameForMethods => 1,
@@ -350,6 +351,9 @@ foreach my $name (@names) {
   if (!exists($propertiesUsingNewStyleBuilder{$name}{"Initial"})) {
     $propertiesUsingNewStyleBuilder{$name}{"Initial"} = "initial" . $nameForMethods;
   }
+  if (!exists($propertiesUsingNewStyleBuilder{$name}{"Custom"})) {
+    $propertiesUsingNewStyleBuilder{$name}{"Custom"} = "None";
+  }
 }
 
 open STYLEBUILDER, ">StyleBuilder.cpp" || die "Could not open StyleBuilder.cpp for writing";
@@ -363,12 +367,12 @@ print STYLEBUILDER << "EOF";
 #include "CSSProperty.h"
 #include "RenderStyle.h"
 #include "StyleBuilderConverter.h"
+#include "StyleBuilderCustom.h"
 #include "StyleResolver.h"
 
 namespace WebCore {
 
-class StyleBuilderFunctions {
-public:
+namespace StyleBuilderFunctions {
 EOF
 
 foreach my $name (@names) {
@@ -376,28 +380,30 @@ foreach my $name (@names) {
   next unless exists($propertiesUsingNewStyleBuilder{$name});
 
   my $setValue = "styleResolver.style()->" . $propertiesUsingNewStyleBuilder{$name}{"Setter"};
-  print STYLEBUILDER "    static void applyInitial" . $nameToId{$name} . "(StyleResolver& styleResolver)\n";
+  print STYLEBUILDER "    inline void applyInitial" . $nameToId{$name} . "(StyleResolver& styleResolver)\n";
   print STYLEBUILDER "    {\n";
   print STYLEBUILDER "        " . $setValue . "(RenderStyle::" . $propertiesUsingNewStyleBuilder{$name}{"Initial"} . "());\n";
   print STYLEBUILDER "    }\n";
-  print STYLEBUILDER "    static void applyInherit" . $nameToId{$name} . "(StyleResolver& styleResolver)\n";
+  print STYLEBUILDER "    inline void applyInherit" . $nameToId{$name} . "(StyleResolver& styleResolver)\n";
   print STYLEBUILDER "    {\n";
   print STYLEBUILDER "        " . $setValue . "(styleResolver.parentStyle()->" .  $propertiesUsingNewStyleBuilder{$name}{"Getter"} . "());\n";
   print STYLEBUILDER "    }\n";
-  print STYLEBUILDER "    static void applyValue" . $nameToId{$name} . "(StyleResolver& styleResolver, CSSValue& value)\n";
-  print STYLEBUILDER "    {\n";
-  my $convertedValue;
-  if (exists($propertiesUsingNewStyleBuilder{$name}{"Converter"})) {
-    $convertedValue = "StyleBuilderConverter::convert" . $propertiesUsingNewStyleBuilder{$name}{"Converter"} . "(styleResolver, value)";
-  } else {
-    $convertedValue = "static_cast<" . $propertiesUsingNewStyleBuilder{$name}{"TypeName"} . ">(downcast<CSSPrimitiveValue>(value))";
+  if ($propertiesUsingNewStyleBuilder{$name}{"Custom"} ne "Value") {
+    print STYLEBUILDER "    inline void applyValue" . $nameToId{$name} . "(StyleResolver& styleResolver, CSSValue& value)\n";
+    print STYLEBUILDER "    {\n";
+    my $convertedValue;
+    if (exists($propertiesUsingNewStyleBuilder{$name}{"Converter"})) {
+      $convertedValue = "StyleBuilderConverter::convert" . $propertiesUsingNewStyleBuilder{$name}{"Converter"} . "(styleResolver, value)";
+    } else {
+      $convertedValue = "static_cast<" . $propertiesUsingNewStyleBuilder{$name}{"TypeName"} . ">(downcast<CSSPrimitiveValue>(value))";
+    }
+    print STYLEBUILDER "        " . $setValue . "(" . $convertedValue . ");\n";
+    print STYLEBUILDER "    }\n";
   }
-  print STYLEBUILDER "        " . $setValue . "(" . $convertedValue . ");\n";
-  print STYLEBUILDER "    }\n";
 }
 
 print STYLEBUILDER << "EOF";
-};
+} // namespace StyleBuilderFunctions
 
 bool StyleBuilder::applyProperty(CSSPropertyID property, StyleResolver& styleResolver, CSSValue& value, bool isInitial, bool isInherit)
 {