<!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>[175267] 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/175267">175267</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-10-28 12:12:37 -0700 (Tue, 28 Oct 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>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:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</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="#trunkSourceWebCorecssStyleBuilderConverterh">trunk/Source/WebCore/css/StyleBuilderConverter.h</a></li>
<li><a href="#trunkSourceWebCorecssmakeproppl">trunk/Source/WebCore/css/makeprop.pl</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorecssStyleBuilderCustomh">trunk/Source/WebCore/css/StyleBuilderCustom.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (175266 => 175267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-28 19:05:32 UTC (rev 175266)
+++ trunk/Source/WebCore/ChangeLog        2014-10-28 19:12:37 UTC (rev 175267)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+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:
+
</ins><span class="cx"> 2014-10-28 Zan Dobersek <zdobersek@igalia.com>
</span><span class="cx">
</span><span class="cx"> [WebCore] Remove uses of WTF::bind() in the Media Stream module
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (175266 => 175267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-28 19:05:32 UTC (rev 175266)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-10-28 19:12:37 UTC (rev 175267)
</span><span class="lines">@@ -2502,6 +2502,7 @@
</span><span class="cx">                 82E3D8DF122EA0D1003AE5BC /* CSSPropertySourceData.h in Headers */ = {isa = PBXBuildFile; fileRef = 82E3D8DD122EA0D1003AE5BC /* CSSPropertySourceData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 832B843419D8E55100B26055 /* SVGAnimateElementBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 832B843319D8E55100B26055 /* SVGAnimateElementBase.h */; };
</span><span class="cx">                 832B843619D8E57400B26055 /* SVGAnimateElementBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 832B843519D8E57400B26055 /* SVGAnimateElementBase.cpp */; };
</span><ins>+                835D363719FF6193004C93AB /* StyleBuilderCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 835D363619FF6193004C93AB /* StyleBuilderCustom.h */; };
</ins><span class="cx">                 836FBCEA178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */; };
</span><span class="cx">                 836FBCEC178C117F00B21A15 /* SVGAnimatedProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 836FBCEB178C117F00B21A15 /* SVGAnimatedProperty.cpp */; };
</span><span class="cx">                 8386A96D19F61B2E00E1EC4A /* StyleBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8386A96C19F61B2E00E1EC4A /* StyleBuilder.h */; };
</span><span class="lines">@@ -9687,6 +9688,7 @@
</span><span class="cx">                 82E3D8DD122EA0D1003AE5BC /* CSSPropertySourceData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPropertySourceData.h; sourceTree = "<group>"; };
</span><span class="cx">                 832B843319D8E55100B26055 /* SVGAnimateElementBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimateElementBase.h; sourceTree = "<group>"; };
</span><span class="cx">                 832B843519D8E57400B26055 /* SVGAnimateElementBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimateElementBase.cpp; sourceTree = "<group>"; };
</span><ins>+                835D363619FF6193004C93AB /* StyleBuilderCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleBuilderCustom.h; sourceTree = "<group>"; };
</ins><span class="cx">                 836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedTypeAnimator.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 836FBCEB178C117F00B21A15 /* SVGAnimatedProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedProperty.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 8386A96C19F61B2E00E1EC4A /* StyleBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleBuilder.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -22231,6 +22233,7 @@
</span><span class="cx">                                 536D5A26193F410B00CE4CAB /* SourceSizeList.h */,
</span><span class="cx">                                 8386A96C19F61B2E00E1EC4A /* StyleBuilder.h */,
</span><span class="cx">                                 83B9687919F8AB83004EF7AF /* StyleBuilderConverter.h */,
</span><ins>+                                835D363619FF6193004C93AB /* StyleBuilderCustom.h */,
</ins><span class="cx">                                 E47A97CE163059FC005DCD99 /* StyleInvalidationAnalysis.cpp */,
</span><span class="cx">                                 E47A97CF163059FC005DCD99 /* StyleInvalidationAnalysis.h */,
</span><span class="cx">                                 0FF5026E102BA9660066F39A /* StyleMedia.cpp */,
</span><span class="lines">@@ -25568,6 +25571,7 @@
</span><span class="cx">                                 FD31601A12B0267600C1A359 /* PannerNode.h in Headers */,
</span><span class="cx">                                 447958041643B49A001E0A7F /* ParsedContentType.h in Headers */,
</span><span class="cx">                                 BC76AC130DD7AD5C00415F34 /* ParserUtilities.h in Headers */,
</span><ins>+                                835D363719FF6193004C93AB /* StyleBuilderCustom.h in Headers */,
</ins><span class="cx">                                 F55B3DCA1251F12D003EF269 /* PasswordInputType.h in Headers */,
</span><span class="cx">                                 4B2708C70AF19EE40065127F /* Pasteboard.h in Headers */,
</span><span class="cx">                                 C598905714E9C28000E8D18B /* PasteboardStrategy.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (175266 => 175267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPropertyNames.in        2014-10-28 19:05:32 UTC (rev 175266)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in        2014-10-28 19:12:37 UTC (rev 175267)
</span><span class="lines">@@ -7,6 +7,48 @@
</span><span class="cx"> // Microsoft extensions are documented here:
</span><span class="cx"> // http://msdn.microsoft.com/workshop/author/css/reference/attributes.asp
</span><span class="cx"> //
</span><ins>+// 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]().
</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">@@ -335,9 +377,9 @@
</span><span class="cx"> -webkit-grid-auto-flow
</span><span class="cx"> #endif
</span><span class="cx"> -webkit-hyphenate-character [Inherited]
</span><del>--webkit-hyphenate-limit-after [Inherited]
--webkit-hyphenate-limit-before [Inherited]
--webkit-hyphenate-limit-lines [Inherited]
</del><ins>+-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]
</ins><span class="cx"> -webkit-hyphens [Inherited, NewStyleBuilder, TypeName=Hyphens]
</span><span class="cx"> -epub-hyphens = -webkit-hyphens
</span><span class="cx"> -webkit-initial-letter
</span><span class="lines">@@ -461,7 +503,7 @@
</span><span class="cx"> #if defined(ENABLE_CSS_SHAPES) && ENABLE_CSS_SHAPES
</span><span class="cx"> -webkit-shape-outside
</span><span class="cx"> -webkit-shape-margin [NewStyleBuilder, Converter=Length]
</span><del>--webkit-shape-image-threshold
</del><ins>+-webkit-shape-image-threshold [NewStyleBuilder, Converter=Number<float>]
</ins><span class="cx"> #endif
</span><span class="cx"> #if defined(ENABLE_CSS_DEVICE_ADAPTATION) && ENABLE_CSS_DEVICE_ADAPTATION
</span><span class="cx"> max-zoom
</span></span></pre></div>
<a id="trunkSourceWebCorecssDeprecatedStyleBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (175266 => 175267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-10-28 19:05:32 UTC (rev 175266)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-10-28 19:12:37 UTC (rev 175267)
</span><span class="lines">@@ -160,28 +160,6 @@
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><del>-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);
- }
-};
-
</del><span class="cx"> template <StyleImage* (RenderStyle::*getterFunction)() const, void (RenderStyle::*setterFunction)(PassRefPtr<StyleImage>), StyleImage* (*initialFunction)(), CSSPropertyID property>
</span><span class="cx"> class ApplyPropertyStyleImage {
</span><span class="cx"> public:
</span><span class="lines">@@ -2301,9 +2279,6 @@
</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="cx"> setPropertyHandler(CSSPropertyWebkitHyphenateCharacter, ApplyPropertyString<MapAutoToNull, &RenderStyle::hyphenationString, &RenderStyle::setHyphenationString, &RenderStyle::initialHyphenationString>::createHandler());
</span><del>- 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());
</del><span class="cx"> setPropertyHandler(CSSPropertyWebkitLineGrid, ApplyPropertyString<MapNoneToNull, &RenderStyle::lineGrid, &RenderStyle::setLineGrid, &RenderStyle::initialLineGrid>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitMarqueeIncrement, ApplyPropertyMarqueeIncrement::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitMarqueeRepetition, ApplyPropertyMarqueeRepetition::createHandler());
</span><span class="lines">@@ -2336,7 +2311,6 @@
</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><span class="cx"> setPropertyHandler(CSSPropertyWebkitClipPath, ApplyPropertyClipPath<&RenderStyle::clipPath, &RenderStyle::setClipPath, &RenderStyle::initialClipPath>::createHandler());
</span><span class="cx"> #if ENABLE(CSS_SHAPES)
</span><del>- setPropertyHandler(CSSPropertyWebkitShapeImageThreshold, ApplyPropertyNumber<float, &RenderStyle::shapeImageThreshold, &RenderStyle::setShapeImageThreshold, &RenderStyle::initialShapeImageThreshold>::createHandler());
</del><span class="cx"> setPropertyHandler(CSSPropertyWebkitShapeOutside, ApplyPropertyShape<&RenderStyle::shapeOutside, &RenderStyle::setShapeOutside, &RenderStyle::initialShapeOutside>::createHandler());
</span><span class="cx"> #endif
</span><span class="cx"> setPropertyHandler(CSSPropertyWidows, ApplyPropertyAuto<short, &RenderStyle::widows, &RenderStyle::setWidows, &RenderStyle::hasAutoWidows, &RenderStyle::setHasAutoWidows>::createHandler());
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderConverterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderConverter.h (175266 => 175267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderConverter.h        2014-10-28 19:05:32 UTC (rev 175266)
+++ trunk/Source/WebCore/css/StyleBuilderConverter.h        2014-10-28 19:12:37 UTC (rev 175267)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> static float convertSpacing(StyleResolver&, CSSValue&);
</span><span class="cx"> static LengthSize convertRadius(StyleResolver&, CSSValue&);
</span><span class="cx"> static TextDecoration convertTextDecoration(StyleResolver&, CSSValue&);
</span><ins>+ template <typename T> static T convertNumber(StyleResolver&, CSSValue&);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> static Length convertToRadiusLength(CSSToLengthConversionData&, CSSPrimitiveValue&);
</span><span class="lines">@@ -196,6 +197,15 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+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);
+}
+
</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="addfile"><h4>Added: trunk/Source/WebCore/css/StyleBuilderCustom.h (0 => 175267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderCustom.h         (rev 0)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h        2014-10-28 19:12:37 UTC (rev 175267)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * 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
</ins></span></pre></div>
<a id="trunkSourceWebCorecssmakeproppl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/makeprop.pl (175266 => 175267)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/makeprop.pl        2014-10-28 19:05:32 UTC (rev 175266)
+++ trunk/Source/WebCore/css/makeprop.pl        2014-10-28 19:12:37 UTC (rev 175267)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> my %propertiesUsingNewStyleBuilder;
</span><span class="cx"> my %newStyleBuilderOptions = (
</span><span class="cx"> Converter => 1, # Defined in Source/WebCore/css/StyleBuilderConverter.h
</span><ins>+ Custom => 1,
</ins><span class="cx"> Getter => 1,
</span><span class="cx"> Initial => 1,
</span><span class="cx"> NameForMethods => 1,
</span><span class="lines">@@ -350,6 +351,9 @@
</span><span class="cx"> if (!exists($propertiesUsingNewStyleBuilder{$name}{"Initial"})) {
</span><span class="cx"> $propertiesUsingNewStyleBuilder{$name}{"Initial"} = "initial" . $nameForMethods;
</span><span class="cx"> }
</span><ins>+ if (!exists($propertiesUsingNewStyleBuilder{$name}{"Custom"})) {
+ $propertiesUsingNewStyleBuilder{$name}{"Custom"} = "None";
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> open STYLEBUILDER, ">StyleBuilder.cpp" || die "Could not open StyleBuilder.cpp for writing";
</span><span class="lines">@@ -363,12 +367,12 @@
</span><span class="cx"> #include "CSSProperty.h"
</span><span class="cx"> #include "RenderStyle.h"
</span><span class="cx"> #include "StyleBuilderConverter.h"
</span><ins>+#include "StyleBuilderCustom.h"
</ins><span class="cx"> #include "StyleResolver.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class StyleBuilderFunctions {
-public:
</del><ins>+namespace StyleBuilderFunctions {
</ins><span class="cx"> EOF
</span><span class="cx">
</span><span class="cx"> foreach my $name (@names) {
</span><span class="lines">@@ -376,28 +380,30 @@
</span><span class="cx"> next unless exists($propertiesUsingNewStyleBuilder{$name});
</span><span class="cx">
</span><span class="cx"> my $setValue = "styleResolver.style()->" . $propertiesUsingNewStyleBuilder{$name}{"Setter"};
</span><del>- print STYLEBUILDER " static void applyInitial" . $nameToId{$name} . "(StyleResolver& styleResolver)\n";
</del><ins>+ print STYLEBUILDER " inline void applyInitial" . $nameToId{$name} . "(StyleResolver& styleResolver)\n";
</ins><span class="cx"> print STYLEBUILDER " {\n";
</span><span class="cx"> print STYLEBUILDER " " . $setValue . "(RenderStyle::" . $propertiesUsingNewStyleBuilder{$name}{"Initial"} . "());\n";
</span><span class="cx"> print STYLEBUILDER " }\n";
</span><del>- print STYLEBUILDER " static void applyInherit" . $nameToId{$name} . "(StyleResolver& styleResolver)\n";
</del><ins>+ print STYLEBUILDER " inline void applyInherit" . $nameToId{$name} . "(StyleResolver& styleResolver)\n";
</ins><span class="cx"> print STYLEBUILDER " {\n";
</span><span class="cx"> print STYLEBUILDER " " . $setValue . "(styleResolver.parentStyle()->" . $propertiesUsingNewStyleBuilder{$name}{"Getter"} . "());\n";
</span><span class="cx"> print STYLEBUILDER " }\n";
</span><del>- 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))";
</del><ins>+ 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";
</ins><span class="cx"> }
</span><del>- print STYLEBUILDER " " . $setValue . "(" . $convertedValue . ");\n";
- print STYLEBUILDER " }\n";
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> print STYLEBUILDER << "EOF";
</span><del>-};
</del><ins>+} // namespace StyleBuilderFunctions
</ins><span class="cx">
</span><span class="cx"> bool StyleBuilder::applyProperty(CSSPropertyID property, StyleResolver& styleResolver, CSSValue& value, bool isInitial, bool isInherit)
</span><span class="cx"> {
</span></span></pre>
</div>
</div>
</body>
</html>