<!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
<timloh@chromium.org>:
https://src.chromium.org/viewvc/blink?view=rev&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 <cdumez@apple.com>
</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
+ <timloh@chromium.org>:
+ https://src.chromium.org/viewvc/blink?view=rev&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 <cdumez@apple.com>
+
</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<float>]
</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<float>]
</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<float>]
</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<float>]
</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<int>]
</ins><span class="cx"> outline-style
</span><del>-outline-width
</del><ins>+outline-width [NewStyleBuilder, Converter=LineWidth<unsigned short>]
</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<short>]
</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: "-webkit-border-radius: l1 l2;" 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<short>]
</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<unsigned short>]
</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<float>]
</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(&applyInheritValue, &applyInitialValue, &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 <typename T,
- T (RenderStyle::*getterFunction)() const,
- void (RenderStyle::*setterFunction)(T),
- T (*initialFunction)(),
- ComputeLengthNormal normalEnabled = NormalDisabled,
- ComputeLengthThickness thicknessEnabled = ThicknessDisabled,
- ComputeLengthSVGZoom svgZoomEnabled = SVGZoomDisabled>
-class ApplyPropertyComputeLength {
-public:
- static void setValue(RenderStyle* style, T value) { (style->*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<CSSPrimitiveValue>(*value))
- return;
-
- CSSPrimitiveValue& primitiveValue = downcast<CSSPrimitiveValue>(*value);
-
- CSSValueID ident = primitiveValue.getValueID();
- T length;
- if (normalEnabled && ident == CSSValueNormal) {
- length = 0;
- } else if (thicknessEnabled && ident == CSSValueThin) {
- length = 1;
- } else if (thicknessEnabled && ident == CSSValueMedium) {
- length = 3;
- } else if (thicknessEnabled && ident == CSSValueThick) {
- length = 5;
- } else if (ident == CSSValueInvalid) {
- CSSToLengthConversionData conversionData = (svgZoomEnabled && styleResolver->useSVGZoomRules()) ? styleResolver->state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f) : styleResolver->state().cssToLengthConversionData();
-
- // Any original result that was >= 1 should not be allowed to fall below 1.
- // This keeps border lines from vanishing.
- length = primitiveValue.computeLength<T>(conversionData);
- if (conversionData.zoom() < 1.0f && length < 1.0) {
- T originalLength = primitiveValue.computeLength<T>(conversionData.copyWithAdjustedZoom(1.0f));
- if (originalLength >= 1.0)
- length = 1.0;
- }
- } else {
- ASSERT_NOT_REACHED();
- length = 0;
- }
-
- setValue(styleResolver->style(), length);
- }
- static PropertyHandler createHandler()
- {
- PropertyHandler handler = ApplyPropertyDefaultBase<T, getterFunction, T, setterFunction, T, initialFunction>::createHandler();
- return PropertyHandler(handler.inheritFunction(), handler.initialFunction(), &applyValue);
- }
-};
-
</del><span class="cx"> template <typename T, T (FontDescription::*getterFunction)() const, void (FontDescription::*setterFunction)(T), T initialValue>
</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<NoInheritFromParent, &RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor, &RenderStyle::setVisitedLinkBorderBottomColor, &RenderStyle::color>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyBorderBottomLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomLeftRadius, &RenderStyle::setBorderBottomLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyBorderBottomRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderBottomRightRadius, &RenderStyle::setBorderBottomRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
</span><del>- setPropertyHandler(CSSPropertyBorderBottomWidth, ApplyPropertyComputeLength<float, &RenderStyle::borderBottomWidth, &RenderStyle::setBorderBottomWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
</del><span class="cx"> setPropertyHandler(CSSPropertyBorderImageOutset, ApplyPropertyBorderImageModifier<BorderImage, Outset>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyBorderImageRepeat, ApplyPropertyBorderImageModifier<BorderImage, Repeat>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyBorderImageSlice, ApplyPropertyBorderImageModifier<BorderImage, Slice>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyBorderImageSource, ApplyPropertyBorderImageSource<CSSPropertyBorderImageSource, &RenderStyle::borderImageSource, &RenderStyle::setBorderImageSource, &RenderStyle::initialBorderImageSource>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyBorderImageWidth, ApplyPropertyBorderImageModifier<BorderImage, Width>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyBorderLeftColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderLeftColor, &RenderStyle::setBorderLeftColor, &RenderStyle::setVisitedLinkBorderLeftColor, &RenderStyle::color>::createHandler());
</span><del>- setPropertyHandler(CSSPropertyBorderLeftWidth, ApplyPropertyComputeLength<float, &RenderStyle::borderLeftWidth, &RenderStyle::setBorderLeftWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
</del><span class="cx"> setPropertyHandler(CSSPropertyBorderRightColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderRightColor, &RenderStyle::setBorderRightColor, &RenderStyle::setVisitedLinkBorderRightColor, &RenderStyle::color>::createHandler());
</span><del>- setPropertyHandler(CSSPropertyBorderRightWidth, ApplyPropertyComputeLength<float, &RenderStyle::borderRightWidth, &RenderStyle::setBorderRightWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
</del><span class="cx"> setPropertyHandler(CSSPropertyBorderTopColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::borderTopColor, &RenderStyle::setBorderTopColor, &RenderStyle::setVisitedLinkBorderTopColor, &RenderStyle::color>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyBorderTopLeftRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopLeftRadius, &RenderStyle::setBorderTopLeftRadius, &RenderStyle::initialBorderRadius>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyBorderTopRightRadius, ApplyPropertyBorderRadius<&RenderStyle::borderTopRightRadius, &RenderStyle::setBorderTopRightRadius, &RenderStyle::initialBorderRadius>::createHandler());
</span><del>- setPropertyHandler(CSSPropertyBorderTopWidth, ApplyPropertyComputeLength<float, &RenderStyle::borderTopWidth, &RenderStyle::setBorderTopWidth, &RenderStyle::initialBorderWidth, NormalDisabled, ThicknessEnabled>::createHandler());
</del><span class="cx"> setPropertyHandler(CSSPropertyClip, ApplyPropertyClip::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyColor, ApplyPropertyColor<InheritFromParent, &RenderStyle::color, &RenderStyle::setColor, &RenderStyle::setVisitedLinkColor, &RenderStyle::invalidColor, RenderStyle::initialColor>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyCounterIncrement, ApplyPropertyCounter<Increment>::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<float, &RenderStyle::letterSpacing, &RenderStyle::setLetterSpacing, &RenderStyle::initialLetterSpacing, NormalEnabled, ThicknessDisabled, SVGZoomEnabled>::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<&RenderStyle::listStyleImage, &RenderStyle::setListStyleImage, &RenderStyle::initialListStyleImage, CSSPropertyListStyleImage>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyOrphans, ApplyPropertyAuto<short, &RenderStyle::orphans, &RenderStyle::setOrphans, &RenderStyle::hasAutoOrphans, &RenderStyle::setHasAutoOrphans>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyOutlineColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor, &RenderStyle::setVisitedLinkOutlineColor, &RenderStyle::color>::createHandler());
</span><del>- setPropertyHandler(CSSPropertyOutlineOffset, ApplyPropertyComputeLength<int, &RenderStyle::outlineOffset, &RenderStyle::setOutlineOffset, &RenderStyle::initialOutlineOffset>::createHandler());
</del><span class="cx"> setPropertyHandler(CSSPropertyOutlineStyle, ApplyPropertyOutlineStyle::createHandler());
</span><del>- setPropertyHandler(CSSPropertyOutlineWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::outlineWidth, &RenderStyle::setOutlineWidth, &RenderStyle::initialOutlineWidth, NormalDisabled, ThicknessEnabled>::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<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(CSSPropertyWebkitBorderHorizontalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::horizontalBorderSpacing, &RenderStyle::setHorizontalBorderSpacing, &RenderStyle::initialHorizontalBorderSpacing>::createHandler());
</del><span class="cx"> setPropertyHandler(CSSPropertyWebkitBorderImage, ApplyPropertyBorderImage<BorderImage, CSSPropertyWebkitBorderImage, &RenderStyle::borderImage, &RenderStyle::setBorderImage>::createHandler());
</span><del>- setPropertyHandler(CSSPropertyWebkitBorderVerticalSpacing, ApplyPropertyComputeLength<short, &RenderStyle::verticalBorderSpacing, &RenderStyle::setVerticalBorderSpacing, &RenderStyle::initialVerticalBorderSpacing>::createHandler());
</del><span class="cx"> setPropertyHandler(CSSPropertyWebkitColumnCount, ApplyPropertyAuto<unsigned short, &RenderStyle::columnCount, &RenderStyle::setColumnCount, &RenderStyle::hasAutoColumnCount, &RenderStyle::setHasAutoColumnCount>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitColumnGap, ApplyPropertyAuto<float, &RenderStyle::columnGap, &RenderStyle::setColumnGap, &RenderStyle::hasNormalColumnGap, &RenderStyle::setHasNormalColumnGap, ComputeLength, CSSValueNormal>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitColumnRuleColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::columnRuleColor, &RenderStyle::setColumnRuleColor, &RenderStyle::setVisitedLinkColumnRuleColor, &RenderStyle::color>::createHandler());
</span><del>- setPropertyHandler(CSSPropertyWebkitColumnRuleWidth, ApplyPropertyComputeLength<unsigned short, &RenderStyle::columnRuleWidth, &RenderStyle::setColumnRuleWidth, &RenderStyle::initialColumnRuleWidth, NormalDisabled, ThicknessEnabled>::createHandler());
</del><span class="cx"> setPropertyHandler(CSSPropertyWebkitColumnWidth, ApplyPropertyAuto<float, &RenderStyle::columnWidth, &RenderStyle::setColumnWidth, &RenderStyle::hasAutoColumnWidth, &RenderStyle::setHasAutoColumnWidth, ComputeLength>::createHandler());
</span><span class="cx"> #if ENABLE(CSS_REGIONS)
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitFlowFrom, ApplyPropertyString<MapNoneToNull, &RenderStyle::regionThread, &RenderStyle::setRegionThread, &RenderStyle::initialRegionThread>::createHandler());
</span><span class="lines">@@ -2469,7 +2402,6 @@
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitTextEmphasisStyle, ApplyPropertyTextEmphasisStyle::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitTextFillColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textFillColor, &RenderStyle::setTextFillColor, &RenderStyle::setVisitedLinkTextFillColor, &RenderStyle::color>::createHandler());
</span><span class="cx"> setPropertyHandler(CSSPropertyWebkitTextStrokeColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textStrokeColor, &RenderStyle::setTextStrokeColor, &RenderStyle::setVisitedLinkTextStrokeColor, &RenderStyle::color>::createHandler());
</span><del>- setPropertyHandler(CSSPropertyWebkitTransformOriginZ, ApplyPropertyComputeLength<float, &RenderStyle::transformOriginZ, &RenderStyle::setTransformOriginZ, &RenderStyle::initialTransformOriginZ>::createHandler());
</del><span class="cx"> setPropertyHandler(CSSPropertyWebkitTransitionDelay, ApplyPropertyAnimation<double, &Animation::delay, &Animation::setDelay, &Animation::isDelaySet, &Animation::clearDelay, &Animation::initialAnimationDelay, &CSSToStyleMap::mapAnimationDelay, &RenderStyle::accessTransitions, &RenderStyle::transitions>::createHandler());
</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></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&, CSSValue&);
</span><span class="cx"> static Length convertLengthSizing(StyleResolver&, CSSValue&);
</span><span class="cx"> static Length convertLengthMaxSizing(StyleResolver&, CSSValue&);
</span><ins>+ template <typename T> static T convertComputedLength(StyleResolver&, CSSValue&);
+ template <typename T> static T convertLineWidth(StyleResolver&, CSSValue&);
+ static float convertSpacing(StyleResolver&, CSSValue&);
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> inline Length StyleBuilderConverter::convertLength(StyleResolver& styleResolver, CSSValue& 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 <typename T>
+inline T StyleBuilderConverter::convertComputedLength(StyleResolver& styleResolver, CSSValue& value)
+{
+ return downcast<CSSPrimitiveValue>(value).computeLength<T>(styleResolver.state().cssToLengthConversionData());
+}
+
+template <typename T>
+inline T StyleBuilderConverter::convertLineWidth(StyleResolver& styleResolver, CSSValue& value)
+{
+ auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
+ switch (primitiveValue.getValueID()) {
+ case CSSValueThin:
+ return 1;
+ case CSSValueMedium:
+ return 3;
+ case CSSValueThick:
+ return 5;
+ case CSSValueInvalid: {
+ // Any original result that was >= 1 should not be allowed to fall below 1.
+ // This keeps border lines from vanishing.
+ T result = convertComputedLength<T>(styleResolver, value);
+ if (styleResolver.state().style()->effectiveZoom() < 1.0f && result < 1.0) {
+ T originalLength = primitiveValue.computeLength<T>(styleResolver.state().cssToLengthConversionData().copyWithAdjustedZoom(1.0));
+ if (originalLength >= 1.0)
+ return 1;
+ }
+ return result;
+ }
+ default:
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
+}
+
+inline float StyleBuilderConverter::convertSpacing(StyleResolver& styleResolver, CSSValue& value)
+{
+ auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
+ if (primitiveValue.getValueID() == CSSValueNormal)
+ return 0.f;
+
+ CSSToLengthConversionData conversionData = styleResolver.useSVGZoomRulesForLength() ?
+ styleResolver.state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f)
+ : styleResolver.state().cssToLengthConversionData();
+ return primitiveValue.computeLength<float>(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>