<!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>[175169] 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/175169">175169</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-10-24 11:32:34 -0700 (Fri, 24 Oct 2014)</dd>
</dl>

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

Reviewed by Andreas Kling.

Move ComputeLength CSS properties from DeprecatedStyleBuilder to the
new StyleBuilder so that they are now generated. 3 Converters are
provided for these properties: ComputedLength / LineWidth / Spacing.

This is inspired by the following Blink revision by
&lt;timloh@chromium.org&gt;:
https://src.chromium.org/viewvc/blink?view=rev&amp;revision=154012

No new tests, no behavior change.

* css/CSSPropertyNames.in:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
(WebCore::ApplyPropertyComputeLength::setValue): Deleted.
(WebCore::ApplyPropertyComputeLength::applyValue): Deleted.
(WebCore::ApplyPropertyComputeLength::createHandler): Deleted.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertComputedLength):
(WebCore::StyleBuilderConverter::convertLineWidth):
(WebCore::StyleBuilderConverter::convertSpacing):</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="#trunkSourceWebCorecssStyleBuilderConverterh">trunk/Source/WebCore/css/StyleBuilderConverter.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (175168 => 175169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-24 18:13:30 UTC (rev 175168)
+++ trunk/Source/WebCore/ChangeLog        2014-10-24 18:32:34 UTC (rev 175169)
</span><span class="lines">@@ -1,5 +1,33 @@
</span><span class="cx"> 2014-10-24  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Move ComputeLength CSS properties to the new StyleBuilder
+        https://bugs.webkit.org/show_bug.cgi?id=138036
+
+        Reviewed by Andreas Kling.
+
+        Move ComputeLength CSS properties from DeprecatedStyleBuilder to the
+        new StyleBuilder so that they are now generated. 3 Converters are
+        provided for these properties: ComputedLength / LineWidth / Spacing.
+
+        This is inspired by the following Blink revision by
+        &lt;timloh@chromium.org&gt;:
+        https://src.chromium.org/viewvc/blink?view=rev&amp;revision=154012
+
+        No new tests, no behavior change.
+
+        * css/CSSPropertyNames.in:
+        * css/DeprecatedStyleBuilder.cpp:
+        (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
+        (WebCore::ApplyPropertyComputeLength::setValue): Deleted.
+        (WebCore::ApplyPropertyComputeLength::applyValue): Deleted.
+        (WebCore::ApplyPropertyComputeLength::createHandler): Deleted.
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertComputedLength):
+        (WebCore::StyleBuilderConverter::convertLineWidth):
+        (WebCore::StyleBuilderConverter::convertSpacing):
+
+2014-10-24  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Make ScriptWrappable's destructor protected instead of public
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=138037
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (175168 => 175169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPropertyNames.in        2014-10-24 18:13:30 UTC (rev 175168)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in        2014-10-24 18:32:34 UTC (rev 175169)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> border-bottom-right-radius
</span><span class="cx"> -webkit-border-bottom-right-radius = border-bottom-right-radius
</span><span class="cx"> border-bottom-style [NewStyleBuilder, TypeName=EBorderStyle, Initial=initialBorderStyle]
</span><del>-border-bottom-width
</del><ins>+border-bottom-width [NewStyleBuilder, Initial=initialBorderWidth, Converter=LineWidth&lt;float&gt;]
</ins><span class="cx"> border-collapse [Inherited, NewStyleBuilder]
</span><span class="cx"> border-color
</span><span class="cx"> border-image
</span><span class="lines">@@ -76,12 +76,12 @@
</span><span class="cx"> border-left
</span><span class="cx"> border-left-color
</span><span class="cx"> border-left-style [NewStyleBuilder, TypeName=EBorderStyle, Initial=initialBorderStyle]
</span><del>-border-left-width
</del><ins>+border-left-width [NewStyleBuilder, Initial=initialBorderWidth, Converter=LineWidth&lt;float&gt;]
</ins><span class="cx"> border-radius
</span><span class="cx"> border-right
</span><span class="cx"> border-right-color
</span><span class="cx"> border-right-style [NewStyleBuilder, TypeName=EBorderStyle, Initial=initialBorderStyle]
</span><del>-border-right-width
</del><ins>+border-right-width [NewStyleBuilder, Initial=initialBorderWidth, Converter=LineWidth&lt;float&gt;]
</ins><span class="cx"> border-spacing [Inherited]
</span><span class="cx"> border-style
</span><span class="cx"> border-top
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx"> border-top-right-radius
</span><span class="cx"> -webkit-border-top-right-radius = border-top-right-radius
</span><span class="cx"> border-top-style [NewStyleBuilder, TypeName=EBorderStyle, Initial=initialBorderStyle]
</span><del>-border-top-width
</del><ins>+border-top-width [NewStyleBuilder, Initial=initialBorderWidth, Converter=LineWidth&lt;float&gt;]
</ins><span class="cx"> border-width
</span><span class="cx"> bottom [NewStyleBuilder, Initial=initialOffset, Converter=LengthOrAuto]
</span><span class="cx"> box-shadow
</span><span class="lines">@@ -122,7 +122,7 @@
</span><span class="cx"> image-resolution [Inherited]
</span><span class="cx"> #endif
</span><span class="cx"> left [NewStyleBuilder, Initial=initialOffset, Converter=LengthOrAuto]
</span><del>-letter-spacing [Inherited]
</del><ins>+letter-spacing [Inherited, NewStyleBuilder, Converter=Spacing]
</ins><span class="cx"> list-style [Inherited]
</span><span class="cx"> list-style-image [Inherited]
</span><span class="cx"> list-style-position [Inherited, NewStyleBuilder]
</span><span class="lines">@@ -144,9 +144,9 @@
</span><span class="cx"> orphans [Inherited]
</span><span class="cx"> outline
</span><span class="cx"> outline-color
</span><del>-outline-offset
</del><ins>+outline-offset [NewStyleBuilder, Converter=ComputedLength&lt;int&gt;]
</ins><span class="cx"> outline-style
</span><del>-outline-width
</del><ins>+outline-width [NewStyleBuilder, Converter=LineWidth&lt;unsigned short&gt;]
</ins><span class="cx"> overflow
</span><span class="cx"> overflow-wrap [NewStyleBuilder]
</span><span class="cx"> overflow-x [NewStyleBuilder, TypeName=EOverflow]
</span><span class="lines">@@ -245,7 +245,7 @@
</span><span class="cx"> -webkit-border-end-style
</span><span class="cx"> -webkit-border-end-width
</span><span class="cx"> -webkit-border-fit [NewStyleBuilder]
</span><del>--webkit-border-horizontal-spacing [Inherited]
</del><ins>+-webkit-border-horizontal-spacing [Inherited, NewStyleBuilder, NameForMethods=HorizontalBorderSpacing, Converter=ComputedLength&lt;short&gt;]
</ins><span class="cx"> -webkit-border-image
</span><span class="cx"> // -webkit-border-radius differs from border-radius only in the interpretation of
</span><span class="cx"> // a value consisting of two lengths: &quot;-webkit-border-radius: l1 l2;&quot; is equivalent
</span><span class="lines">@@ -255,7 +255,7 @@
</span><span class="cx"> -webkit-border-start-color
</span><span class="cx"> -webkit-border-start-style
</span><span class="cx"> -webkit-border-start-width
</span><del>--webkit-border-vertical-spacing [Inherited]
</del><ins>+-webkit-border-vertical-spacing [Inherited, NewStyleBuilder, NameForMethods=VerticalBorderSpacing, Converter=ComputedLength&lt;short&gt;]
</ins><span class="cx"> -webkit-box-align [NewStyleBuilder, TypeName=EBoxAlignment]
</span><span class="cx"> -webkit-box-direction [Inherited, NewStyleBuilder]
</span><span class="cx"> -webkit-box-flex [NewStyleBuilder, TypeName=float]
</span><span class="lines">@@ -281,7 +281,7 @@
</span><span class="cx"> -webkit-column-rule
</span><span class="cx"> -webkit-column-rule-color
</span><span class="cx"> -webkit-column-rule-style [NewStyleBuilder, TypeName=EBorderStyle, Initial=initialBorderStyle]
</span><del>--webkit-column-rule-width
</del><ins>+-webkit-column-rule-width [NewStyleBuilder, Converter=LineWidth&lt;unsigned short&gt;]
</ins><span class="cx"> -webkit-column-span [NewStyleBuilder, TypeName=ColumnSpan]
</span><span class="cx"> -webkit-column-width
</span><span class="cx"> -webkit-columns
</span><span class="lines">@@ -440,7 +440,7 @@
</span><span class="cx"> -webkit-transform-origin
</span><span class="cx"> -webkit-transform-origin-x [NewStyleBuilder, Converter=Length]
</span><span class="cx"> -webkit-transform-origin-y [NewStyleBuilder, Converter=Length]
</span><del>--webkit-transform-origin-z
</del><ins>+-webkit-transform-origin-z [NewStyleBuilder, Converter=ComputedLength&lt;float&gt;]
</ins><span class="cx"> -webkit-transform-style [NewStyleBuilder, TypeName=ETransformStyle3D, NameForMethods=TransformStyle3D]
</span><span class="cx"> -webkit-transition
</span><span class="cx"> -webkit-transition-delay
</span></span></pre></div>
<a id="trunkSourceWebCorecssDeprecatedStyleBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (175168 => 175169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-10-24 18:13:30 UTC (rev 175168)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-10-24 18:32:34 UTC (rev 175169)
</span><span class="lines">@@ -580,62 +580,6 @@
</span><span class="cx">     static PropertyHandler createHandler() { return PropertyHandler(&amp;applyInheritValue, &amp;applyInitialValue, &amp;applyValue); }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-enum ComputeLengthNormal {NormalDisabled = 0, NormalEnabled};
-enum ComputeLengthThickness {ThicknessDisabled = 0, ThicknessEnabled};
-enum ComputeLengthSVGZoom {SVGZoomDisabled = 0, SVGZoomEnabled};
-template &lt;typename T,
-          T (RenderStyle::*getterFunction)() const,
-          void (RenderStyle::*setterFunction)(T),
-          T (*initialFunction)(),
-          ComputeLengthNormal normalEnabled = NormalDisabled,
-          ComputeLengthThickness thicknessEnabled = ThicknessDisabled,
-          ComputeLengthSVGZoom svgZoomEnabled = SVGZoomDisabled&gt;
-class ApplyPropertyComputeLength {
-public:
-    static void setValue(RenderStyle* style, T value) { (style-&gt;*setterFunction)(value); }
-    static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
-    {
-        // note: CSSPropertyLetter/WordSpacing right now sets to zero if it's not a primitive value for some reason...
-        if (!is&lt;CSSPrimitiveValue&gt;(*value))
-            return;
-
-        CSSPrimitiveValue&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(*value);
-
-        CSSValueID ident = primitiveValue.getValueID();
-        T length;
-        if (normalEnabled &amp;&amp; ident == CSSValueNormal) {
-            length = 0;
-        } else if (thicknessEnabled &amp;&amp; ident == CSSValueThin) {
-            length = 1;
-        } else if (thicknessEnabled &amp;&amp; ident == CSSValueMedium) {
-            length = 3;
-        } else if (thicknessEnabled &amp;&amp; ident == CSSValueThick) {
-            length = 5;
-        } else if (ident == CSSValueInvalid) {
-            CSSToLengthConversionData conversionData = (svgZoomEnabled &amp;&amp; styleResolver-&gt;useSVGZoomRules()) ? styleResolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f) : styleResolver-&gt;state().cssToLengthConversionData();
-
-            // Any original result that was &gt;= 1 should not be allowed to fall below 1.
-            // This keeps border lines from vanishing.
-            length = primitiveValue.computeLength&lt;T&gt;(conversionData);
-            if (conversionData.zoom() &lt; 1.0f &amp;&amp; length &lt; 1.0) {
-                T originalLength = primitiveValue.computeLength&lt;T&gt;(conversionData.copyWithAdjustedZoom(1.0f));
-                if (originalLength &gt;= 1.0)
-                    length = 1.0;
-            }
-        } else {
-            ASSERT_NOT_REACHED();
-            length = 0;
-        }
-
-        setValue(styleResolver-&gt;style(), length);
-    }
-    static PropertyHandler createHandler()
-    {
-        PropertyHandler handler = ApplyPropertyDefaultBase&lt;T, getterFunction, T, setterFunction, T, initialFunction&gt;::createHandler();
-        return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &amp;applyValue);
-    }
-};
-
</del><span class="cx"> template &lt;typename T, T (FontDescription::*getterFunction)() const, void (FontDescription::*setterFunction)(T), T initialValue&gt;
</span><span class="cx"> class ApplyPropertyFont {
</span><span class="cx"> public:
</span><span class="lines">@@ -2358,20 +2302,16 @@
</span><span class="cx">     setPropertyHandler(CSSPropertyBorderBottomColor, ApplyPropertyColor&lt;NoInheritFromParent, &amp;RenderStyle::borderBottomColor, &amp;RenderStyle::setBorderBottomColor, &amp;RenderStyle::setVisitedLinkBorderBottomColor, &amp;RenderStyle::color&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyBorderBottomLeftRadius, ApplyPropertyBorderRadius&lt;&amp;RenderStyle::borderBottomLeftRadius, &amp;RenderStyle::setBorderBottomLeftRadius, &amp;RenderStyle::initialBorderRadius&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyBorderBottomRightRadius, ApplyPropertyBorderRadius&lt;&amp;RenderStyle::borderBottomRightRadius, &amp;RenderStyle::setBorderBottomRightRadius, &amp;RenderStyle::initialBorderRadius&gt;::createHandler());
</span><del>-    setPropertyHandler(CSSPropertyBorderBottomWidth, ApplyPropertyComputeLength&lt;float, &amp;RenderStyle::borderBottomWidth, &amp;RenderStyle::setBorderBottomWidth, &amp;RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled&gt;::createHandler());
</del><span class="cx">     setPropertyHandler(CSSPropertyBorderImageOutset, ApplyPropertyBorderImageModifier&lt;BorderImage, Outset&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyBorderImageRepeat, ApplyPropertyBorderImageModifier&lt;BorderImage, Repeat&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyBorderImageSlice, ApplyPropertyBorderImageModifier&lt;BorderImage, Slice&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyBorderImageSource, ApplyPropertyBorderImageSource&lt;CSSPropertyBorderImageSource, &amp;RenderStyle::borderImageSource, &amp;RenderStyle::setBorderImageSource, &amp;RenderStyle::initialBorderImageSource&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyBorderImageWidth, ApplyPropertyBorderImageModifier&lt;BorderImage, Width&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyBorderLeftColor, ApplyPropertyColor&lt;NoInheritFromParent, &amp;RenderStyle::borderLeftColor, &amp;RenderStyle::setBorderLeftColor, &amp;RenderStyle::setVisitedLinkBorderLeftColor, &amp;RenderStyle::color&gt;::createHandler());
</span><del>-    setPropertyHandler(CSSPropertyBorderLeftWidth, ApplyPropertyComputeLength&lt;float, &amp;RenderStyle::borderLeftWidth, &amp;RenderStyle::setBorderLeftWidth, &amp;RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled&gt;::createHandler());
</del><span class="cx">     setPropertyHandler(CSSPropertyBorderRightColor, ApplyPropertyColor&lt;NoInheritFromParent, &amp;RenderStyle::borderRightColor, &amp;RenderStyle::setBorderRightColor, &amp;RenderStyle::setVisitedLinkBorderRightColor, &amp;RenderStyle::color&gt;::createHandler());
</span><del>-    setPropertyHandler(CSSPropertyBorderRightWidth, ApplyPropertyComputeLength&lt;float, &amp;RenderStyle::borderRightWidth, &amp;RenderStyle::setBorderRightWidth, &amp;RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled&gt;::createHandler());
</del><span class="cx">     setPropertyHandler(CSSPropertyBorderTopColor, ApplyPropertyColor&lt;NoInheritFromParent, &amp;RenderStyle::borderTopColor, &amp;RenderStyle::setBorderTopColor, &amp;RenderStyle::setVisitedLinkBorderTopColor, &amp;RenderStyle::color&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyBorderTopLeftRadius, ApplyPropertyBorderRadius&lt;&amp;RenderStyle::borderTopLeftRadius, &amp;RenderStyle::setBorderTopLeftRadius, &amp;RenderStyle::initialBorderRadius&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyBorderTopRightRadius, ApplyPropertyBorderRadius&lt;&amp;RenderStyle::borderTopRightRadius, &amp;RenderStyle::setBorderTopRightRadius, &amp;RenderStyle::initialBorderRadius&gt;::createHandler());
</span><del>-    setPropertyHandler(CSSPropertyBorderTopWidth, ApplyPropertyComputeLength&lt;float, &amp;RenderStyle::borderTopWidth, &amp;RenderStyle::setBorderTopWidth, &amp;RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled&gt;::createHandler());
</del><span class="cx">     setPropertyHandler(CSSPropertyClip, ApplyPropertyClip::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyColor, ApplyPropertyColor&lt;InheritFromParent, &amp;RenderStyle::color, &amp;RenderStyle::setColor, &amp;RenderStyle::setVisitedLinkColor, &amp;RenderStyle::invalidColor, RenderStyle::initialColor&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyCounterIncrement, ApplyPropertyCounter&lt;Increment&gt;::createHandler());
</span><span class="lines">@@ -2387,8 +2327,6 @@
</span><span class="cx"> #if ENABLE(CSS_IMAGE_RESOLUTION)
</span><span class="cx">     setPropertyHandler(CSSPropertyImageResolution, ApplyPropertyImageResolution::createHandler());
</span><span class="cx"> #endif
</span><del>-    setPropertyHandler(CSSPropertyLetterSpacing, ApplyPropertyComputeLength&lt;float, &amp;RenderStyle::letterSpacing, &amp;RenderStyle::setLetterSpacing, &amp;RenderStyle::initialLetterSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled&gt;::createHandler());
-
</del><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx">     setPropertyHandler(CSSPropertyLineHeight, ApplyPropertyLineHeightForIOSTextAutosizing::createHandler());
</span><span class="cx"> #else
</span><span class="lines">@@ -2397,9 +2335,7 @@
</span><span class="cx">     setPropertyHandler(CSSPropertyListStyleImage, ApplyPropertyStyleImage&lt;&amp;RenderStyle::listStyleImage, &amp;RenderStyle::setListStyleImage, &amp;RenderStyle::initialListStyleImage, CSSPropertyListStyleImage&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyOrphans, ApplyPropertyAuto&lt;short, &amp;RenderStyle::orphans, &amp;RenderStyle::setOrphans, &amp;RenderStyle::hasAutoOrphans, &amp;RenderStyle::setHasAutoOrphans&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyOutlineColor, ApplyPropertyColor&lt;NoInheritFromParent, &amp;RenderStyle::outlineColor, &amp;RenderStyle::setOutlineColor, &amp;RenderStyle::setVisitedLinkOutlineColor, &amp;RenderStyle::color&gt;::createHandler());
</span><del>-    setPropertyHandler(CSSPropertyOutlineOffset, ApplyPropertyComputeLength&lt;int, &amp;RenderStyle::outlineOffset, &amp;RenderStyle::setOutlineOffset, &amp;RenderStyle::initialOutlineOffset&gt;::createHandler());
</del><span class="cx">     setPropertyHandler(CSSPropertyOutlineStyle, ApplyPropertyOutlineStyle::createHandler());
</span><del>-    setPropertyHandler(CSSPropertyOutlineWidth, ApplyPropertyComputeLength&lt;unsigned short, &amp;RenderStyle::outlineWidth, &amp;RenderStyle::setOutlineWidth, &amp;RenderStyle::initialOutlineWidth, NormalDisabled, ThicknessEnabled&gt;::createHandler());
</del><span class="cx">     setPropertyHandler(CSSPropertyResize, ApplyPropertyResize::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertySize, ApplyPropertyPageSize::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyTextAlign, ApplyPropertyTextAlign::createHandler());
</span><span class="lines">@@ -2424,13 +2360,10 @@
</span><span class="cx">     setPropertyHandler(CSSPropertyWebkitBackgroundComposite, ApplyPropertyFillLayer&lt;CompositeOperator, CSSPropertyWebkitBackgroundComposite, BackgroundFillLayer, &amp;RenderStyle::accessBackgroundLayers, &amp;RenderStyle::backgroundLayers, &amp;FillLayer::isCompositeSet, &amp;FillLayer::composite, &amp;FillLayer::setComposite, &amp;FillLayer::clearComposite, &amp;FillLayer::initialFillComposite, &amp;CSSToStyleMap::mapFillComposite&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyWebkitBackgroundOrigin, CSSPropertyBackgroundOrigin);
</span><span class="cx">     setPropertyHandler(CSSPropertyWebkitBackgroundSize, CSSPropertyBackgroundSize);
</span><del>-    setPropertyHandler(CSSPropertyWebkitBorderHorizontalSpacing, ApplyPropertyComputeLength&lt;short, &amp;RenderStyle::horizontalBorderSpacing, &amp;RenderStyle::setHorizontalBorderSpacing, &amp;RenderStyle::initialHorizontalBorderSpacing&gt;::createHandler());
</del><span class="cx">     setPropertyHandler(CSSPropertyWebkitBorderImage, ApplyPropertyBorderImage&lt;BorderImage, CSSPropertyWebkitBorderImage, &amp;RenderStyle::borderImage, &amp;RenderStyle::setBorderImage&gt;::createHandler());
</span><del>-    setPropertyHandler(CSSPropertyWebkitBorderVerticalSpacing, ApplyPropertyComputeLength&lt;short, &amp;RenderStyle::verticalBorderSpacing, &amp;RenderStyle::setVerticalBorderSpacing, &amp;RenderStyle::initialVerticalBorderSpacing&gt;::createHandler());
</del><span class="cx">     setPropertyHandler(CSSPropertyWebkitColumnCount, ApplyPropertyAuto&lt;unsigned short, &amp;RenderStyle::columnCount, &amp;RenderStyle::setColumnCount, &amp;RenderStyle::hasAutoColumnCount, &amp;RenderStyle::setHasAutoColumnCount&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyWebkitColumnGap, ApplyPropertyAuto&lt;float, &amp;RenderStyle::columnGap, &amp;RenderStyle::setColumnGap, &amp;RenderStyle::hasNormalColumnGap, &amp;RenderStyle::setHasNormalColumnGap, ComputeLength, CSSValueNormal&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyWebkitColumnRuleColor, ApplyPropertyColor&lt;NoInheritFromParent, &amp;RenderStyle::columnRuleColor, &amp;RenderStyle::setColumnRuleColor, &amp;RenderStyle::setVisitedLinkColumnRuleColor, &amp;RenderStyle::color&gt;::createHandler());
</span><del>-    setPropertyHandler(CSSPropertyWebkitColumnRuleWidth, ApplyPropertyComputeLength&lt;unsigned short, &amp;RenderStyle::columnRuleWidth, &amp;RenderStyle::setColumnRuleWidth, &amp;RenderStyle::initialColumnRuleWidth, NormalDisabled, ThicknessEnabled&gt;::createHandler());
</del><span class="cx">     setPropertyHandler(CSSPropertyWebkitColumnWidth, ApplyPropertyAuto&lt;float, &amp;RenderStyle::columnWidth, &amp;RenderStyle::setColumnWidth, &amp;RenderStyle::hasAutoColumnWidth, &amp;RenderStyle::setHasAutoColumnWidth, ComputeLength&gt;::createHandler());
</span><span class="cx"> #if ENABLE(CSS_REGIONS)
</span><span class="cx">     setPropertyHandler(CSSPropertyWebkitFlowFrom, ApplyPropertyString&lt;MapNoneToNull, &amp;RenderStyle::regionThread, &amp;RenderStyle::setRegionThread, &amp;RenderStyle::initialRegionThread&gt;::createHandler());
</span><span class="lines">@@ -2469,7 +2402,6 @@
</span><span class="cx">     setPropertyHandler(CSSPropertyWebkitTextEmphasisStyle, ApplyPropertyTextEmphasisStyle::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyWebkitTextFillColor, ApplyPropertyColor&lt;NoInheritFromParent, &amp;RenderStyle::textFillColor, &amp;RenderStyle::setTextFillColor, &amp;RenderStyle::setVisitedLinkTextFillColor, &amp;RenderStyle::color&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyWebkitTextStrokeColor, ApplyPropertyColor&lt;NoInheritFromParent, &amp;RenderStyle::textStrokeColor, &amp;RenderStyle::setTextStrokeColor, &amp;RenderStyle::setVisitedLinkTextStrokeColor, &amp;RenderStyle::color&gt;::createHandler());
</span><del>-    setPropertyHandler(CSSPropertyWebkitTransformOriginZ, ApplyPropertyComputeLength&lt;float, &amp;RenderStyle::transformOriginZ, &amp;RenderStyle::setTransformOriginZ, &amp;RenderStyle::initialTransformOriginZ&gt;::createHandler());
</del><span class="cx">     setPropertyHandler(CSSPropertyWebkitTransitionDelay, ApplyPropertyAnimation&lt;double, &amp;Animation::delay, &amp;Animation::setDelay, &amp;Animation::isDelaySet, &amp;Animation::clearDelay, &amp;Animation::initialAnimationDelay, &amp;CSSToStyleMap::mapAnimationDelay, &amp;RenderStyle::accessTransitions, &amp;RenderStyle::transitions&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyWebkitTransitionDuration, ApplyPropertyAnimation&lt;double, &amp;Animation::duration, &amp;Animation::setDuration, &amp;Animation::isDurationSet, &amp;Animation::clearDuration, &amp;Animation::initialAnimationDuration, &amp;CSSToStyleMap::mapAnimationDuration, &amp;RenderStyle::accessTransitions, &amp;RenderStyle::transitions&gt;::createHandler());
</span><span class="cx">     setPropertyHandler(CSSPropertyWebkitTransitionProperty, ApplyPropertyAnimation&lt;CSSPropertyID, &amp;Animation::property, &amp;Animation::setProperty, &amp;Animation::isPropertySet, &amp;Animation::clearProperty, &amp;Animation::initialAnimationProperty, &amp;CSSToStyleMap::mapAnimationProperty, &amp;RenderStyle::accessTransitions, &amp;RenderStyle::transitions&gt;::createHandler());
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderConverterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderConverter.h (175168 => 175169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderConverter.h        2014-10-24 18:13:30 UTC (rev 175168)
+++ trunk/Source/WebCore/css/StyleBuilderConverter.h        2014-10-24 18:32:34 UTC (rev 175169)
</span><span class="lines">@@ -40,6 +40,9 @@
</span><span class="cx">     static Length convertLengthOrAuto(StyleResolver&amp;, CSSValue&amp;);
</span><span class="cx">     static Length convertLengthSizing(StyleResolver&amp;, CSSValue&amp;);
</span><span class="cx">     static Length convertLengthMaxSizing(StyleResolver&amp;, CSSValue&amp;);
</span><ins>+    template &lt;typename T&gt; static T convertComputedLength(StyleResolver&amp;, CSSValue&amp;);
+    template &lt;typename T&gt; static T convertLineWidth(StyleResolver&amp;, CSSValue&amp;);
+    static float convertSpacing(StyleResolver&amp;, CSSValue&amp;);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline Length StyleBuilderConverter::convertLength(StyleResolver&amp; styleResolver, CSSValue&amp; value)
</span><span class="lines">@@ -105,6 +108,52 @@
</span><span class="cx">     return convertLengthSizing(styleResolver, value);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template &lt;typename T&gt;
+inline T StyleBuilderConverter::convertComputedLength(StyleResolver&amp; styleResolver, CSSValue&amp; value)
+{
+    return downcast&lt;CSSPrimitiveValue&gt;(value).computeLength&lt;T&gt;(styleResolver.state().cssToLengthConversionData());
+}
+
+template &lt;typename T&gt;
+inline T StyleBuilderConverter::convertLineWidth(StyleResolver&amp; styleResolver, CSSValue&amp; value)
+{
+    auto&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(value);
+    switch (primitiveValue.getValueID()) {
+    case CSSValueThin:
+        return 1;
+    case CSSValueMedium:
+        return 3;
+    case CSSValueThick:
+        return 5;
+    case CSSValueInvalid: {
+        // Any original result that was &gt;= 1 should not be allowed to fall below 1.
+        // This keeps border lines from vanishing.
+        T result = convertComputedLength&lt;T&gt;(styleResolver, value);
+        if (styleResolver.state().style()-&gt;effectiveZoom() &lt; 1.0f &amp;&amp; result &lt; 1.0) {
+            T originalLength = primitiveValue.computeLength&lt;T&gt;(styleResolver.state().cssToLengthConversionData().copyWithAdjustedZoom(1.0));
+            if (originalLength &gt;= 1.0)
+                return 1;
+        }
+        return result;
+    }
+    default:
+        ASSERT_NOT_REACHED();
+        return 0;
+    }
+}
+
+inline float StyleBuilderConverter::convertSpacing(StyleResolver&amp; styleResolver, CSSValue&amp; value)
+{
+    auto&amp; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(value);
+    if (primitiveValue.getValueID() == CSSValueNormal)
+        return 0.f;
+
+    CSSToLengthConversionData conversionData = styleResolver.useSVGZoomRulesForLength() ?
+        styleResolver.state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f)
+        : styleResolver.state().cssToLengthConversionData();
+    return primitiveValue.computeLength&lt;float&gt;(conversionData);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // StyleBuilderConverter_h
</span></span></pre>
</div>
</div>

</body>
</html>