<!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>[167937] 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/167937">167937</a></dd>
<dt>Author</dt> <dd>bjonesbe@adobe.com</dd>
<dt>Date</dt> <dd>2014-04-29 09:36:43 -0700 (Tue, 29 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Wrap CSS length conversion arguments in an object
https://bugs.webkit.org/show_bug.cgi?id=131552

Reviewed by Andreas Kling.

This patch introduces a class CSSToLengthConversionData to wrap the
data required to convert CSS lengths to Lengths. This simplifies the
plumbing that goes on whenever we need to resolve CSS lengths and
makes it easier to update the arguments needed for resolving these (in
particular adding a RenderView for resolving viewport units at style
recalc time; removing the computingFontSize bool also appears
possible).

Note that the zoom argument, which was previously a float in some
places and a double in others is now a float.

This is a port of a Blink patch by timloh@chromium.org.

No new tests, no behavior change.

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* css/BasicShapeFunctions.cpp:
(WebCore::convertToLength):
(WebCore::convertToLengthSize):
(WebCore::convertToCenterCoordinate):
(WebCore::cssValueToBasicShapeRadius):
(WebCore::basicShapeForValue):
* css/BasicShapeFunctions.h:
* css/CSSCalculationValue.cpp:
(WebCore::CSSCalcValue::computeLengthPx):
(WebCore::determineCategory):
* css/CSSCalculationValue.h:
(WebCore::CSSCalcValue::createCalculationValue):
* css/CSSGradientValue.cpp:
(WebCore::CSSGradientValue::addStops):
(WebCore::positionFromValue):
(WebCore::CSSGradientValue::computeEndPoint):
(WebCore::CSSLinearGradientValue::createGradient):
(WebCore::CSSRadialGradientValue::resolveRadius):
(WebCore::CSSRadialGradientValue::createGradient):
* css/CSSGradientValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::computeLength):
(WebCore::CSSPrimitiveValue::computeLengthDouble):
* css/CSSPrimitiveValue.h:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::convertToLength):
* css/CSSToLengthConversionData.cpp: Added.
(WebCore::CSSToLengthConversionData::zoom):
* css/CSSToLengthConversionData.h: Added.
(WebCore::CSSToLengthConversionData::CSSToLengthConversionData):
(WebCore::CSSToLengthConversionData::style):
(WebCore::CSSToLengthConversionData::rootStyle):
(WebCore::CSSToLengthConversionData::computingFontSize):
(WebCore::CSSToLengthConversionData::copyWithAdjustedZoom):
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::CSSToStyleMap):
(WebCore::CSSToStyleMap::mapFillSize):
(WebCore::CSSToStyleMap::mapFillXPosition):
(WebCore::CSSToStyleMap::mapFillYPosition):
(WebCore::CSSToStyleMap::mapNinePieceImageQuad):
* css/CSSToStyleMap.h:
(WebCore::CSSToStyleMap::CSSToStyleMap): Deleted.
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyAuto::applyValue):
(WebCore::ApplyPropertyClip::convertToLength):
(WebCore::ApplyPropertyLength::applyValue):
(WebCore::ApplyPropertyBorderRadius::applyValue):
(WebCore::ApplyPropertyComputeLength::applyValue):
(WebCore::ApplyPropertyFontSize::applyValue):
(WebCore::csstoLengthConversionDataWithTextZoomFactor):
(WebCore::ApplyPropertyMarqueeIncrement::applyValue):
(WebCore::ApplyPropertyLineHeight::applyValue):
(WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyValue):
(WebCore::ApplyPropertyWordSpacing::applyValue):
(WebCore::ApplyPropertyPageSize::mmLength):
(WebCore::ApplyPropertyPageSize::inchLength):
(WebCore::ApplyPropertyPageSize::applyValue):
(WebCore::ApplyPropertyVerticalAlign::applyValue):
(WebCore::ApplyPropertyClipPath::applyValue):
(WebCore::ApplyPropertyShape::applyValue):
(WebCore::ApplyPropertyTextIndent::applyValue):
* css/MediaQueryEvaluator.cpp:
(WebCore::colorMediaFeatureEval):
(WebCore::color_indexMediaFeatureEval):
(WebCore::monochromeMediaFeatureEval):
(WebCore::orientationMediaFeatureEval):
(WebCore::aspect_ratioMediaFeatureEval):
(WebCore::device_aspect_ratioMediaFeatureEval):
(WebCore::device_pixel_ratioMediaFeatureEval):
(WebCore::resolutionMediaFeatureEval):
(WebCore::gridMediaFeatureEval):
(WebCore::computeLength):
(WebCore::device_heightMediaFeatureEval):
(WebCore::device_widthMediaFeatureEval):
(WebCore::heightMediaFeatureEval):
(WebCore::widthMediaFeatureEval):
(WebCore::min_colorMediaFeatureEval):
(WebCore::max_colorMediaFeatureEval):
(WebCore::min_color_indexMediaFeatureEval):
(WebCore::max_color_indexMediaFeatureEval):
(WebCore::min_monochromeMediaFeatureEval):
(WebCore::max_monochromeMediaFeatureEval):
(WebCore::min_aspect_ratioMediaFeatureEval):
(WebCore::max_aspect_ratioMediaFeatureEval):
(WebCore::min_device_aspect_ratioMediaFeatureEval):
(WebCore::max_device_aspect_ratioMediaFeatureEval):
(WebCore::min_device_pixel_ratioMediaFeatureEval):
(WebCore::max_device_pixel_ratioMediaFeatureEval):
(WebCore::min_heightMediaFeatureEval):
(WebCore::max_heightMediaFeatureEval):
(WebCore::min_widthMediaFeatureEval):
(WebCore::max_widthMediaFeatureEval):
(WebCore::min_device_heightMediaFeatureEval):
(WebCore::max_device_heightMediaFeatureEval):
(WebCore::min_device_widthMediaFeatureEval):
(WebCore::max_device_widthMediaFeatureEval):
(WebCore::min_resolutionMediaFeatureEval):
(WebCore::max_resolutionMediaFeatureEval):
(WebCore::animationMediaFeatureEval):
(WebCore::transitionMediaFeatureEval):
(WebCore::transform_2dMediaFeatureEval):
(WebCore::transform_3dMediaFeatureEval):
(WebCore::view_modeMediaFeatureEval):
(WebCore::video_playable_inlineMediaFeatureEval):
(WebCore::hoverMediaFeatureEval):
(WebCore::pointerMediaFeatureEval):
(WebCore::MediaQueryEvaluator::eval):
* css/SVGCSSStyleSelector.cpp:
(WebCore::StyleResolver::applySVGProperty):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::clear):
(WebCore::StyleResolver::State::initForStyleResolve):
(WebCore::StyleResolver::convertToIntLength):
(WebCore::StyleResolver::convertToFloatLength):
(WebCore::createGridTrackBreadth):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::createFilterOperations):
* css/StyleResolver.h:
(WebCore::StyleResolver::State::setStyle):
(WebCore::StyleResolver::State::cssToLengthConversionData):
* css/TransformFunctions.cpp:
(WebCore::convertToFloatLength):
(WebCore::transformsForValue):
* css/TransformFunctions.h:
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::setMatrixValue):
* rendering/RenderThemeIOS.mm:
(WebCore::applyCommonButtonPaddingToStyle):
(WebCore::RenderThemeIOS::adjustButtonStyle):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecssBasicShapeFunctionscpp">trunk/Source/WebCore/css/BasicShapeFunctions.cpp</a></li>
<li><a href="#trunkSourceWebCorecssBasicShapeFunctionsh">trunk/Source/WebCore/css/BasicShapeFunctions.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSCalculationValuecpp">trunk/Source/WebCore/css/CSSCalculationValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSCalculationValueh">trunk/Source/WebCore/css/CSSCalculationValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSGradientValuecpp">trunk/Source/WebCore/css/CSSGradientValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSGradientValueh">trunk/Source/WebCore/css/CSSGradientValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValuecpp">trunk/Source/WebCore/css/CSSPrimitiveValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValueh">trunk/Source/WebCore/css/CSSPrimitiveValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValueMappingsh">trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSToStyleMapcpp">trunk/Source/WebCore/css/CSSToStyleMap.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSToStyleMaph">trunk/Source/WebCore/css/CSSToStyleMap.h</a></li>
<li><a href="#trunkSourceWebCorecssDeprecatedStyleBuildercpp">trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp</a></li>
<li><a href="#trunkSourceWebCorecssMediaQueryEvaluatorcpp">trunk/Source/WebCore/css/MediaQueryEvaluator.cpp</a></li>
<li><a href="#trunkSourceWebCorecssSVGCSSStyleSelectorcpp">trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolverh">trunk/Source/WebCore/css/StyleResolver.h</a></li>
<li><a href="#trunkSourceWebCorecssTransformFunctionscpp">trunk/Source/WebCore/css/TransformFunctions.cpp</a></li>
<li><a href="#trunkSourceWebCorecssTransformFunctionsh">trunk/Source/WebCore/css/TransformFunctions.h</a></li>
<li><a href="#trunkSourceWebCorecssWebKitCSSMatrixcpp">trunk/Source/WebCore/css/WebKitCSSMatrix.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeIOSmm">trunk/Source/WebCore/rendering/RenderThemeIOS.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorecssCSSToLengthConversionDatacpp">trunk/Source/WebCore/css/CSSToLengthConversionData.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSToLengthConversionDatah">trunk/Source/WebCore/css/CSSToLengthConversionData.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -1225,6 +1225,7 @@
</span><span class="cx">     css/CSSStyleSheet.cpp
</span><span class="cx">     css/CSSSupportsRule.cpp
</span><span class="cx">     css/CSSTimingFunctionValue.cpp
</span><ins>+    css/CSSToLengthConversionData.cpp
</ins><span class="cx">     css/CSSToStyleMap.cpp
</span><span class="cx">     css/CSSUnicodeRangeValue.cpp
</span><span class="cx">     css/CSSValue.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/ChangeLog        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -1,3 +1,158 @@
</span><ins>+2014-04-29  Bem Jones-Bey  &lt;bjonesbe@adobe.com&gt;
+
+        Wrap CSS length conversion arguments in an object
+        https://bugs.webkit.org/show_bug.cgi?id=131552
+
+        Reviewed by Andreas Kling.
+
+        This patch introduces a class CSSToLengthConversionData to wrap the
+        data required to convert CSS lengths to Lengths. This simplifies the
+        plumbing that goes on whenever we need to resolve CSS lengths and
+        makes it easier to update the arguments needed for resolving these (in
+        particular adding a RenderView for resolving viewport units at style
+        recalc time; removing the computingFontSize bool also appears
+        possible).
+
+        Note that the zoom argument, which was previously a float in some
+        places and a double in others is now a float.
+
+        This is a port of a Blink patch by timloh@chromium.org.
+
+        No new tests, no behavior change.
+
+        * CMakeLists.txt:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/BasicShapeFunctions.cpp:
+        (WebCore::convertToLength):
+        (WebCore::convertToLengthSize):
+        (WebCore::convertToCenterCoordinate):
+        (WebCore::cssValueToBasicShapeRadius):
+        (WebCore::basicShapeForValue):
+        * css/BasicShapeFunctions.h:
+        * css/CSSCalculationValue.cpp:
+        (WebCore::CSSCalcValue::computeLengthPx):
+        (WebCore::determineCategory):
+        * css/CSSCalculationValue.h:
+        (WebCore::CSSCalcValue::createCalculationValue):
+        * css/CSSGradientValue.cpp:
+        (WebCore::CSSGradientValue::addStops):
+        (WebCore::positionFromValue):
+        (WebCore::CSSGradientValue::computeEndPoint):
+        (WebCore::CSSLinearGradientValue::createGradient):
+        (WebCore::CSSRadialGradientValue::resolveRadius):
+        (WebCore::CSSRadialGradientValue::createGradient):
+        * css/CSSGradientValue.h:
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::computeLength):
+        (WebCore::CSSPrimitiveValue::computeLengthDouble):
+        * css/CSSPrimitiveValue.h:
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::convertToLength):
+        * css/CSSToLengthConversionData.cpp: Added.
+        (WebCore::CSSToLengthConversionData::zoom):
+        * css/CSSToLengthConversionData.h: Added.
+        (WebCore::CSSToLengthConversionData::CSSToLengthConversionData):
+        (WebCore::CSSToLengthConversionData::style):
+        (WebCore::CSSToLengthConversionData::rootStyle):
+        (WebCore::CSSToLengthConversionData::computingFontSize):
+        (WebCore::CSSToLengthConversionData::copyWithAdjustedZoom):
+        * css/CSSToStyleMap.cpp:
+        (WebCore::CSSToStyleMap::CSSToStyleMap):
+        (WebCore::CSSToStyleMap::mapFillSize):
+        (WebCore::CSSToStyleMap::mapFillXPosition):
+        (WebCore::CSSToStyleMap::mapFillYPosition):
+        (WebCore::CSSToStyleMap::mapNinePieceImageQuad):
+        * css/CSSToStyleMap.h:
+        (WebCore::CSSToStyleMap::CSSToStyleMap): Deleted.
+        * css/DeprecatedStyleBuilder.cpp:
+        (WebCore::ApplyPropertyAuto::applyValue):
+        (WebCore::ApplyPropertyClip::convertToLength):
+        (WebCore::ApplyPropertyLength::applyValue):
+        (WebCore::ApplyPropertyBorderRadius::applyValue):
+        (WebCore::ApplyPropertyComputeLength::applyValue):
+        (WebCore::ApplyPropertyFontSize::applyValue):
+        (WebCore::csstoLengthConversionDataWithTextZoomFactor):
+        (WebCore::ApplyPropertyMarqueeIncrement::applyValue):
+        (WebCore::ApplyPropertyLineHeight::applyValue):
+        (WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyValue):
+        (WebCore::ApplyPropertyWordSpacing::applyValue):
+        (WebCore::ApplyPropertyPageSize::mmLength):
+        (WebCore::ApplyPropertyPageSize::inchLength):
+        (WebCore::ApplyPropertyPageSize::applyValue):
+        (WebCore::ApplyPropertyVerticalAlign::applyValue):
+        (WebCore::ApplyPropertyClipPath::applyValue):
+        (WebCore::ApplyPropertyShape::applyValue):
+        (WebCore::ApplyPropertyTextIndent::applyValue):
+        * css/MediaQueryEvaluator.cpp:
+        (WebCore::colorMediaFeatureEval):
+        (WebCore::color_indexMediaFeatureEval):
+        (WebCore::monochromeMediaFeatureEval):
+        (WebCore::orientationMediaFeatureEval):
+        (WebCore::aspect_ratioMediaFeatureEval):
+        (WebCore::device_aspect_ratioMediaFeatureEval):
+        (WebCore::device_pixel_ratioMediaFeatureEval):
+        (WebCore::resolutionMediaFeatureEval):
+        (WebCore::gridMediaFeatureEval):
+        (WebCore::computeLength):
+        (WebCore::device_heightMediaFeatureEval):
+        (WebCore::device_widthMediaFeatureEval):
+        (WebCore::heightMediaFeatureEval):
+        (WebCore::widthMediaFeatureEval):
+        (WebCore::min_colorMediaFeatureEval):
+        (WebCore::max_colorMediaFeatureEval):
+        (WebCore::min_color_indexMediaFeatureEval):
+        (WebCore::max_color_indexMediaFeatureEval):
+        (WebCore::min_monochromeMediaFeatureEval):
+        (WebCore::max_monochromeMediaFeatureEval):
+        (WebCore::min_aspect_ratioMediaFeatureEval):
+        (WebCore::max_aspect_ratioMediaFeatureEval):
+        (WebCore::min_device_aspect_ratioMediaFeatureEval):
+        (WebCore::max_device_aspect_ratioMediaFeatureEval):
+        (WebCore::min_device_pixel_ratioMediaFeatureEval):
+        (WebCore::max_device_pixel_ratioMediaFeatureEval):
+        (WebCore::min_heightMediaFeatureEval):
+        (WebCore::max_heightMediaFeatureEval):
+        (WebCore::min_widthMediaFeatureEval):
+        (WebCore::max_widthMediaFeatureEval):
+        (WebCore::min_device_heightMediaFeatureEval):
+        (WebCore::max_device_heightMediaFeatureEval):
+        (WebCore::min_device_widthMediaFeatureEval):
+        (WebCore::max_device_widthMediaFeatureEval):
+        (WebCore::min_resolutionMediaFeatureEval):
+        (WebCore::max_resolutionMediaFeatureEval):
+        (WebCore::animationMediaFeatureEval):
+        (WebCore::transitionMediaFeatureEval):
+        (WebCore::transform_2dMediaFeatureEval):
+        (WebCore::transform_3dMediaFeatureEval):
+        (WebCore::view_modeMediaFeatureEval):
+        (WebCore::video_playable_inlineMediaFeatureEval):
+        (WebCore::hoverMediaFeatureEval):
+        (WebCore::pointerMediaFeatureEval):
+        (WebCore::MediaQueryEvaluator::eval):
+        * css/SVGCSSStyleSelector.cpp:
+        (WebCore::StyleResolver::applySVGProperty):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::State::clear):
+        (WebCore::StyleResolver::State::initForStyleResolve):
+        (WebCore::StyleResolver::convertToIntLength):
+        (WebCore::StyleResolver::convertToFloatLength):
+        (WebCore::createGridTrackBreadth):
+        (WebCore::StyleResolver::applyProperty):
+        (WebCore::StyleResolver::createFilterOperations):
+        * css/StyleResolver.h:
+        (WebCore::StyleResolver::State::setStyle):
+        (WebCore::StyleResolver::State::cssToLengthConversionData):
+        * css/TransformFunctions.cpp:
+        (WebCore::convertToFloatLength):
+        (WebCore::transformsForValue):
+        * css/TransformFunctions.h:
+        * css/WebKitCSSMatrix.cpp:
+        (WebCore::WebKitCSSMatrix::setMatrixValue):
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::applyCommonButtonPaddingToStyle):
+        (WebCore::RenderThemeIOS::adjustButtonStyle):
+
</ins><span class="cx"> 2014-04-29  Zoltan Horvath  &lt;zoltan@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Shapes] complex calc args for inset round vanish
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -9522,6 +9522,7 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\css\CSSToStyleMap.cpp&quot; /&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\css\CSSToLengthConversionData.cpp&quot; /&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\css\CSSUnicodeRangeValue.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="lines">@@ -19913,6 +19914,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\css\CSSSupportsRule.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\css\CSSTimingFunctionValue.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\css\CSSToStyleMap.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\css\CSSToLengthConversionData.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\css\CSSUnicodeRangeValue.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\css\CSSUnknownRule.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\css\CSSValue.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -3576,6 +3576,8 @@
</span><span class="cx">                 9A1B6F97158869C80011A8C4 /* JSDOMStringListCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1B6F96158869C80011A8C4 /* JSDOMStringListCustom.cpp */; };
</span><span class="cx">                 9A528E8317D7F52F00AA9518 /* FloatingObjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A528E8117D7F52F00AA9518 /* FloatingObjects.cpp */; };
</span><span class="cx">                 9A528E8417D7F52F00AA9518 /* FloatingObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A528E8217D7F52F00AA9518 /* FloatingObjects.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                9AB1F38018E2489A00534743 /* CSSToLengthConversionData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AB1F37E18E2489A00534743 /* CSSToLengthConversionData.h */; };
+                9AB1F38118E2489A00534743 /* CSSToLengthConversionData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AB1F37F18E2489A00534743 /* CSSToLengthConversionData.cpp */; };
</ins><span class="cx">                 9B1AB07C1648C7C40051F3F2 /* JSHTMLFormControlsCollectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B1AB07B1648C7C40051F3F2 /* JSHTMLFormControlsCollectionCustom.cpp */; };
</span><span class="cx">                 9B24DE8E15194B9500C59C27 /* HTMLBDIElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B24DE8C15194B9500C59C27 /* HTMLBDIElement.h */; };
</span><span class="cx">                 9B2D8A7914997CCF00ECEF3E /* UndoStep.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B2D8A7814997CCF00ECEF3E /* UndoStep.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -10642,6 +10644,8 @@
</span><span class="cx">                 9A1B6F96158869C80011A8C4 /* JSDOMStringListCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMStringListCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9A528E8117D7F52F00AA9518 /* FloatingObjects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FloatingObjects.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9A528E8217D7F52F00AA9518 /* FloatingObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatingObjects.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                9AB1F37E18E2489A00534743 /* CSSToLengthConversionData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSToLengthConversionData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9AB1F37F18E2489A00534743 /* CSSToLengthConversionData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSToLengthConversionData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 9B1AB0791648C69D0051F3F2 /* HTMLFormControlsCollection.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = HTMLFormControlsCollection.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9B1AB07B1648C7C40051F3F2 /* JSHTMLFormControlsCollectionCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFormControlsCollectionCustom.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9B24DE8C15194B9500C59C27 /* HTMLBDIElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLBDIElement.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -21749,6 +21753,8 @@
</span><span class="cx">                                 FC63BDB2167AABAC00F9380F /* CSSSupportsRule.idl */,
</span><span class="cx">                                 BC80C9850CD294EE00A0B7B3 /* CSSTimingFunctionValue.cpp */,
</span><span class="cx">                                 BC80C9860CD294EE00A0B7B3 /* CSSTimingFunctionValue.h */,
</span><ins>+                                9AB1F37E18E2489A00534743 /* CSSToLengthConversionData.h */,
+                                9AB1F37F18E2489A00534743 /* CSSToLengthConversionData.cpp */,
</ins><span class="cx">                                 A882DA1F1593846A000115ED /* CSSToStyleMap.cpp */,
</span><span class="cx">                                 A882DA221593848D000115ED /* CSSToStyleMap.h */,
</span><span class="cx">                                 371F53E80D2704F900ECE0D5 /* CSSUnicodeRangeValue.cpp */,
</span><span class="lines">@@ -24140,6 +24146,7 @@
</span><span class="cx">                                 43107BE218CC19DE00CC18E8 /* SelectorPseudoTypeMap.h in Headers */,
</span><span class="cx">                                 D66817FB166FE6D700FA07B4 /* HTMLTemplateElement.h in Headers */,
</span><span class="cx">                                 A81369D6097374F600D74463 /* HTMLTextAreaElement.h in Headers */,
</span><ins>+                                9AB1F38018E2489A00534743 /* CSSToLengthConversionData.h in Headers */,
</ins><span class="cx">                                 9BC6C21B13CCC97B008E0337 /* HTMLTextFormControlElement.h in Headers */,
</span><span class="cx">                                 A871DC280A15205700B12A68 /* HTMLTitleElement.h in Headers */,
</span><span class="cx">                                 977B3878122883E900B81FF8 /* HTMLTokenizer.h in Headers */,
</span><span class="lines">@@ -27766,6 +27773,7 @@
</span><span class="cx">                                 E1F80B8A183172A2007885C3 /* JSCryptoKeyPairCustom.cpp in Sources */,
</span><span class="cx">                                 E125F85118283A5600D84CD9 /* JSCryptoKeySerializationJWK.cpp in Sources */,
</span><span class="cx">                                 E125F83D182411E700D84CD9 /* JSCryptoOperationData.cpp in Sources */,
</span><ins>+                                9AB1F38118E2489A00534743 /* CSSToLengthConversionData.cpp in Sources */,
</ins><span class="cx">                                 BC46C1FA0C0DDC8F0020CFC3 /* JSCSSCharsetRule.cpp in Sources */,
</span><span class="cx">                                 409EBDC516B7F3CA00CBA3FC /* JSCSSFontFaceLoadEvent.cpp in Sources */,
</span><span class="cx">                                 BC46C1FC0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssBasicShapeFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/BasicShapeFunctions.cpp (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/BasicShapeFunctions.cpp        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/BasicShapeFunctions.cpp        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -127,21 +127,21 @@
</span><span class="cx">     return pool.createValue(basicShapeValue.release());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Length convertToLength(const RenderStyle* style, const RenderStyle* rootStyle, CSSPrimitiveValue* value)
</del><ins>+static Length convertToLength(const CSSToLengthConversionData&amp; conversionData, CSSPrimitiveValue* value)
</ins><span class="cx"> {
</span><del>-    return value-&gt;convertToLength&lt;FixedIntegerConversion | FixedFloatConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion&gt;(style, rootStyle, style-&gt;effectiveZoom());
</del><ins>+    return value-&gt;convertToLength&lt;FixedIntegerConversion | FixedFloatConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion&gt;(conversionData);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static LengthSize convertToLengthSize(const RenderStyle* style, const RenderStyle* rootStyle, CSSPrimitiveValue* value)
</del><ins>+static LengthSize convertToLengthSize(const CSSToLengthConversionData&amp; conversionData, CSSPrimitiveValue* value)
</ins><span class="cx"> {
</span><span class="cx">     if (!value)
</span><span class="cx">         return LengthSize(Length(0, Fixed), Length(0, Fixed));
</span><span class="cx"> 
</span><span class="cx">     Pair* pair = value-&gt;getPairValue();
</span><del>-    return LengthSize(convertToLength(style, rootStyle, pair-&gt;first()), convertToLength(style, rootStyle, pair-&gt;second()));
</del><ins>+    return LengthSize(convertToLength(conversionData, pair-&gt;first()), convertToLength(conversionData, pair-&gt;second()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static BasicShapeCenterCoordinate convertToCenterCoordinate(const RenderStyle* style, const RenderStyle* rootStyle, CSSPrimitiveValue* value)
</del><ins>+static BasicShapeCenterCoordinate convertToCenterCoordinate(const CSSToLengthConversionData&amp; conversionData, CSSPrimitiveValue* value)
</ins><span class="cx"> {
</span><span class="cx">     BasicShapeCenterCoordinate::Direction direction;
</span><span class="cx">     Length offset = Length(0, Fixed);
</span><span class="lines">@@ -153,9 +153,9 @@
</span><span class="cx">         keyword = value-&gt;getValueID();
</span><span class="cx">     else if (Pair* pair = value-&gt;getPairValue()) {
</span><span class="cx">         keyword = pair-&gt;first()-&gt;getValueID();
</span><del>-        offset = convertToLength(style, rootStyle, pair-&gt;second());
</del><ins>+        offset = convertToLength(conversionData, pair-&gt;second());
</ins><span class="cx">     } else
</span><del>-        offset = convertToLength(style, rootStyle, value);
</del><ins>+        offset = convertToLength(conversionData, value);
</ins><span class="cx"> 
</span><span class="cx">     switch (keyword) {
</span><span class="cx">     case CSSValueTop:
</span><span class="lines">@@ -179,7 +179,7 @@
</span><span class="cx">     return BasicShapeCenterCoordinate(direction, offset);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static BasicShapeRadius cssValueToBasicShapeRadius(const RenderStyle* style, const RenderStyle* rootStyle, PassRefPtr&lt;CSSPrimitiveValue&gt; radius)
</del><ins>+static BasicShapeRadius cssValueToBasicShapeRadius(const CSSToLengthConversionData&amp; conversionData, PassRefPtr&lt;CSSPrimitiveValue&gt; radius)
</ins><span class="cx"> {
</span><span class="cx">     if (!radius)
</span><span class="cx">         return BasicShapeRadius(BasicShapeRadius::ClosestSide);
</span><span class="lines">@@ -196,10 +196,10 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return BasicShapeRadius(convertToLength(style, rootStyle, radius.get()));
</del><ins>+    return BasicShapeRadius(convertToLength(conversionData, radius.get()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;BasicShape&gt; basicShapeForValue(const RenderStyle* style, const RenderStyle* rootStyle, const CSSBasicShape* basicShapeValue)
</del><ins>+PassRefPtr&lt;BasicShape&gt; basicShapeForValue(const CSSToLengthConversionData&amp; conversionData, const CSSBasicShape* basicShapeValue)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;BasicShape&gt; basicShape;
</span><span class="cx"> 
</span><span class="lines">@@ -208,9 +208,9 @@
</span><span class="cx">         const CSSBasicShapeCircle* circleValue = static_cast&lt;const CSSBasicShapeCircle *&gt;(basicShapeValue);
</span><span class="cx">         RefPtr&lt;BasicShapeCircle&gt; circle = BasicShapeCircle::create();
</span><span class="cx"> 
</span><del>-        circle-&gt;setCenterX(convertToCenterCoordinate(style, rootStyle, circleValue-&gt;centerX()));
-        circle-&gt;setCenterY(convertToCenterCoordinate(style, rootStyle, circleValue-&gt;centerY()));
-        circle-&gt;setRadius(cssValueToBasicShapeRadius(style, rootStyle, circleValue-&gt;radius()));
</del><ins>+        circle-&gt;setCenterX(convertToCenterCoordinate(conversionData, circleValue-&gt;centerX()));
+        circle-&gt;setCenterY(convertToCenterCoordinate(conversionData, circleValue-&gt;centerY()));
+        circle-&gt;setRadius(cssValueToBasicShapeRadius(conversionData, circleValue-&gt;radius()));
</ins><span class="cx"> 
</span><span class="cx">         basicShape = circle.release();
</span><span class="cx">         break;
</span><span class="lines">@@ -219,11 +219,11 @@
</span><span class="cx">         const CSSBasicShapeEllipse* ellipseValue = static_cast&lt;const CSSBasicShapeEllipse *&gt;(basicShapeValue);
</span><span class="cx">         RefPtr&lt;BasicShapeEllipse&gt; ellipse = BasicShapeEllipse::create();
</span><span class="cx"> 
</span><del>-        ellipse-&gt;setCenterX(convertToCenterCoordinate(style, rootStyle, ellipseValue-&gt;centerX()));
-        ellipse-&gt;setCenterY(convertToCenterCoordinate(style, rootStyle, ellipseValue-&gt;centerY()));
</del><ins>+        ellipse-&gt;setCenterX(convertToCenterCoordinate(conversionData, ellipseValue-&gt;centerX()));
+        ellipse-&gt;setCenterY(convertToCenterCoordinate(conversionData, ellipseValue-&gt;centerY()));
</ins><span class="cx"> 
</span><del>-        ellipse-&gt;setRadiusX(cssValueToBasicShapeRadius(style, rootStyle, ellipseValue-&gt;radiusX()));
-        ellipse-&gt;setRadiusY(cssValueToBasicShapeRadius(style, rootStyle, ellipseValue-&gt;radiusY()));
</del><ins>+        ellipse-&gt;setRadiusX(cssValueToBasicShapeRadius(conversionData, ellipseValue-&gt;radiusX()));
+        ellipse-&gt;setRadiusY(cssValueToBasicShapeRadius(conversionData, ellipseValue-&gt;radiusY()));
</ins><span class="cx"> 
</span><span class="cx">         basicShape = ellipse.release();
</span><span class="cx">         break;
</span><span class="lines">@@ -235,7 +235,7 @@
</span><span class="cx">         polygon-&gt;setWindRule(polygonValue-&gt;windRule());
</span><span class="cx">         const Vector&lt;RefPtr&lt;CSSPrimitiveValue&gt;&gt;&amp; values = polygonValue-&gt;values();
</span><span class="cx">         for (unsigned i = 0; i &lt; values.size(); i += 2)
</span><del>-            polygon-&gt;appendPoint(convertToLength(style, rootStyle, values.at(i).get()), convertToLength(style, rootStyle, values.at(i + 1).get()));
</del><ins>+            polygon-&gt;appendPoint(convertToLength(conversionData, values.at(i).get()), convertToLength(conversionData, values.at(i + 1).get()));
</ins><span class="cx"> 
</span><span class="cx">         basicShape = polygon.release();
</span><span class="cx">         break;
</span><span class="lines">@@ -244,15 +244,15 @@
</span><span class="cx">         const CSSBasicShapeInset* rectValue = static_cast&lt;const CSSBasicShapeInset* &gt;(basicShapeValue);
</span><span class="cx">         RefPtr&lt;BasicShapeInset&gt; rect = BasicShapeInset::create();
</span><span class="cx"> 
</span><del>-        rect-&gt;setTop(convertToLength(style, rootStyle, rectValue-&gt;top()));
-        rect-&gt;setRight(convertToLength(style, rootStyle, rectValue-&gt;right()));
-        rect-&gt;setBottom(convertToLength(style, rootStyle, rectValue-&gt;bottom()));
-        rect-&gt;setLeft(convertToLength(style, rootStyle, rectValue-&gt;left()));
</del><ins>+        rect-&gt;setTop(convertToLength(conversionData, rectValue-&gt;top()));
+        rect-&gt;setRight(convertToLength(conversionData, rectValue-&gt;right()));
+        rect-&gt;setBottom(convertToLength(conversionData, rectValue-&gt;bottom()));
+        rect-&gt;setLeft(convertToLength(conversionData, rectValue-&gt;left()));
</ins><span class="cx"> 
</span><del>-        rect-&gt;setTopLeftRadius(convertToLengthSize(style, rootStyle, rectValue-&gt;topLeftRadius()));
-        rect-&gt;setTopRightRadius(convertToLengthSize(style, rootStyle, rectValue-&gt;topRightRadius()));
-        rect-&gt;setBottomRightRadius(convertToLengthSize(style, rootStyle, rectValue-&gt;bottomRightRadius()));
-        rect-&gt;setBottomLeftRadius(convertToLengthSize(style, rootStyle, rectValue-&gt;bottomLeftRadius()));
</del><ins>+        rect-&gt;setTopLeftRadius(convertToLengthSize(conversionData, rectValue-&gt;topLeftRadius()));
+        rect-&gt;setTopRightRadius(convertToLengthSize(conversionData, rectValue-&gt;topRightRadius()));
+        rect-&gt;setBottomRightRadius(convertToLengthSize(conversionData, rectValue-&gt;bottomRightRadius()));
+        rect-&gt;setBottomLeftRadius(convertToLengthSize(conversionData, rectValue-&gt;bottomLeftRadius()));
</ins><span class="cx"> 
</span><span class="cx">         basicShape = rect.release();
</span><span class="cx">         break;
</span></span></pre></div>
<a id="trunkSourceWebCorecssBasicShapeFunctionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/BasicShapeFunctions.h (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/BasicShapeFunctions.h        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/BasicShapeFunctions.h        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -37,11 +37,12 @@
</span><span class="cx"> 
</span><span class="cx"> class CSSBasicShape;
</span><span class="cx"> class CSSPrimitiveValue;
</span><ins>+class CSSToLengthConversionData;
</ins><span class="cx"> class CSSValue;
</span><span class="cx"> class RenderStyle;
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;CSSValue&gt; valueForBasicShape(const RenderStyle*, const BasicShape*);
</span><del>-PassRefPtr&lt;BasicShape&gt; basicShapeForValue(const RenderStyle*, const RenderStyle* rootStyle, const CSSBasicShape*);
</del><ins>+PassRefPtr&lt;BasicShape&gt; basicShapeForValue(const CSSToLengthConversionData&amp;, const CSSBasicShape*);
</ins><span class="cx"> 
</span><span class="cx"> float floatValueForCenterCoordinate(const BasicShapeCenterCoordinate&amp;, float);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSCalculationValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSCalculationValue.cpp (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCalculationValue.cpp        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/CSSCalculationValue.cpp        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -171,9 +171,9 @@
</span><span class="cx">     return clampToPermittedRange(m_expression-&gt;doubleValue());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-double CSSCalcValue::computeLengthPx(const RenderStyle* currentStyle, const RenderStyle* rootStyle, double multiplier, bool computingFontSize) const
</del><ins>+double CSSCalcValue::computeLengthPx(const CSSToLengthConversionData&amp; conversionData) const
</ins><span class="cx"> {
</span><del>-    return clampToPermittedRange(m_expression-&gt;computeLengthPx(currentStyle, rootStyle, multiplier, computingFontSize));
</del><ins>+    return clampToPermittedRange(m_expression-&gt;computeLengthPx(conversionData));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class CSSCalcPrimitiveValue final : public CSSCalcExpressionNode {
</span><span class="lines">@@ -202,18 +202,18 @@
</span><span class="cx">         return m_value-&gt;cssText();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual std::unique_ptr&lt;CalcExpressionNode&gt; createCalcExpression(const RenderStyle* style, const RenderStyle* rootStyle, double zoom) const override
</del><ins>+    virtual std::unique_ptr&lt;CalcExpressionNode&gt; createCalcExpression(const CSSToLengthConversionData&amp; conversionData) const override
</ins><span class="cx">     {
</span><span class="cx">         switch (category()) {
</span><span class="cx">         case CalcNumber:
</span><span class="cx">             return std::make_unique&lt;CalcExpressionNumber&gt;(m_value-&gt;getFloatValue());
</span><span class="cx">         case CalcLength:
</span><del>-            return std::make_unique&lt;CalcExpressionLength&gt;(Length(m_value-&gt;computeLength&lt;float&gt;(style, rootStyle, zoom), WebCore::Fixed));
</del><ins>+            return std::make_unique&lt;CalcExpressionLength&gt;(Length(m_value-&gt;computeLength&lt;float&gt;(conversionData), WebCore::Fixed));
</ins><span class="cx">         case CalcPercent:
</span><span class="cx">         case CalcPercentLength: {
</span><span class="cx">             CSSPrimitiveValue* primitiveValue = m_value.get();
</span><span class="cx">             return std::make_unique&lt;CalcExpressionLength&gt;(primitiveValue
</span><del>-                ? primitiveValue-&gt;convertToLength&lt;FixedFloatConversion | PercentConversion | FractionConversion&gt;(style, rootStyle, zoom) : Length(Undefined));
</del><ins>+                ? primitiveValue-&gt;convertToLength&lt;FixedFloatConversion | PercentConversion | FractionConversion&gt;(conversionData) : Length(Undefined));
</ins><span class="cx">         }
</span><span class="cx">         // Only types that could be part of a Length expression can be converted
</span><span class="cx">         // to a CalcExpressionNode. CalcPercentNumber makes no sense as a Length.
</span><span class="lines">@@ -232,11 +232,11 @@
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual double computeLengthPx(const RenderStyle* currentStyle, const RenderStyle* rootStyle, double multiplier, bool computingFontSize) const override
</del><ins>+    virtual double computeLengthPx(const CSSToLengthConversionData&amp; conversionData) const override
</ins><span class="cx">     {
</span><span class="cx">         switch (category()) {
</span><span class="cx">         case CalcLength:
</span><del>-            return m_value-&gt;computeLength&lt;double&gt;(currentStyle, rootStyle, multiplier, computingFontSize);
</del><ins>+            return m_value-&gt;computeLength&lt;double&gt;(conversionData);
</ins><span class="cx">         case CalcPercent:
</span><span class="cx">         case CalcNumber:
</span><span class="cx">             return m_value-&gt;getDoubleValue();
</span><span class="lines">@@ -394,12 +394,12 @@
</span><span class="cx">         return !doubleValue();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual std::unique_ptr&lt;CalcExpressionNode&gt; createCalcExpression(const RenderStyle* style, const RenderStyle* rootStyle, double zoom) const override
</del><ins>+    virtual std::unique_ptr&lt;CalcExpressionNode&gt; createCalcExpression(const CSSToLengthConversionData&amp; conversionData) const override
</ins><span class="cx">     {
</span><del>-        std::unique_ptr&lt;CalcExpressionNode&gt; left(m_leftSide-&gt;createCalcExpression(style, rootStyle, zoom));
</del><ins>+        std::unique_ptr&lt;CalcExpressionNode&gt; left(m_leftSide-&gt;createCalcExpression(conversionData));
</ins><span class="cx">         if (!left)
</span><span class="cx">             return nullptr;
</span><del>-        std::unique_ptr&lt;CalcExpressionNode&gt; right(m_rightSide-&gt;createCalcExpression(style, rootStyle, zoom));
</del><ins>+        std::unique_ptr&lt;CalcExpressionNode&gt; right(m_rightSide-&gt;createCalcExpression(conversionData));
</ins><span class="cx">         if (!right)
</span><span class="cx">             return nullptr;
</span><span class="cx">         return std::make_unique&lt;CalcExpressionBinaryOperation&gt;(std::move(left), std::move(right), m_operator);
</span><span class="lines">@@ -410,10 +410,10 @@
</span><span class="cx">         return evaluate(m_leftSide-&gt;doubleValue(), m_rightSide-&gt;doubleValue());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    virtual double computeLengthPx(const RenderStyle* currentStyle, const RenderStyle* rootStyle, double multiplier, bool computingFontSize) const override
</del><ins>+    virtual double computeLengthPx(const CSSToLengthConversionData&amp; conversionData) const override
</ins><span class="cx">     {
</span><del>-        const double leftValue = m_leftSide-&gt;computeLengthPx(currentStyle, rootStyle, multiplier, computingFontSize);
-        const double rightValue = m_rightSide-&gt;computeLengthPx(currentStyle, rootStyle, multiplier, computingFontSize);
</del><ins>+        const double leftValue = m_leftSide-&gt;computeLengthPx(conversionData);
+        const double rightValue = m_rightSide-&gt;computeLengthPx(conversionData);
</ins><span class="cx">         return evaluate(leftValue, rightValue);
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSCalculationValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSCalculationValue.h (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCalculationValue.h        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/CSSCalculationValue.h        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class CSSToLengthConversionData;
</ins><span class="cx"> class RenderStyle;
</span><span class="cx"> 
</span><span class="cx"> enum CalculationCategory {
</span><span class="lines">@@ -57,9 +58,9 @@
</span><span class="cx"> 
</span><span class="cx">     virtual ~CSSCalcExpressionNode() { }
</span><span class="cx">     virtual bool isZero() const = 0;
</span><del>-    virtual std::unique_ptr&lt;CalcExpressionNode&gt; createCalcExpression(const RenderStyle*, const RenderStyle* rootStyle, double zoom = 1.0) const = 0;
</del><ins>+    virtual std::unique_ptr&lt;CalcExpressionNode&gt; createCalcExpression(const CSSToLengthConversionData&amp;) const = 0;
</ins><span class="cx">     virtual double doubleValue() const = 0;
</span><del>-    virtual double computeLengthPx(const RenderStyle* currentStyle, const RenderStyle* rootStyle, double multiplier = 1.0, bool computingFontSize = false) const = 0;
</del><ins>+    virtual double computeLengthPx(const CSSToLengthConversionData&amp;) const = 0;
</ins><span class="cx">     virtual String customCSSText() const = 0;
</span><span class="cx">     virtual bool equals(const CSSCalcExpressionNode&amp; other) const { return m_category == other.m_category &amp;&amp; m_isInteger == other.m_isInteger; }
</span><span class="cx">     virtual Type type() const = 0;
</span><span class="lines">@@ -89,9 +90,9 @@
</span><span class="cx">     bool isInt() const { return m_expression-&gt;isInteger(); }
</span><span class="cx">     double doubleValue() const;
</span><span class="cx">     bool isNegative() const { return m_expression-&gt;doubleValue() &lt; 0; }
</span><del>-    double computeLengthPx(const RenderStyle* currentStyle, const RenderStyle* rootStyle, double multiplier = 1.0, bool computingFontSize = false) const;
</del><ins>+    double computeLengthPx(const CSSToLengthConversionData&amp;) const;
</ins><span class="cx"> 
</span><del>-    PassRef&lt;CalculationValue&gt; createCalculationValue(const RenderStyle* currentStyle, const RenderStyle* rootStyle, double zoom = 1.0) const;
</del><ins>+    PassRef&lt;CalculationValue&gt; createCalculationValue(const CSSToLengthConversionData&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     String customCSSText() const;
</span><span class="cx">     bool equals(const CSSCalcValue&amp;) const;
</span><span class="lines">@@ -112,9 +113,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline PassRef&lt;CalculationValue&gt; CSSCalcValue::createCalculationValue(const RenderStyle* style, const RenderStyle* rootStyle, double zoom) const
</del><ins>+inline PassRef&lt;CalculationValue&gt; CSSCalcValue::createCalculationValue(const CSSToLengthConversionData&amp; conversionData) const
</ins><span class="cx"> {
</span><del>-    return CalculationValue::create(m_expression-&gt;createCalcExpression(style, rootStyle, zoom),
</del><ins>+    return CalculationValue::create(m_expression-&gt;createCalcExpression(conversionData),
</ins><span class="cx">         m_shouldClampToNonNegative ? CalculationRangeNonNegative : CalculationRangeAll);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGradientValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGradientValue.cpp (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGradientValue.cpp        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/CSSGradientValue.cpp        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include &quot;CSSGradientValue.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CSSCalculationValue.h&quot;
</span><ins>+#include &quot;CSSToLengthConversionData.h&quot;
</ins><span class="cx"> #include &quot;CSSValueKeywords.h&quot;
</span><span class="cx"> #include &quot;FloatSize.h&quot;
</span><span class="cx"> #include &quot;FloatSizeHash.h&quot;
</span><span class="lines">@@ -128,10 +129,8 @@
</span><span class="cx">     return result.release();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CSSGradientValue::addStops(Gradient* gradient, RenderElement* renderer, const RenderStyle&amp; rootStyle, float maxLengthForRepeat)
</del><ins>+void CSSGradientValue::addStops(Gradient* gradient, const CSSToLengthConversionData&amp; conversionData, float maxLengthForRepeat)
</ins><span class="cx"> {
</span><del>-    RenderStyle&amp; style = renderer-&gt;style();
-
</del><span class="cx">     if (m_gradientType == CSSDeprecatedLinearGradient || m_gradientType == CSSDeprecatedRadialGradient) {
</span><span class="cx">         sortStopsIfNeeded();
</span><span class="cx"> 
</span><span class="lines">@@ -181,9 +180,9 @@
</span><span class="cx">                 }
</span><span class="cx">                 float length;
</span><span class="cx">                 if (stop.m_position-&gt;isLength())
</span><del>-                    length = stop.m_position-&gt;computeLength&lt;float&gt;(&amp;style, &amp;rootStyle, style.effectiveZoom());
</del><ins>+                    length = stop.m_position-&gt;computeLength&lt;float&gt;(conversionData);
</ins><span class="cx">                 else {
</span><del>-                    Ref&lt;CalculationValue&gt; calculationValue { stop.m_position-&gt;cssCalcValue()-&gt;createCalculationValue(&amp;style, &amp;rootStyle, style.effectiveZoom()) };
</del><ins>+                    Ref&lt;CalculationValue&gt; calculationValue { stop.m_position-&gt;cssCalcValue()-&gt;createCalculationValue(conversionData) };
</ins><span class="cx">                     length = calculationValue-&gt;evaluate(gradientLength);
</span><span class="cx">                 }
</span><span class="cx">                 stops[i].offset = (gradientLength &gt; 0) ? length / gradientLength : 0;
</span><span class="lines">@@ -392,19 +391,17 @@
</span><span class="cx">     gradient-&gt;setStopsSorted(true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static float positionFromValue(CSSPrimitiveValue* value, const RenderStyle&amp; style, const RenderStyle&amp; rootStyle, const FloatSize&amp; size, bool isHorizontal)
</del><ins>+static float positionFromValue(CSSPrimitiveValue* value, const CSSToLengthConversionData&amp; conversionData, const FloatSize&amp; size, bool isHorizontal)
</ins><span class="cx"> {
</span><del>-    float zoomFactor = style.effectiveZoom();
-
</del><span class="cx">     if (value-&gt;isNumber())
</span><del>-        return value-&gt;getFloatValue() * zoomFactor;
</del><ins>+        return value-&gt;getFloatValue() * conversionData.zoom();
</ins><span class="cx"> 
</span><span class="cx">     int edgeDistance = isHorizontal ? size.width() : size.height();
</span><span class="cx">     if (value-&gt;isPercentage())
</span><span class="cx">         return value-&gt;getFloatValue() / 100.f * edgeDistance;
</span><span class="cx"> 
</span><span class="cx">     if (value-&gt;isCalculatedPercentageWithLength()) {
</span><del>-        Ref&lt;CalculationValue&gt; calculationValue { value-&gt;cssCalcValue()-&gt;createCalculationValue(&amp;style, &amp;rootStyle, style.effectiveZoom()) };
</del><ins>+        Ref&lt;CalculationValue&gt; calculationValue { value-&gt;cssCalcValue()-&gt;createCalculationValue(conversionData) };
</ins><span class="cx">         return calculationValue-&gt;evaluate(edgeDistance);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -425,18 +422,18 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return value-&gt;computeLength&lt;float&gt;(&amp;style, &amp;rootStyle, zoomFactor);
</del><ins>+    return value-&gt;computeLength&lt;float&gt;(conversionData);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-FloatPoint CSSGradientValue::computeEndPoint(CSSPrimitiveValue* horizontal, CSSPrimitiveValue* vertical, const RenderStyle&amp; style, const RenderStyle&amp; rootStyle, const FloatSize&amp; size)
</del><ins>+FloatPoint CSSGradientValue::computeEndPoint(CSSPrimitiveValue* horizontal, CSSPrimitiveValue* vertical, const CSSToLengthConversionData&amp; conversionData, const FloatSize&amp; size)
</ins><span class="cx"> {
</span><span class="cx">     FloatPoint result;
</span><span class="cx"> 
</span><span class="cx">     if (horizontal)
</span><del>-        result.setX(positionFromValue(horizontal, style, rootStyle, size, true));
</del><ins>+        result.setX(positionFromValue(horizontal, conversionData, size, true));
</ins><span class="cx"> 
</span><span class="cx">     if (vertical)
</span><del>-        result.setY(positionFromValue(vertical, style, rootStyle, size, false));
</del><ins>+        result.setY(positionFromValue(vertical, conversionData, size, false));
</ins><span class="cx"> 
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="lines">@@ -647,7 +644,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!size.isEmpty());
</span><span class="cx"> 
</span><del>-    RenderStyle&amp; rootStyle = *renderer-&gt;document().documentElement()-&gt;renderStyle();
</del><ins>+    CSSToLengthConversionData conversionData(&amp;renderer-&gt;style(), renderer-&gt;document().documentElement()-&gt;renderStyle());
</ins><span class="cx"> 
</span><span class="cx">     FloatPoint firstPoint;
</span><span class="cx">     FloatPoint secondPoint;
</span><span class="lines">@@ -657,9 +654,9 @@
</span><span class="cx">     } else {
</span><span class="cx">         switch (m_gradientType) {
</span><span class="cx">         case CSSDeprecatedLinearGradient:
</span><del>-            firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer-&gt;style(), rootStyle, size);
</del><ins>+            firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), conversionData, size);
</ins><span class="cx">             if (m_secondX || m_secondY)
</span><del>-                secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), renderer-&gt;style(), rootStyle, size);
</del><ins>+                secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), conversionData, size);
</ins><span class="cx">             else {
</span><span class="cx">                 if (m_firstX)
</span><span class="cx">                     secondPoint.setX(size.width() - firstPoint.x());
</span><span class="lines">@@ -668,7 +665,7 @@
</span><span class="cx">             }
</span><span class="cx">             break;
</span><span class="cx">         case CSSPrefixedLinearGradient:
</span><del>-            firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer-&gt;style(), rootStyle, size);
</del><ins>+            firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), conversionData, size);
</ins><span class="cx">             if (m_firstX)
</span><span class="cx">                 secondPoint.setX(size.width() - firstPoint.x());
</span><span class="cx">             if (m_firstY)
</span><span class="lines">@@ -687,7 +684,7 @@
</span><span class="cx">                 float angle = 90 - rad2deg(atan2(rise, run));
</span><span class="cx">                 endPointsFromAngle(angle, size, firstPoint, secondPoint, m_gradientType);
</span><span class="cx">             } else if (m_firstX || m_firstY) { 
</span><del>-                secondPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer-&gt;style(), rootStyle, size);
</del><ins>+                secondPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), conversionData, size);
</ins><span class="cx">                 if (m_firstX)
</span><span class="cx">                     firstPoint.setX(size.width() - secondPoint.x());
</span><span class="cx">                 if (m_firstY)
</span><span class="lines">@@ -704,7 +701,7 @@
</span><span class="cx">     RefPtr&lt;Gradient&gt; gradient = Gradient::create(firstPoint, secondPoint);
</span><span class="cx"> 
</span><span class="cx">     // Now add the stops.
</span><del>-    addStops(gradient.get(), renderer, rootStyle, 1);
</del><ins>+    addStops(gradient.get(), conversionData, 1);
</ins><span class="cx"> 
</span><span class="cx">     return gradient.release();
</span><span class="cx"> }
</span><span class="lines">@@ -891,17 +888,15 @@
</span><span class="cx">     return result.toString();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, const RenderStyle&amp; style, const RenderStyle&amp; rootStyle, float* widthOrHeight)
</del><ins>+float CSSRadialGradientValue::resolveRadius(CSSPrimitiveValue* radius, const CSSToLengthConversionData&amp; conversionData, float* widthOrHeight)
</ins><span class="cx"> {
</span><del>-    float zoomFactor = style.effectiveZoom();
-
</del><span class="cx">     float result = 0;
</span><span class="cx">     if (radius-&gt;isNumber()) // Can the radius be a percentage?
</span><del>-        result = radius-&gt;getFloatValue() * zoomFactor;
</del><ins>+        result = radius-&gt;getFloatValue() * conversionData.zoom();
</ins><span class="cx">     else if (widthOrHeight &amp;&amp; radius-&gt;isPercentage())
</span><span class="cx">         result = *widthOrHeight * radius-&gt;getFloatValue() / 100;
</span><span class="cx">     else
</span><del>-        result = radius-&gt;computeLength&lt;float&gt;(&amp;style, &amp;rootStyle, zoomFactor);
</del><ins>+        result = radius-&gt;computeLength&lt;float&gt;(conversionData);
</ins><span class="cx"> 
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="lines">@@ -987,15 +982,15 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!size.isEmpty());
</span><span class="cx"> 
</span><del>-    RenderStyle&amp; rootStyle = *renderer-&gt;document().documentElement()-&gt;renderStyle();
</del><ins>+    CSSToLengthConversionData conversionData(&amp;renderer-&gt;style(), renderer-&gt;document().documentElement()-&gt;renderStyle());
</ins><span class="cx"> 
</span><del>-    FloatPoint firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), renderer-&gt;style(), rootStyle, size);
</del><ins>+    FloatPoint firstPoint = computeEndPoint(m_firstX.get(), m_firstY.get(), conversionData, size);
</ins><span class="cx">     if (!m_firstX)
</span><span class="cx">         firstPoint.setX(size.width() / 2);
</span><span class="cx">     if (!m_firstY)
</span><span class="cx">         firstPoint.setY(size.height() / 2);
</span><span class="cx"> 
</span><del>-    FloatPoint secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), renderer-&gt;style(), rootStyle, size);
</del><ins>+    FloatPoint secondPoint = computeEndPoint(m_secondX.get(), m_secondY.get(), conversionData, size);
</ins><span class="cx">     if (!m_secondX)
</span><span class="cx">         secondPoint.setX(size.width() / 2);
</span><span class="cx">     if (!m_secondY)
</span><span class="lines">@@ -1003,18 +998,18 @@
</span><span class="cx"> 
</span><span class="cx">     float firstRadius = 0;
</span><span class="cx">     if (m_firstRadius)
</span><del>-        firstRadius = resolveRadius(m_firstRadius.get(), renderer-&gt;style(), rootStyle);
</del><ins>+        firstRadius = resolveRadius(m_firstRadius.get(), conversionData);
</ins><span class="cx"> 
</span><span class="cx">     float secondRadius = 0;
</span><span class="cx">     float aspectRatio = 1; // width / height.
</span><span class="cx">     if (m_secondRadius)
</span><del>-        secondRadius = resolveRadius(m_secondRadius.get(), renderer-&gt;style(), rootStyle);
</del><ins>+        secondRadius = resolveRadius(m_secondRadius.get(), conversionData);
</ins><span class="cx">     else if (m_endHorizontalSize) {
</span><span class="cx">         float width = size.width();
</span><span class="cx">         float height = size.height();
</span><del>-        secondRadius = resolveRadius(m_endHorizontalSize.get(), renderer-&gt;style(), rootStyle, &amp;width);
</del><ins>+        secondRadius = resolveRadius(m_endHorizontalSize.get(), conversionData, &amp;width);
</ins><span class="cx">         if (m_endVerticalSize)
</span><del>-            aspectRatio = secondRadius / resolveRadius(m_endVerticalSize.get(), renderer-&gt;style(), rootStyle, &amp;height);
</del><ins>+            aspectRatio = secondRadius / resolveRadius(m_endVerticalSize.get(), conversionData, &amp;height);
</ins><span class="cx">         else
</span><span class="cx">             aspectRatio = 1;
</span><span class="cx">     } else {
</span><span class="lines">@@ -1120,7 +1115,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Now add the stops.
</span><del>-    addStops(gradient.get(), renderer, rootStyle, maxExtent);
</del><ins>+    addStops(gradient.get(), conversionData, maxExtent);
</ins><span class="cx"> 
</span><span class="cx">     return gradient.release();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGradientValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSGradientValue.h (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGradientValue.h        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/CSSGradientValue.h        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -109,10 +109,10 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void addStops(Gradient*, RenderElement*, const RenderStyle&amp; rootStyle, float maxLengthForRepeat = 0);
</del><ins>+    void addStops(Gradient*, const CSSToLengthConversionData&amp;, float maxLengthForRepeat = 0);
</ins><span class="cx"> 
</span><span class="cx">     // Resolve points/radii to front end values.
</span><del>-    FloatPoint computeEndPoint(CSSPrimitiveValue*, CSSPrimitiveValue*, const RenderStyle&amp;, const RenderStyle&amp; rootStyle, const FloatSize&amp;);
</del><ins>+    FloatPoint computeEndPoint(CSSPrimitiveValue*, CSSPrimitiveValue*, const CSSToLengthConversionData&amp;, const FloatSize&amp;);
</ins><span class="cx"> 
</span><span class="cx">     bool isCacheable() const;
</span><span class="cx"> 
</span><span class="lines">@@ -218,7 +218,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     // Resolve points/radii to front end values.
</span><del>-    float resolveRadius(CSSPrimitiveValue*, const RenderStyle&amp;, const RenderStyle&amp; rootStyle, float* widthOrHeight = 0);
</del><ins>+    float resolveRadius(CSSPrimitiveValue*, const CSSToLengthConversionData&amp;, float* widthOrHeight = 0);
</ins><span class="cx"> 
</span><span class="cx">     // These may be null for non-deprecated gradients.
</span><span class="cx">     RefPtr&lt;CSSPrimitiveValue&gt; m_firstRadius;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;CSSHelper.h&quot;
</span><span class="cx"> #include &quot;CSSParser.h&quot;
</span><span class="cx"> #include &quot;CSSPropertyNames.h&quot;
</span><ins>+#include &quot;CSSToLengthConversionData.h&quot;
</ins><span class="cx"> #include &quot;CSSValueKeywords.h&quot;
</span><span class="cx"> #include &quot;CalculationValue.h&quot;
</span><span class="cx"> #include &quot;Color.h&quot;
</span><span class="lines">@@ -554,74 +555,77 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;&gt; int CSSPrimitiveValue::computeLength(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize) const
</del><ins>+template&lt;&gt; int CSSPrimitiveValue::computeLength(const CSSToLengthConversionData&amp; conversionData) const
</ins><span class="cx"> {
</span><del>-    return roundForImpreciseConversion&lt;int&gt;(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
</del><ins>+    return roundForImpreciseConversion&lt;int&gt;(computeLengthDouble(conversionData));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;&gt; unsigned CSSPrimitiveValue::computeLength(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize) const
</del><ins>+template&lt;&gt; unsigned CSSPrimitiveValue::computeLength(const CSSToLengthConversionData&amp; conversionData) const
</ins><span class="cx"> {
</span><del>-    return roundForImpreciseConversion&lt;unsigned&gt;(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
</del><ins>+    return roundForImpreciseConversion&lt;unsigned&gt;(computeLengthDouble(conversionData));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;&gt; Length CSSPrimitiveValue::computeLength(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize) const
</del><ins>+template&lt;&gt; Length CSSPrimitiveValue::computeLength(const CSSToLengthConversionData&amp; conversionData) const
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(SUBPIXEL_LAYOUT)
</span><del>-    return Length(clampTo&lt;float&gt;(computeLengthDouble(style, rootStyle, multiplier, computingFontSize), minValueForCssLength, maxValueForCssLength), Fixed);
</del><ins>+    return Length(clampTo&lt;float&gt;(computeLengthDouble(conversionData), minValueForCssLength, maxValueForCssLength), Fixed);
</ins><span class="cx"> #else
</span><del>-    return Length(clampTo&lt;float&gt;(roundForImpreciseConversion&lt;float&gt;(computeLengthDouble(style, rootStyle, multiplier, computingFontSize)), minValueForCssLength, maxValueForCssLength), Fixed);
</del><ins>+    return Length(clampTo&lt;float&gt;(roundForImpreciseConversion&lt;float&gt;(computeLengthDouble(conversionData)), minValueForCssLength, maxValueForCssLength), Fixed);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;&gt; short CSSPrimitiveValue::computeLength(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize) const
</del><ins>+template&lt;&gt; short CSSPrimitiveValue::computeLength(const CSSToLengthConversionData&amp; conversionData) const
</ins><span class="cx"> {
</span><del>-    return roundForImpreciseConversion&lt;short&gt;(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
</del><ins>+    return roundForImpreciseConversion&lt;short&gt;(computeLengthDouble(conversionData));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;&gt; unsigned short CSSPrimitiveValue::computeLength(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize) const
</del><ins>+template&lt;&gt; unsigned short CSSPrimitiveValue::computeLength(const CSSToLengthConversionData&amp; conversionData) const
</ins><span class="cx"> {
</span><del>-    return roundForImpreciseConversion&lt;unsigned short&gt;(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
</del><ins>+    return roundForImpreciseConversion&lt;unsigned short&gt;(computeLengthDouble(conversionData));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;&gt; float CSSPrimitiveValue::computeLength(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize) const
</del><ins>+template&lt;&gt; float CSSPrimitiveValue::computeLength(const CSSToLengthConversionData&amp; conversionData) const
</ins><span class="cx"> {
</span><del>-    return static_cast&lt;float&gt;(computeLengthDouble(style, rootStyle, multiplier, computingFontSize));
</del><ins>+    return static_cast&lt;float&gt;(computeLengthDouble(conversionData));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;&gt; double CSSPrimitiveValue::computeLength(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize) const
</del><ins>+template&lt;&gt; double CSSPrimitiveValue::computeLength(const CSSToLengthConversionData&amp; conversionData) const
</ins><span class="cx"> {
</span><del>-    return computeLengthDouble(style, rootStyle, multiplier, computingFontSize);
</del><ins>+    return computeLengthDouble(conversionData);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-double CSSPrimitiveValue::computeLengthDouble(const RenderStyle* style, const RenderStyle* rootStyle, float multiplier, bool computingFontSize) const
</del><ins>+double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData&amp; conversionData) const
</ins><span class="cx"> {
</span><span class="cx">     if (m_primitiveUnitType == CSS_CALC)
</span><span class="cx">         // The multiplier and factor is applied to each value in the calc expression individually
</span><del>-        return m_value.calc-&gt;computeLengthPx(style, rootStyle, multiplier, computingFontSize);
</del><ins>+        return m_value.calc-&gt;computeLengthPx(conversionData);
</ins><span class="cx"> 
</span><span class="cx">     double factor;
</span><span class="cx"> 
</span><span class="cx">     switch (primitiveType()) {
</span><span class="cx">     case CSS_EMS:
</span><del>-        factor = computingFontSize ? style-&gt;fontDescription().specifiedSize() : style-&gt;fontDescription().computedSize();
</del><ins>+        ASSERT(conversionData.style());
+        factor = conversionData.computingFontSize() ? conversionData.style()-&gt;fontDescription().specifiedSize() : conversionData.style()-&gt;fontDescription().computedSize();
</ins><span class="cx">         break;
</span><span class="cx">     case CSS_EXS:
</span><ins>+        ASSERT(conversionData.style());
</ins><span class="cx">         // FIXME: We have a bug right now where the zoom will be applied twice to EX units.
</span><span class="cx">         // We really need to compute EX using fontMetrics for the original specifiedSize and not use
</span><span class="cx">         // our actual constructed rendering font.
</span><del>-        if (style-&gt;fontMetrics().hasXHeight())
-            factor = style-&gt;fontMetrics().xHeight();
</del><ins>+        if (conversionData.style()-&gt;fontMetrics().hasXHeight())
+            factor = conversionData.style()-&gt;fontMetrics().xHeight();
</ins><span class="cx">         else
</span><del>-            factor = (computingFontSize ? style-&gt;fontDescription().specifiedSize() : style-&gt;fontDescription().computedSize()) / 2.0;
</del><ins>+            factor = (conversionData.computingFontSize() ? conversionData.style()-&gt;fontDescription().specifiedSize() : conversionData.style()-&gt;fontDescription().computedSize()) / 2.0;
</ins><span class="cx">         break;
</span><span class="cx">     case CSS_REMS:
</span><del>-        if (rootStyle)
-            factor = computingFontSize ? rootStyle-&gt;fontDescription().specifiedSize() : rootStyle-&gt;fontDescription().computedSize();
</del><ins>+        if (conversionData.rootStyle())
+            factor = conversionData.computingFontSize() ? conversionData.rootStyle()-&gt;fontDescription().specifiedSize() : conversionData.rootStyle()-&gt;fontDescription().computedSize();
</ins><span class="cx">         else
</span><span class="cx">             factor = 1.0;
</span><span class="cx">         break;
</span><span class="cx">     case CSS_CHS:
</span><del>-        factor = style-&gt;fontMetrics().zeroWidth();
</del><ins>+        ASSERT(conversionData.style());
+        factor = conversionData.style()-&gt;fontMetrics().zeroWidth();
</ins><span class="cx">         break;
</span><span class="cx">     case CSS_PX:
</span><span class="cx">         factor = 1.0;
</span><span class="lines">@@ -661,10 +665,10 @@
</span><span class="cx">     // for font sizes is much more complicated, since we have to worry about enforcing the minimum font size preference
</span><span class="cx">     // as well as enforcing the implicit &quot;smart minimum.&quot;
</span><span class="cx">     double result = getDoubleValue() * factor;
</span><del>-    if (computingFontSize || isFontRelativeLength())
</del><ins>+    if (conversionData.computingFontSize() || isFontRelativeLength())
</ins><span class="cx">         return result;
</span><span class="cx"> 
</span><del>-    return result * multiplier;
</del><ins>+    return result * conversionData.zoom();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CSSPrimitiveValue::setFloatValue(unsigned short, double, ExceptionCode&amp; ec)
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.h (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValue.h        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.h        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class CSSCalcValue;
</span><ins>+class CSSToLengthConversionData;
</ins><span class="cx"> class Counter;
</span><span class="cx"> class DashboardRegion;
</span><span class="cx"> class Pair;
</span><span class="lines">@@ -265,10 +266,10 @@
</span><span class="cx">      * this is screen/printer dependent, so we probably need a config option for this,
</span><span class="cx">      * and some tool to calibrate.
</span><span class="cx">      */
</span><del>-    template&lt;typename T&gt; T computeLength(const RenderStyle* currStyle, const RenderStyle* rootStyle, float multiplier = 1.0f, bool computingFontSize = false) const;
</del><ins>+    template&lt;typename T&gt; T computeLength(const CSSToLengthConversionData&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     // Converts to a Length, mapping various unit types appropriately.
</span><del>-    template&lt;int&gt; Length convertToLength(const RenderStyle* currStyle, const RenderStyle* rootStyle, double multiplier = 1.0, bool computingFontSize = false) const;
</del><ins>+    template&lt;int&gt; Length convertToLength(const CSSToLengthConversionData&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     // use with care!!!
</span><span class="cx">     void setPrimitiveType(unsigned short type) { m_primitiveUnitType = type; }
</span><span class="lines">@@ -378,7 +379,7 @@
</span><span class="cx">     void init(PassRefPtr&lt;CSSCalcValue&gt;);
</span><span class="cx">     bool getDoubleValueInternal(UnitTypes targetUnitType, double* result) const;
</span><span class="cx"> 
</span><del>-    double computeLengthDouble(const RenderStyle* currentStyle, const RenderStyle* rootStyle, float multiplier, bool computingFontSize) const;
</del><ins>+    double computeLengthDouble(const CSSToLengthConversionData&amp;) const;
</ins><span class="cx"> 
</span><span class="cx">     union {
</span><span class="cx">         CSSPropertyID propertyID;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValueMappingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;CSSCalculationValue.h&quot;
</span><span class="cx"> #include &quot;CSSPrimitiveValue.h&quot;
</span><span class="cx"> #include &quot;CSSReflectionDirection.h&quot;
</span><ins>+#include &quot;CSSToLengthConversionData.h&quot;
</ins><span class="cx"> #include &quot;ColorSpace.h&quot;
</span><span class="cx"> #include &quot;CSSValueKeywords.h&quot;
</span><span class="cx"> #include &quot;FontDescription.h&quot;
</span><span class="lines">@@ -4631,14 +4632,14 @@
</span><span class="cx">     ViewportPercentageConversion = 1 &lt;&lt; 6
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template&lt;int supported&gt; Length CSSPrimitiveValue::convertToLength(const RenderStyle* style, const RenderStyle* rootStyle, double multiplier, bool computingFontSize) const
</del><ins>+template&lt;int supported&gt; Length CSSPrimitiveValue::convertToLength(const CSSToLengthConversionData&amp; conversionData) const
</ins><span class="cx"> {
</span><del>-    if ((supported &amp; (FixedIntegerConversion | FixedFloatConversion)) &amp;&amp; isFontRelativeLength() &amp;&amp; (!style || !rootStyle))
</del><ins>+    if ((supported &amp; (FixedIntegerConversion | FixedFloatConversion)) &amp;&amp; isFontRelativeLength() &amp;&amp; (!conversionData.style() || !conversionData.rootStyle()))
</ins><span class="cx">         return Length(Undefined);
</span><span class="cx">     if ((supported &amp; FixedIntegerConversion) &amp;&amp; isLength())
</span><del>-        return computeLength&lt;Length&gt;(style, rootStyle, multiplier, computingFontSize);
</del><ins>+        return computeLength&lt;Length&gt;(conversionData);
</ins><span class="cx">     if ((supported &amp; FixedFloatConversion) &amp;&amp; isLength())
</span><del>-        return Length(computeLength&lt;double&gt;(style, rootStyle, multiplier), Fixed);
</del><ins>+        return Length(computeLength&lt;double&gt;(conversionData), Fixed);
</ins><span class="cx">     if ((supported &amp; PercentConversion) &amp;&amp; isPercentage())
</span><span class="cx">         return Length(getDoubleValue(), Percent);
</span><span class="cx">     if ((supported &amp; FractionConversion) &amp;&amp; isNumber())
</span><span class="lines">@@ -4646,7 +4647,7 @@
</span><span class="cx">     if ((supported &amp; AutoConversion) &amp;&amp; getValueID() == CSSValueAuto)
</span><span class="cx">         return Length(Auto);
</span><span class="cx">     if ((supported &amp; CalculatedConversion) &amp;&amp; isCalculated())
</span><del>-        return Length(cssCalcValue()-&gt;createCalculationValue(style, rootStyle, multiplier));
</del><ins>+        return Length(cssCalcValue()-&gt;createCalculationValue(conversionData));
</ins><span class="cx">     if ((supported &amp; ViewportPercentageConversion) &amp;&amp; isViewportPercentageLength())
</span><span class="cx">         return viewportPercentageLength();
</span><span class="cx">     return Length(Undefined);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSToLengthConversionDatacpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/CSSToLengthConversionData.cpp (0 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSToLengthConversionData.cpp                                (rev 0)
+++ trunk/Source/WebCore/css/CSSToLengthConversionData.cpp        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+/*
+ * Copyright (C) 2013 Google 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; 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 THE COPYRIGHT
+ * OWNER OR 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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;CSSToLengthConversionData.h&quot;
+
+#include &quot;RenderStyle.h&quot;
+
+namespace WebCore {
+
+float CSSToLengthConversionData::zoom() const
+{
+    if (m_useEffectiveZoom)
+        return m_style ? m_style-&gt;effectiveZoom() : 1;
+    return m_zoom;
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSToLengthConversionDatah"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/CSSToLengthConversionData.h (0 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSToLengthConversionData.h                                (rev 0)
+++ trunk/Source/WebCore/css/CSSToLengthConversionData.h        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+/*
+ * Copyright (C) 2013 Google 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; 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 THE COPYRIGHT
+ * OWNER OR 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 CSSToLengthConversionData_h
+#define CSSToLengthConversionData_h
+
+#include &lt;wtf/Assertions.h&gt;
+#include &lt;wtf/Noncopyable.h&gt;
+
+namespace WebCore {
+
+class RenderStyle;
+
+class CSSToLengthConversionData {
+public:
+    CSSToLengthConversionData(const RenderStyle* style, const RenderStyle* rootStyle, float zoom, bool computingFontSize = false)
+        : m_style(style)
+        , m_rootStyle(rootStyle)
+        , m_zoom(zoom)
+        , m_useEffectiveZoom(false)
+        , m_computingFontSize(computingFontSize)
+    {
+        ASSERT(zoom &gt; 0);
+    }
+    CSSToLengthConversionData(const RenderStyle* style = nullptr, const RenderStyle* rootStyle = nullptr, bool computingFontSize = false)
+        : m_style(style)
+        , m_rootStyle(rootStyle)
+        , m_useEffectiveZoom(true)
+        , m_computingFontSize(computingFontSize)
+    {
+    }
+
+    const RenderStyle* style() const { return m_style; }
+    const RenderStyle* rootStyle() const { return m_rootStyle; }
+    float zoom() const;
+    bool computingFontSize() const { return m_computingFontSize; }
+
+    CSSToLengthConversionData copyWithAdjustedZoom(float newZoom) const
+    {
+        return CSSToLengthConversionData(m_style, m_rootStyle, newZoom, m_computingFontSize);
+    }
+
+private:
+    const RenderStyle* m_style;
+    const RenderStyle* m_rootStyle;
+    float m_zoom;
+    bool m_useEffectiveZoom;
+    bool m_computingFontSize;
+};
+
+} // namespace WebCore
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSToStyleMapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSToStyleMap.cpp (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSToStyleMap.cpp        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/CSSToStyleMap.cpp        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -41,6 +41,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+CSSToStyleMap::CSSToStyleMap(StyleResolver* resolver)
+    : m_resolver(resolver)
+{
+}
+
</ins><span class="cx"> RenderStyle* CSSToStyleMap::style() const
</span><span class="cx"> {
</span><span class="cx">     return m_resolver-&gt;style();
</span><span class="lines">@@ -203,18 +208,16 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    float zoomFactor = style()-&gt;effectiveZoom();
-
</del><span class="cx">     Length firstLength;
</span><span class="cx">     Length secondLength;
</span><span class="cx"> 
</span><span class="cx">     if (Pair* pair = primitiveValue-&gt;getPairValue()) {
</span><span class="cx">         CSSPrimitiveValue* first = static_cast&lt;CSSPrimitiveValue*&gt;(pair-&gt;first());
</span><span class="cx">         CSSPrimitiveValue* second = static_cast&lt;CSSPrimitiveValue*&gt;(pair-&gt;second());
</span><del>-        firstLength = first-&gt;convertToLength&lt;AnyConversion&gt;(style(), rootElementStyle(), zoomFactor);
-        secondLength = second-&gt;convertToLength&lt;AnyConversion&gt;(style(), rootElementStyle(), zoomFactor);
</del><ins>+        firstLength = first-&gt;convertToLength&lt;AnyConversion&gt;(m_resolver-&gt;state().cssToLengthConversionData());
+        secondLength = second-&gt;convertToLength&lt;AnyConversion&gt;(m_resolver-&gt;state().cssToLengthConversionData());
</ins><span class="cx">     } else {
</span><del>-        firstLength = primitiveValue-&gt;convertToLength&lt;AnyConversion&gt;(style(), rootElementStyle(), zoomFactor);
</del><ins>+        firstLength = primitiveValue-&gt;convertToLength&lt;AnyConversion&gt;(m_resolver-&gt;state().cssToLengthConversionData());
</ins><span class="cx">         secondLength = Length();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -236,8 +239,6 @@
</span><span class="cx">     if (!value-&gt;isPrimitiveValue())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    float zoomFactor = style()-&gt;effectiveZoom();
-
</del><span class="cx">     CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</span><span class="cx">     Pair* pair = primitiveValue-&gt;getPairValue();
</span><span class="cx">     if (pair) {
</span><span class="lines">@@ -247,11 +248,11 @@
</span><span class="cx"> 
</span><span class="cx">     Length length;
</span><span class="cx">     if (primitiveValue-&gt;isLength())
</span><del>-        length = primitiveValue-&gt;computeLength&lt;Length&gt;(style(), rootElementStyle(), zoomFactor);
</del><ins>+        length = primitiveValue-&gt;computeLength&lt;Length&gt;(m_resolver-&gt;state().cssToLengthConversionData());
</ins><span class="cx">     else if (primitiveValue-&gt;isPercentage())
</span><span class="cx">         length = Length(primitiveValue-&gt;getDoubleValue(), Percent);
</span><span class="cx">     else if (primitiveValue-&gt;isCalculatedPercentageWithLength())
</span><del>-        length = Length(primitiveValue-&gt;cssCalcValue()-&gt;createCalculationValue(style(), rootElementStyle(), zoomFactor));
</del><ins>+        length = Length(primitiveValue-&gt;cssCalcValue()-&gt;createCalculationValue(m_resolver-&gt;state().cssToLengthConversionData()));
</ins><span class="cx">     else if (primitiveValue-&gt;isViewportPercentageLength())
</span><span class="cx">         length = primitiveValue-&gt;viewportPercentageLength();
</span><span class="cx">     else
</span><span class="lines">@@ -272,8 +273,6 @@
</span><span class="cx">     if (!value-&gt;isPrimitiveValue())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    float zoomFactor = style()-&gt;effectiveZoom();
-
</del><span class="cx">     CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
</span><span class="cx">     Pair* pair = primitiveValue-&gt;getPairValue();
</span><span class="cx">     if (pair) {
</span><span class="lines">@@ -283,11 +282,11 @@
</span><span class="cx"> 
</span><span class="cx">     Length length;
</span><span class="cx">     if (primitiveValue-&gt;isLength())
</span><del>-        length = primitiveValue-&gt;computeLength&lt;Length&gt;(style(), rootElementStyle(), zoomFactor);
</del><ins>+        length = primitiveValue-&gt;computeLength&lt;Length&gt;(m_resolver-&gt;state().cssToLengthConversionData());
</ins><span class="cx">     else if (primitiveValue-&gt;isPercentage())
</span><span class="cx">         length = Length(primitiveValue-&gt;getDoubleValue(), Percent);
</span><span class="cx">     else if (primitiveValue-&gt;isCalculatedPercentageWithLength())
</span><del>-        length = Length(primitiveValue-&gt;cssCalcValue()-&gt;createCalculationValue(style(), rootElementStyle(), zoomFactor));
</del><ins>+        length = Length(primitiveValue-&gt;cssCalcValue()-&gt;createCalculationValue(m_resolver-&gt;state().cssToLengthConversionData()));
</ins><span class="cx">     else if (primitiveValue-&gt;isViewportPercentageLength())
</span><span class="cx">         length = primitiveValue-&gt;viewportPercentageLength();
</span><span class="cx">     else
</span><span class="lines">@@ -633,7 +632,7 @@
</span><span class="cx">         return LengthBox();
</span><span class="cx"> 
</span><span class="cx">     // Get our zoom value.
</span><del>-    float zoom = useSVGZoomRules() ? 1.0f : style()-&gt;effectiveZoom();
</del><ins>+    CSSToLengthConversionData conversionData = useSVGZoomRules() ? m_resolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f) : m_resolver-&gt;state().cssToLengthConversionData();
</ins><span class="cx"> 
</span><span class="cx">     // Retrieve the primitive value.
</span><span class="cx">     CSSPrimitiveValue* borderWidths = toCSSPrimitiveValue(value);
</span><span class="lines">@@ -646,28 +645,28 @@
</span><span class="cx">     else if (slices-&gt;top()-&gt;isPercentage())
</span><span class="cx">         box.m_top = Length(slices-&gt;top()-&gt;getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
</span><span class="cx">     else if (slices-&gt;top()-&gt;getValueID() != CSSValueAuto)
</span><del>-        box.m_top = slices-&gt;top()-&gt;computeLength&lt;Length&gt;(style(), rootElementStyle(), zoom);
</del><ins>+        box.m_top = slices-&gt;top()-&gt;computeLength&lt;Length&gt;(conversionData);
</ins><span class="cx"> 
</span><span class="cx">     if (slices-&gt;right()-&gt;isNumber())
</span><span class="cx">         box.m_right = Length(slices-&gt;right()-&gt;getIntValue(), Relative);
</span><span class="cx">     else if (slices-&gt;right()-&gt;isPercentage())
</span><span class="cx">         box.m_right = Length(slices-&gt;right()-&gt;getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
</span><span class="cx">     else if (slices-&gt;right()-&gt;getValueID() != CSSValueAuto)
</span><del>-        box.m_right = slices-&gt;right()-&gt;computeLength&lt;Length&gt;(style(), rootElementStyle(), zoom);
</del><ins>+        box.m_right = slices-&gt;right()-&gt;computeLength&lt;Length&gt;(conversionData);
</ins><span class="cx"> 
</span><span class="cx">     if (slices-&gt;bottom()-&gt;isNumber())
</span><span class="cx">         box.m_bottom = Length(slices-&gt;bottom()-&gt;getIntValue(), Relative);
</span><span class="cx">     else if (slices-&gt;bottom()-&gt;isPercentage())
</span><span class="cx">         box.m_bottom = Length(slices-&gt;bottom()-&gt;getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
</span><span class="cx">     else if (slices-&gt;bottom()-&gt;getValueID() != CSSValueAuto)
</span><del>-        box.m_bottom = slices-&gt;bottom()-&gt;computeLength&lt;Length&gt;(style(), rootElementStyle(), zoom);
</del><ins>+        box.m_bottom = slices-&gt;bottom()-&gt;computeLength&lt;Length&gt;(conversionData);
</ins><span class="cx"> 
</span><span class="cx">     if (slices-&gt;left()-&gt;isNumber())
</span><span class="cx">         box.m_left = Length(slices-&gt;left()-&gt;getIntValue(), Relative);
</span><span class="cx">     else if (slices-&gt;left()-&gt;isPercentage())
</span><span class="cx">         box.m_left = Length(slices-&gt;left()-&gt;getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent);
</span><span class="cx">     else if (slices-&gt;left()-&gt;getValueID() != CSSValueAuto)
</span><del>-        box.m_left = slices-&gt;left()-&gt;computeLength&lt;Length&gt;(style(), rootElementStyle(), zoom);
</del><ins>+        box.m_left = slices-&gt;left()-&gt;computeLength&lt;Length&gt;(conversionData);
</ins><span class="cx"> 
</span><span class="cx">     return box;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSToStyleMaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSToStyleMap.h (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSToStyleMap.h        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/CSSToStyleMap.h        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> 
</span><span class="cx"> public:
</span><del>-    CSSToStyleMap(StyleResolver* resolver) : m_resolver(resolver) { }
</del><ins>+    CSSToStyleMap(StyleResolver*);
</ins><span class="cx"> 
</span><span class="cx">     void mapFillAttachment(CSSPropertyID, FillLayer*, CSSValue*);
</span><span class="cx">     void mapFillClip(CSSPropertyID, FillLayer*, CSSValue*);
</span></span></pre></div>
<a id="trunkSourceWebCorecssDeprecatedStyleBuildercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -220,7 +220,7 @@
</span><span class="cx">         else if (valueType == Number)
</span><span class="cx">             setValue(styleResolver-&gt;style(), *primitiveValue);
</span><span class="cx">         else if (valueType == ComputeLength)
</span><del>-            setValue(styleResolver-&gt;style(), primitiveValue-&gt;computeLength&lt;T&gt;(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), styleResolver-&gt;style()-&gt;effectiveZoom()));
</del><ins>+            setValue(styleResolver-&gt;style(), primitiveValue-&gt;computeLength&lt;T&gt;(styleResolver-&gt;state().cssToLengthConversionData()));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static PropertyHandler createHandler() { return PropertyHandler(&amp;applyInheritValue, &amp;applyInitialValue, &amp;applyValue); }
</span><span class="lines">@@ -230,7 +230,7 @@
</span><span class="cx"> private:
</span><span class="cx">     static Length convertToLength(StyleResolver* styleResolver, CSSPrimitiveValue* value)
</span><span class="cx">     {
</span><del>-        return value-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | FractionConversion | AutoConversion&gt;(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), styleResolver-&gt;style()-&gt;effectiveZoom());
</del><ins>+        return value-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | FractionConversion | AutoConversion&gt;(styleResolver-&gt;state().cssToLengthConversionData());
</ins><span class="cx">     }
</span><span class="cx"> public:
</span><span class="cx">     static void applyInheritValue(CSSPropertyID propertyID, StyleResolver* styleResolver)
</span><span class="lines">@@ -387,13 +387,13 @@
</span><span class="cx">         if (autoEnabled &amp;&amp; primitiveValue-&gt;getValueID() == CSSValueAuto)
</span><span class="cx">             setValue(styleResolver-&gt;style(), Length());
</span><span class="cx">         else if (primitiveValue-&gt;isLength()) {
</span><del>-            Length length = primitiveValue-&gt;computeLength&lt;Length&gt;(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), styleResolver-&gt;style()-&gt;effectiveZoom());
</del><ins>+            Length length = primitiveValue-&gt;computeLength&lt;Length&gt;(styleResolver-&gt;state().cssToLengthConversionData());
</ins><span class="cx">             length.setHasQuirk(primitiveValue-&gt;isQuirkValue());
</span><span class="cx">             setValue(styleResolver-&gt;style(), length);
</span><span class="cx">         } else if (primitiveValue-&gt;isPercentage())
</span><span class="cx">             setValue(styleResolver-&gt;style(), Length(primitiveValue-&gt;getDoubleValue(), Percent));
</span><span class="cx">         else if (primitiveValue-&gt;isCalculatedPercentageWithLength())
</span><del>-            setValue(styleResolver-&gt;style(), Length(primitiveValue-&gt;cssCalcValue()-&gt;createCalculationValue(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), styleResolver-&gt;style()-&gt;effectiveZoom())));
</del><ins>+            setValue(styleResolver-&gt;style(), Length(primitiveValue-&gt;cssCalcValue()-&gt;createCalculationValue(styleResolver-&gt;state().cssToLengthConversionData())));
</ins><span class="cx">         else if (primitiveValue-&gt;isViewportPercentageLength())
</span><span class="cx">             setValue(styleResolver-&gt;style(), primitiveValue-&gt;viewportPercentageLength());
</span><span class="cx">     }
</span><span class="lines">@@ -442,15 +442,16 @@
</span><span class="cx">         if (!pair || !pair-&gt;first() || !pair-&gt;second())
</span><span class="cx">             return;
</span><span class="cx"> 
</span><ins>+        CSSToLengthConversionData conversionData = styleResolver-&gt;state().cssToLengthConversionData();
</ins><span class="cx">         Length radiusWidth;
</span><span class="cx">         if (pair-&gt;first()-&gt;isPercentage())
</span><span class="cx">             radiusWidth = Length(pair-&gt;first()-&gt;getDoubleValue(), Percent);
</span><span class="cx">         else if (pair-&gt;first()-&gt;isViewportPercentageLength())
</span><span class="cx">             radiusWidth = Length(styleResolver-&gt;viewportPercentageValue(*pair-&gt;first(), pair-&gt;first()-&gt;getIntValue()), Fixed);
</span><span class="cx">         else if (pair-&gt;first()-&gt;isCalculatedPercentageWithLength())
</span><del>-            radiusWidth = Length(pair-&gt;first()-&gt;cssCalcValue()-&gt;createCalculationValue(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), styleResolver-&gt;style()-&gt;effectiveZoom()));
</del><ins>+            radiusWidth = Length(pair-&gt;first()-&gt;cssCalcValue()-&gt;createCalculationValue(conversionData));
</ins><span class="cx">         else
</span><del>-            radiusWidth = pair-&gt;first()-&gt;computeLength&lt;Length&gt;(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), styleResolver-&gt;style()-&gt;effectiveZoom());
</del><ins>+            radiusWidth = pair-&gt;first()-&gt;computeLength&lt;Length&gt;(conversionData);
</ins><span class="cx"> 
</span><span class="cx">         Length radiusHeight;
</span><span class="cx">         if (pair-&gt;second()-&gt;isPercentage())
</span><span class="lines">@@ -458,9 +459,9 @@
</span><span class="cx">         else if (pair-&gt;second()-&gt;isViewportPercentageLength())
</span><span class="cx">             radiusHeight = Length(styleResolver-&gt;viewportPercentageValue(*pair-&gt;second(), pair-&gt;second()-&gt;getIntValue()), Fixed);
</span><span class="cx">         else if (pair-&gt;second()-&gt;isCalculatedPercentageWithLength())
</span><del>-            radiusHeight = Length(pair-&gt;second()-&gt;cssCalcValue()-&gt;createCalculationValue(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), styleResolver-&gt;style()-&gt;effectiveZoom()));
</del><ins>+            radiusHeight = Length(pair-&gt;second()-&gt;cssCalcValue()-&gt;createCalculationValue(conversionData));
</ins><span class="cx">         else
</span><del>-            radiusHeight = pair-&gt;second()-&gt;computeLength&lt;Length&gt;(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), styleResolver-&gt;style()-&gt;effectiveZoom());
</del><ins>+            radiusHeight = pair-&gt;second()-&gt;computeLength&lt;Length&gt;(conversionData);
</ins><span class="cx"> 
</span><span class="cx">         if (radiusWidth.isNegative() || radiusHeight.isNegative())
</span><span class="cx">             return;
</span><span class="lines">@@ -611,13 +612,13 @@
</span><span class="cx">         } else if (thicknessEnabled &amp;&amp; ident == CSSValueThick) {
</span><span class="cx">             length = 5;
</span><span class="cx">         } else if (ident == CSSValueInvalid) {
</span><del>-            float zoom = (svgZoomEnabled &amp;&amp; styleResolver-&gt;useSVGZoomRules()) ? 1.0f : styleResolver-&gt;style()-&gt;effectiveZoom();
</del><ins>+            CSSToLengthConversionData conversionData = (svgZoomEnabled &amp;&amp; styleResolver-&gt;useSVGZoomRules()) ? styleResolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f) : styleResolver-&gt;state().cssToLengthConversionData();
</ins><span class="cx"> 
</span><span class="cx">             // Any original result that was &gt;= 1 should not be allowed to fall below 1.
</span><span class="cx">             // This keeps border lines from vanishing.
</span><del>-            length = primitiveValue-&gt;computeLength&lt;T&gt;(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), zoom);
-            if (zoom &lt; 1.0f &amp;&amp; length &lt; 1.0) {
-                T originalLength = primitiveValue-&gt;computeLength&lt;T&gt;(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), 1.0);
</del><ins>+            length = primitiveValue-&gt;computeLength&lt;T&gt;(conversionData);
+            if (conversionData.zoom() &lt; 1.0f &amp;&amp; length &lt; 1.0) {
+                T originalLength = primitiveValue-&gt;computeLength&lt;T&gt;(conversionData.copyWithAdjustedZoom(1.0f));
</ins><span class="cx">                 if (originalLength &gt;= 1.0)
</span><span class="cx">                     length = 1.0;
</span><span class="cx">             }
</span><span class="lines">@@ -868,11 +869,11 @@
</span><span class="cx">             fontDescription.setIsAbsoluteSize(parentIsAbsoluteSize
</span><span class="cx">                                               || !(primitiveValue-&gt;isPercentage() || primitiveValue-&gt;isFontRelativeLength()));
</span><span class="cx">             if (primitiveValue-&gt;isLength())
</span><del>-                size = primitiveValue-&gt;computeLength&lt;float&gt;(styleResolver-&gt;parentStyle(), styleResolver-&gt;rootElementStyle(), 1.0, true);
</del><ins>+                size = primitiveValue-&gt;computeLength&lt;float&gt;(CSSToLengthConversionData(styleResolver-&gt;parentStyle(), styleResolver-&gt;rootElementStyle(), 1.0f, true));
</ins><span class="cx">             else if (primitiveValue-&gt;isPercentage())
</span><span class="cx">                 size = (primitiveValue-&gt;getFloatValue() * parentSize) / 100.0f;
</span><span class="cx">             else if (primitiveValue-&gt;isCalculatedPercentageWithLength()) {
</span><del>-                Ref&lt;CalculationValue&gt; calculationValue { primitiveValue-&gt;cssCalcValue()-&gt;createCalculationValue(styleResolver-&gt;parentStyle(), styleResolver-&gt;rootElementStyle()) };
</del><ins>+                Ref&lt;CalculationValue&gt; calculationValue { primitiveValue-&gt;cssCalcValue()-&gt;createCalculationValue(styleResolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f)) };
</ins><span class="cx">                 size = calculationValue-&gt;evaluate(parentSize);
</span><span class="cx">             } else if (primitiveValue-&gt;isViewportPercentageLength())
</span><span class="cx">                 size = valueForLength(primitiveValue-&gt;viewportPercentageLength(), 0, styleResolver-&gt;document().renderView());
</span><span class="lines">@@ -1292,6 +1293,14 @@
</span><span class="cx">     return TextDecorationSkipNone;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static inline CSSToLengthConversionData csstoLengthConversionDataWithTextZoomFactor(StyleResolver&amp; styleResolver)
+{
+    if (Frame* frame = styleResolver.document().frame())
+        return styleResolver.state().cssToLengthConversionData().copyWithAdjustedZoom(styleResolver.style()-&gt;effectiveZoom() * frame-&gt;textZoomFactor());
+
+    return styleResolver.state().cssToLengthConversionData();
+}
+
</ins><span class="cx"> class ApplyPropertyTextDecorationSkip {
</span><span class="cx"> public:
</span><span class="cx">     static void applyValue(CSSPropertyID, StyleResolver* styleResolver, CSSValue* value)
</span><span class="lines">@@ -1336,7 +1345,7 @@
</span><span class="cx">                 break;
</span><span class="cx">             }
</span><span class="cx">         } else {
</span><del>-            Length marqueeLength = styleResolver-&gt;convertToIntLength(primitiveValue, styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle());
</del><ins>+            Length marqueeLength = styleResolver-&gt;convertToIntLength(primitiveValue, styleResolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f));
</ins><span class="cx">             if (!marqueeLength.isUndefined())
</span><span class="cx">                 styleResolver-&gt;style()-&gt;setMarqueeIncrement(marqueeLength);
</span><span class="cx">         }
</span><span class="lines">@@ -1442,10 +1451,7 @@
</span><span class="cx">         if (primitiveValue-&gt;getValueID() == CSSValueNormal)
</span><span class="cx">             lineHeight = RenderStyle::initialLineHeight();
</span><span class="cx">         else if (primitiveValue-&gt;isLength()) {
</span><del>-            double multiplier = styleResolver-&gt;style()-&gt;effectiveZoom();
-            if (Frame* frame = styleResolver-&gt;document().frame())
-                multiplier *= frame-&gt;textZoomFactor();
-            lineHeight = primitiveValue-&gt;computeLength&lt;Length&gt;(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), multiplier);
</del><ins>+            lineHeight = primitiveValue-&gt;computeLength&lt;Length&gt;(csstoLengthConversionDataWithTextZoomFactor(*styleResolver));
</ins><span class="cx">         } else if (primitiveValue-&gt;isPercentage()) {
</span><span class="cx">             // FIXME: percentage should not be restricted to an integer here.
</span><span class="cx">             lineHeight = Length((styleResolver-&gt;style()-&gt;computedFontSize() * primitiveValue-&gt;getIntValue()) / 100, Fixed);
</span><span class="lines">@@ -1480,12 +1486,7 @@
</span><span class="cx">         if (primitiveValue-&gt;getValueID() == CSSValueNormal)
</span><span class="cx">             lineHeight = RenderStyle::initialLineHeight();
</span><span class="cx">         else if (primitiveValue-&gt;isLength()) {
</span><del>-            double multiplier = styleResolver-&gt;style()-&gt;effectiveZoom();
-            if (styleResolver-&gt;style()-&gt;textSizeAdjust().isNone()) {
-                if (Frame* frame = styleResolver-&gt;document().frame())
-                    multiplier *= frame-&gt;textZoomFactor();
-            }
-            lineHeight = primitiveValue-&gt;computeLength&lt;Length&gt;(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), multiplier);
</del><ins>+            lineHeight = primitiveValue-&gt;computeLength&lt;Length&gt;(csstoLengthConversionDataWithTextZoomFactor(*styleResolver));
</ins><span class="cx">             if (styleResolver-&gt;style()-&gt;textSizeAdjust().isPercentage())
</span><span class="cx">                 lineHeight = Length(lineHeight.value() * styleResolver-&gt;style()-&gt;textSizeAdjust().multiplier(), Fixed);
</span><span class="cx">         } else if (primitiveValue-&gt;isPercentage()) {
</span><span class="lines">@@ -1537,10 +1538,7 @@
</span><span class="cx">         if (primitiveValue-&gt;getValueID() == CSSValueNormal)
</span><span class="cx">             wordSpacing = RenderStyle::initialWordSpacing();
</span><span class="cx">         else if (primitiveValue-&gt;isLength()) {
</span><del>-            double multiplier = styleResolver-&gt;style()-&gt;effectiveZoom();
-            if (Frame* frame = styleResolver-&gt;document().frame())
-                multiplier *= frame-&gt;textZoomFactor();
-            wordSpacing = primitiveValue-&gt;computeLength&lt;Length&gt;(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), multiplier);
</del><ins>+            wordSpacing = primitiveValue-&gt;computeLength&lt;Length&gt;(csstoLengthConversionDataWithTextZoomFactor(*styleResolver));
</ins><span class="cx">         } else if (primitiveValue-&gt;isPercentage())
</span><span class="cx">             wordSpacing = Length(primitiveValue-&gt;getDoubleValue(), Percent);
</span><span class="cx">         else if (primitiveValue-&gt;isNumber())
</span><span class="lines">@@ -1563,12 +1561,12 @@
</span><span class="cx">     static Length mmLength(double mm)
</span><span class="cx">     {
</span><span class="cx">         Ref&lt;CSSPrimitiveValue&gt; value(CSSPrimitiveValue::create(mm, CSSPrimitiveValue::CSS_MM));
</span><del>-        return value.get().computeLength&lt;Length&gt;(0, 0);
</del><ins>+        return value.get().computeLength&lt;Length&gt;(CSSToLengthConversionData());
</ins><span class="cx">     }
</span><span class="cx">     static Length inchLength(double inch)
</span><span class="cx">     {
</span><span class="cx">         Ref&lt;CSSPrimitiveValue&gt; value(CSSPrimitiveValue::create(inch, CSSPrimitiveValue::CSS_IN));
</span><del>-        return value.get().computeLength&lt;Length&gt;(0, 0);
</del><ins>+        return value.get().computeLength&lt;Length&gt;(CSSToLengthConversionData());
</ins><span class="cx">     }
</span><span class="cx">     static bool getPageSizeFromName(CSSPrimitiveValue* pageSizeName, CSSPrimitiveValue* pageOrientation, Length&amp; width, Length&amp; height)
</span><span class="cx">     {
</span><span class="lines">@@ -1664,8 +1662,9 @@
</span><span class="cx">                 // &lt;length&gt;{2}
</span><span class="cx">                 if (!second-&gt;isLength())
</span><span class="cx">                     return;
</span><del>-                width = first-&gt;computeLength&lt;Length&gt;(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle());
-                height = second-&gt;computeLength&lt;Length&gt;(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle());
</del><ins>+                CSSToLengthConversionData conversionData = styleResolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f);
+                width = first-&gt;computeLength&lt;Length&gt;(conversionData);
+                height = second-&gt;computeLength&lt;Length&gt;(conversionData);
</ins><span class="cx">             } else {
</span><span class="cx">                 // &lt;page-size&gt; &lt;orientation&gt;
</span><span class="cx">                 // The value order is guaranteed. See CSSParser::parseSizeParameter.
</span><span class="lines">@@ -1683,7 +1682,7 @@
</span><span class="cx">             if (primitiveValue-&gt;isLength()) {
</span><span class="cx">                 // &lt;length&gt;
</span><span class="cx">                 pageSizeType = PAGE_SIZE_RESOLVED;
</span><del>-                width = height = primitiveValue-&gt;computeLength&lt;Length&gt;(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle());
</del><ins>+                width = height = primitiveValue-&gt;computeLength&lt;Length&gt;(styleResolver-&gt;state().cssToLengthConversionData().copyWithAdjustedZoom(1.0f));
</ins><span class="cx">             } else {
</span><span class="cx">                 switch (primitiveValue-&gt;getValueID()) {
</span><span class="cx">                 case 0:
</span><span class="lines">@@ -1961,7 +1960,7 @@
</span><span class="cx">         if (primitiveValue-&gt;getValueID())
</span><span class="cx">             return styleResolver-&gt;style()-&gt;setVerticalAlign(*primitiveValue);
</span><span class="cx"> 
</span><del>-        styleResolver-&gt;style()-&gt;setVerticalAlignLength(primitiveValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion&gt;(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), styleResolver-&gt;style()-&gt;effectiveZoom()));
</del><ins>+        styleResolver-&gt;style()-&gt;setVerticalAlignLength(primitiveValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion&gt;(styleResolver-&gt;state().cssToLengthConversionData()));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static PropertyHandler createHandler()
</span><span class="lines">@@ -2139,7 +2138,7 @@
</span><span class="cx">         for (unsigned i = 0; i &lt; valueList.length(); ++i) {
</span><span class="cx">             auto&amp; primitiveValue = toCSSPrimitiveValue(*valueList.itemWithoutBoundsCheck(i));
</span><span class="cx">             if (primitiveValue.isShape() &amp;&amp; !operation)
</span><del>-                operation = ShapeClipPathOperation::create(basicShapeForValue(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), primitiveValue.getShapeValue()));
</del><ins>+                operation = ShapeClipPathOperation::create(basicShapeForValue(styleResolver-&gt;state().cssToLengthConversionData(), primitiveValue.getShapeValue()));
</ins><span class="cx">             else if ((primitiveValue.getValueID() == CSSValueContentBox
</span><span class="cx">                 || primitiveValue.getValueID() == CSSValueBorderBox
</span><span class="cx">                 || primitiveValue.getValueID() == CSSValuePaddingBox
</span><span class="lines">@@ -2188,7 +2187,7 @@
</span><span class="cx">             for (unsigned i = 0; i &lt; valueList-&gt;length(); ++i) {
</span><span class="cx">                 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(valueList-&gt;itemWithoutBoundsCheck(i));
</span><span class="cx">                 if (primitiveValue-&gt;isShape())
</span><del>-                    shape = basicShapeForValue(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), primitiveValue-&gt;getShapeValue());
</del><ins>+                    shape = basicShapeForValue(styleResolver-&gt;state().cssToLengthConversionData(), primitiveValue-&gt;getShapeValue());
</ins><span class="cx">                 else if (primitiveValue-&gt;getValueID() == CSSValueContentBox
</span><span class="cx">                     || primitiveValue-&gt;getValueID() == CSSValueBorderBox
</span><span class="cx">                     || primitiveValue-&gt;getValueID() == CSSValuePaddingBox
</span><span class="lines">@@ -2301,7 +2300,7 @@
</span><span class="cx"> 
</span><span class="cx">             CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
</span><span class="cx">             if (!primitiveValue-&gt;getValueID())
</span><del>-                lengthOrPercentageValue = primitiveValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion&gt;(styleResolver-&gt;style(), styleResolver-&gt;rootElementStyle(), styleResolver-&gt;style()-&gt;effectiveZoom());
</del><ins>+                lengthOrPercentageValue = primitiveValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion&gt;(styleResolver-&gt;state().cssToLengthConversionData());
</ins><span class="cx"> #if ENABLE(CSS3_TEXT)
</span><span class="cx">             else if (primitiveValue-&gt;getValueID() == CSSValueWebkitEachLine)
</span><span class="cx">                 textIndentLineValue = TextIndentEachLine;
</span></span></pre></div>
<a id="trunkSourceWebCorecssMediaQueryEvaluatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/MediaQueryEvaluator.cpp (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/MediaQueryEvaluator.cpp        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/MediaQueryEvaluator.cpp        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CSSAspectRatioValue.h&quot;
</span><span class="cx"> #include &quot;CSSPrimitiveValue.h&quot;
</span><ins>+#include &quot;CSSToLengthConversionData.h&quot;
</ins><span class="cx"> #include &quot;CSSValueKeywords.h&quot;
</span><span class="cx"> #include &quot;CSSValueList.h&quot;
</span><span class="cx"> #include &quot;Chrome.h&quot;
</span><span class="lines">@@ -69,7 +70,7 @@
</span><span class="cx"> 
</span><span class="cx"> enum MediaFeaturePrefix { MinPrefix, MaxPrefix, NoPrefix };
</span><span class="cx"> 
</span><del>-typedef bool (*EvalFunc)(CSSValue*, RenderStyle*, Frame*, MediaFeaturePrefix);
</del><ins>+typedef bool (*EvalFunc)(CSSValue*, const CSSToLengthConversionData&amp;, Frame*, MediaFeaturePrefix);
</ins><span class="cx"> typedef HashMap&lt;AtomicStringImpl*, EvalFunc&gt; FunctionMap;
</span><span class="cx"> static FunctionMap* gFunctionMap;
</span><span class="cx"> 
</span><span class="lines">@@ -203,7 +204,7 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool colorMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
</del><ins>+static bool colorMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame* frame, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     int bitsPerComponent = screenDepthPerComponent(frame-&gt;page()-&gt;mainFrame().view());
</span><span class="cx">     float number;
</span><span class="lines">@@ -213,7 +214,7 @@
</span><span class="cx">     return bitsPerComponent != 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool color_indexMediaFeatureEval(CSSValue* value, RenderStyle*, Frame*, MediaFeaturePrefix op)
</del><ins>+static bool color_indexMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame*, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: It's unknown how to retrieve the information if the display mode is indexed
</span><span class="cx">     // Assume we don't support indexed display.
</span><span class="lines">@@ -224,7 +225,7 @@
</span><span class="cx">     return numberValue(value, number) &amp;&amp; compareValue(0, static_cast&lt;int&gt;(number), op);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool monochromeMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix op)
</del><ins>+static bool monochromeMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     if (!screenIsMonochrome(frame-&gt;page()-&gt;mainFrame().view())) {
</span><span class="cx">         if (value) {
</span><span class="lines">@@ -234,10 +235,10 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return colorMediaFeatureEval(value, style, frame, op);
</del><ins>+    return colorMediaFeatureEval(value, conversionData, frame, op);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool orientationMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool orientationMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><span class="cx">     FrameView* view = frame-&gt;view();
</span><span class="cx">     if (!view)
</span><span class="lines">@@ -256,7 +257,7 @@
</span><span class="cx">     return height &gt;= 0 &amp;&amp; width &gt;= 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool aspect_ratioMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
</del><ins>+static bool aspect_ratioMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame* frame, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     FrameView* view = frame-&gt;view();
</span><span class="cx">     if (!view)
</span><span class="lines">@@ -270,7 +271,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool device_aspect_ratioMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
</del><ins>+static bool device_aspect_ratioMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame* frame, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     if (value) {
</span><span class="cx">         FloatRect sg = screenRect(frame-&gt;page()-&gt;mainFrame().view());
</span><span class="lines">@@ -314,12 +315,12 @@
</span><span class="cx">     return compareValue(deviceScaleFactor, resolution-&gt;isNumber() ? resolution-&gt;getFloatValue() : resolution-&gt;getFloatValue(CSSPrimitiveValue::CSS_DPPX), op);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool device_pixel_ratioMediaFeatureEval(CSSValue *value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
</del><ins>+static bool device_pixel_ratioMediaFeatureEval(CSSValue *value, const CSSToLengthConversionData&amp;, Frame* frame, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     return (!value || toCSSPrimitiveValue(value)-&gt;isNumber()) &amp;&amp; evalResolution(value, frame, op);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool resolutionMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
</del><ins>+static bool resolutionMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame* frame, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(RESOLUTION_MEDIA_QUERY)
</span><span class="cx">     return (!value || toCSSPrimitiveValue(value)-&gt;isResolution()) &amp;&amp; evalResolution(value, frame, op);
</span><span class="lines">@@ -331,7 +332,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool gridMediaFeatureEval(CSSValue* value, RenderStyle*, Frame*, MediaFeaturePrefix op)
</del><ins>+static bool gridMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame*, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     // if output device is bitmap, grid: 0 == true
</span><span class="cx">     // assume we have bitmap device
</span><span class="lines">@@ -341,7 +342,7 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool computeLength(CSSValue* value, bool strict, RenderStyle* style, RenderStyle* rootStyle, int&amp; result)
</del><ins>+static bool computeLength(CSSValue* value, bool strict, const CSSToLengthConversionData&amp; conversionData, int&amp; result)
</ins><span class="cx"> {
</span><span class="cx">     if (!value-&gt;isPrimitiveValue())
</span><span class="cx">         return false;
</span><span class="lines">@@ -354,42 +355,40 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (primitiveValue-&gt;isLength()) {
</span><del>-        result = primitiveValue-&gt;computeLength&lt;int&gt;(style, rootStyle);
</del><ins>+        result = primitiveValue-&gt;computeLength&lt;int&gt;(conversionData);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool device_heightMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix op)
</del><ins>+static bool device_heightMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     if (value) {
</span><span class="cx">         FloatRect sg = screenRect(frame-&gt;page()-&gt;mainFrame().view());
</span><del>-        RenderStyle* rootStyle = frame-&gt;document()-&gt;documentElement()-&gt;renderStyle();
</del><span class="cx">         int length;
</span><span class="cx">         long height = sg.height();
</span><del>-        return computeLength(value, !frame-&gt;document()-&gt;inQuirksMode(), style, rootStyle, length) &amp;&amp; compareValue(static_cast&lt;int&gt;(height), length, op);
</del><ins>+        return computeLength(value, !frame-&gt;document()-&gt;inQuirksMode(), conversionData, length) &amp;&amp; compareValue(static_cast&lt;int&gt;(height), length, op);
</ins><span class="cx">     }
</span><span class="cx">     // ({,min-,max-}device-height)
</span><span class="cx">     // assume if we have a device, assume non-zero
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool device_widthMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix op)
</del><ins>+static bool device_widthMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     if (value) {
</span><span class="cx">         FloatRect sg = screenRect(frame-&gt;page()-&gt;mainFrame().view());
</span><del>-        RenderStyle* rootStyle = frame-&gt;document()-&gt;documentElement()-&gt;renderStyle();
</del><span class="cx">         int length;
</span><span class="cx">         long width = sg.width();
</span><del>-        return computeLength(value, !frame-&gt;document()-&gt;inQuirksMode(), style, rootStyle, length) &amp;&amp; compareValue(static_cast&lt;int&gt;(width), length, op);
</del><ins>+        return computeLength(value, !frame-&gt;document()-&gt;inQuirksMode(), conversionData, length) &amp;&amp; compareValue(static_cast&lt;int&gt;(width), length, op);
</ins><span class="cx">     }
</span><span class="cx">     // ({,min-,max-}device-width)
</span><span class="cx">     // assume if we have a device, assume non-zero
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool heightMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix op)
</del><ins>+static bool heightMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     FrameView* view = frame-&gt;view();
</span><span class="cx">     if (!view)
</span><span class="lines">@@ -399,15 +398,14 @@
</span><span class="cx">         int height = view-&gt;layoutHeight();
</span><span class="cx">         if (RenderView* renderView = frame-&gt;document()-&gt;renderView())
</span><span class="cx">             height = adjustForAbsoluteZoom(height, *renderView);
</span><del>-        RenderStyle* rootStyle = frame-&gt;document()-&gt;documentElement()-&gt;renderStyle();
</del><span class="cx">         int length;
</span><del>-        return computeLength(value, !frame-&gt;document()-&gt;inQuirksMode(), style, rootStyle, length) &amp;&amp; compareValue(height, length, op);
</del><ins>+        return computeLength(value, !frame-&gt;document()-&gt;inQuirksMode(), conversionData, length) &amp;&amp; compareValue(height, length, op);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return view-&gt;layoutHeight() != 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool widthMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix op)
</del><ins>+static bool widthMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     FrameView* view = frame-&gt;view();
</span><span class="cx">     if (!view)
</span><span class="lines">@@ -417,9 +415,8 @@
</span><span class="cx">         int width = view-&gt;layoutWidth();
</span><span class="cx">         if (RenderView* renderView = frame-&gt;document()-&gt;renderView())
</span><span class="cx">             width = adjustForAbsoluteZoom(width, *renderView);
</span><del>-        RenderStyle* rootStyle = frame-&gt;document()-&gt;documentElement()-&gt;renderStyle();
</del><span class="cx">         int length;
</span><del>-        return computeLength(value, !frame-&gt;document()-&gt;inQuirksMode(), style, rootStyle, length) &amp;&amp; compareValue(width, length, op);
</del><ins>+        return computeLength(value, !frame-&gt;document()-&gt;inQuirksMode(), conversionData, length) &amp;&amp; compareValue(width, length, op);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return view-&gt;layoutWidth() != 0;
</span><span class="lines">@@ -427,117 +424,117 @@
</span><span class="cx"> 
</span><span class="cx"> // rest of the functions are trampolines which set the prefix according to the media feature expression used
</span><span class="cx"> 
</span><del>-static bool min_colorMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool min_colorMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return colorMediaFeatureEval(value, style, frame, MinPrefix);
</del><ins>+    return colorMediaFeatureEval(value, conversionData, frame, MinPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool max_colorMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool max_colorMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return colorMediaFeatureEval(value, style, frame, MaxPrefix);
</del><ins>+    return colorMediaFeatureEval(value, conversionData, frame, MaxPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool min_color_indexMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool min_color_indexMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return color_indexMediaFeatureEval(value, style, frame, MinPrefix);
</del><ins>+    return color_indexMediaFeatureEval(value, conversionData, frame, MinPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool max_color_indexMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool max_color_indexMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return color_indexMediaFeatureEval(value, style, frame, MaxPrefix);
</del><ins>+    return color_indexMediaFeatureEval(value, conversionData, frame, MaxPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool min_monochromeMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool min_monochromeMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return monochromeMediaFeatureEval(value, style, frame, MinPrefix);
</del><ins>+    return monochromeMediaFeatureEval(value, conversionData, frame, MinPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool max_monochromeMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool max_monochromeMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return monochromeMediaFeatureEval(value, style, frame, MaxPrefix);
</del><ins>+    return monochromeMediaFeatureEval(value, conversionData, frame, MaxPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool min_aspect_ratioMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool min_aspect_ratioMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return aspect_ratioMediaFeatureEval(value, style, frame, MinPrefix);
</del><ins>+    return aspect_ratioMediaFeatureEval(value, conversionData, frame, MinPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool max_aspect_ratioMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool max_aspect_ratioMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return aspect_ratioMediaFeatureEval(value, style, frame, MaxPrefix);
</del><ins>+    return aspect_ratioMediaFeatureEval(value, conversionData, frame, MaxPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool min_device_aspect_ratioMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool min_device_aspect_ratioMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return device_aspect_ratioMediaFeatureEval(value, style, frame, MinPrefix);
</del><ins>+    return device_aspect_ratioMediaFeatureEval(value, conversionData, frame, MinPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool max_device_aspect_ratioMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool max_device_aspect_ratioMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return device_aspect_ratioMediaFeatureEval(value, style, frame, MaxPrefix);
</del><ins>+    return device_aspect_ratioMediaFeatureEval(value, conversionData, frame, MaxPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool min_device_pixel_ratioMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool min_device_pixel_ratioMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return device_pixel_ratioMediaFeatureEval(value, style, frame, MinPrefix);
</del><ins>+    return device_pixel_ratioMediaFeatureEval(value, conversionData, frame, MinPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool max_device_pixel_ratioMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool max_device_pixel_ratioMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return device_pixel_ratioMediaFeatureEval(value, style, frame, MaxPrefix);
</del><ins>+    return device_pixel_ratioMediaFeatureEval(value, conversionData, frame, MaxPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool min_heightMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool min_heightMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return heightMediaFeatureEval(value, style, frame, MinPrefix);
</del><ins>+    return heightMediaFeatureEval(value, conversionData, frame, MinPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool max_heightMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool max_heightMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return heightMediaFeatureEval(value, style, frame, MaxPrefix);
</del><ins>+    return heightMediaFeatureEval(value, conversionData, frame, MaxPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool min_widthMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool min_widthMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return widthMediaFeatureEval(value, style, frame, MinPrefix);
</del><ins>+    return widthMediaFeatureEval(value, conversionData, frame, MinPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool max_widthMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool max_widthMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return widthMediaFeatureEval(value, style, frame, MaxPrefix);
</del><ins>+    return widthMediaFeatureEval(value, conversionData, frame, MaxPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool min_device_heightMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool min_device_heightMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return device_heightMediaFeatureEval(value, style, frame, MinPrefix);
</del><ins>+    return device_heightMediaFeatureEval(value, conversionData, frame, MinPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool max_device_heightMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool max_device_heightMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return device_heightMediaFeatureEval(value, style, frame, MaxPrefix);
</del><ins>+    return device_heightMediaFeatureEval(value, conversionData, frame, MaxPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool min_device_widthMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool min_device_widthMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return device_widthMediaFeatureEval(value, style, frame, MinPrefix);
</del><ins>+    return device_widthMediaFeatureEval(value, conversionData, frame, MinPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool max_device_widthMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool max_device_widthMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return device_widthMediaFeatureEval(value, style, frame, MaxPrefix);
</del><ins>+    return device_widthMediaFeatureEval(value, conversionData, frame, MaxPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool min_resolutionMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool min_resolutionMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return resolutionMediaFeatureEval(value, style, frame, MinPrefix);
</del><ins>+    return resolutionMediaFeatureEval(value, conversionData, frame, MinPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool max_resolutionMediaFeatureEval(CSSValue* value, RenderStyle* style, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool max_resolutionMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><del>-    return resolutionMediaFeatureEval(value, style, frame, MaxPrefix);
</del><ins>+    return resolutionMediaFeatureEval(value, conversionData, frame, MaxPrefix);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool animationMediaFeatureEval(CSSValue* value, RenderStyle*, Frame*, MediaFeaturePrefix op)
</del><ins>+static bool animationMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame*, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     if (value) {
</span><span class="cx">         float number;
</span><span class="lines">@@ -546,7 +543,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool transitionMediaFeatureEval(CSSValue* value, RenderStyle*, Frame*, MediaFeaturePrefix op)
</del><ins>+static bool transitionMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame*, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     if (value) {
</span><span class="cx">         float number;
</span><span class="lines">@@ -555,7 +552,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool transform_2dMediaFeatureEval(CSSValue* value, RenderStyle*, Frame*, MediaFeaturePrefix op)
</del><ins>+static bool transform_2dMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame*, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     if (value) {
</span><span class="cx">         float number;
</span><span class="lines">@@ -564,7 +561,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool transform_3dMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
</del><ins>+static bool transform_3dMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame* frame, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     bool returnValueIfNoParameter;
</span><span class="cx">     int have3dRendering;
</span><span class="lines">@@ -590,7 +587,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(VIEW_MODE_CSS_MEDIA)
</span><del>-static bool view_modeMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix op)
</del><ins>+static bool view_modeMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame* frame, MediaFeaturePrefix op)
</ins><span class="cx"> {
</span><span class="cx">     UNUSED_PARAM(op);
</span><span class="cx">     if (!value)
</span><span class="lines">@@ -635,7 +632,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool video_playable_inlineMediaFeatureEval(CSSValue*, RenderStyle*, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool video_playable_inlineMediaFeatureEval(CSSValue*, const CSSToLengthConversionData&amp;, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><span class="cx">     return !isRunningOnIPhoneOrIPod() || frame-&gt;settings().mediaPlaybackAllowsInline();
</span><span class="cx"> }
</span><span class="lines">@@ -657,7 +654,7 @@
</span><span class="cx">     return UnknownPointer;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool hoverMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool hoverMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><span class="cx">     PointerDeviceType pointer = leastCapablePrimaryPointerDeviceType(frame);
</span><span class="cx"> 
</span><span class="lines">@@ -678,7 +675,7 @@
</span><span class="cx">         || (pointer == MousePointer &amp;&amp; number == 1);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool pointerMediaFeatureEval(CSSValue* value, RenderStyle*, Frame* frame, MediaFeaturePrefix)
</del><ins>+static bool pointerMediaFeatureEval(CSSValue* value, const CSSToLengthConversionData&amp;, Frame* frame, MediaFeaturePrefix)
</ins><span class="cx"> {
</span><span class="cx">     PointerDeviceType pointer = leastCapablePrimaryPointerDeviceType(frame);
</span><span class="cx"> 
</span><span class="lines">@@ -727,8 +724,10 @@
</span><span class="cx">     // and let trampoline functions override the prefix if prefix is
</span><span class="cx">     // used
</span><span class="cx">     EvalFunc func = gFunctionMap-&gt;get(expr-&gt;mediaFeature().impl());
</span><del>-    if (func)
-        return func(expr-&gt;value(), m_style.get(), m_frame, NoPrefix);
</del><ins>+    if (func) {
+        CSSToLengthConversionData conversionData(m_style.get(), m_frame-&gt;document()-&gt;documentElement()-&gt;renderStyle());
+        return func(expr-&gt;value(), conversionData, m_frame, NoPrefix);
+    }
</ins><span class="cx"> 
</span><span class="cx">     return false;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssSVGCSSStyleSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/SVGCSSStyleSelector.cpp        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -593,9 +593,9 @@
</span><span class="cx">             if (!firstValue-&gt;isShadowValue())
</span><span class="cx">                 return;
</span><span class="cx">             CSSShadowValue* item = toCSSShadowValue(firstValue);
</span><del>-            IntPoint location(item-&gt;x-&gt;computeLength&lt;int&gt;(state.style(), state.rootElementStyle()),
-                item-&gt;y-&gt;computeLength&lt;int&gt;(state.style(), state.rootElementStyle()));
-            int blur = item-&gt;blur ? item-&gt;blur-&gt;computeLength&lt;int&gt;(state.style(), state.rootElementStyle()) : 0;
</del><ins>+            IntPoint location(item-&gt;x-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0f)),
+                item-&gt;y-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0f)));
+            int blur = item-&gt;blur ? item-&gt;blur-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0f)) : 0;
</ins><span class="cx">             Color color;
</span><span class="cx">             if (item-&gt;color)
</span><span class="cx">                 color = colorFromPrimitiveValue(item-&gt;color.get());
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -243,6 +243,7 @@
</span><span class="cx"> #if ENABLE(CSS_FILTERS)
</span><span class="cx">     m_filtersWithPendingSVGDocuments.clear();
</span><span class="cx"> #endif
</span><ins>+    m_cssToLengthConversionData = CSSToLengthConversionData(nullptr, nullptr);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void StyleResolver::MatchResult::addMatchedProperties(const StyleProperties&amp; properties, StyleRule* rule, unsigned linkMatchType, PropertyWhitelistType propertyWhitelistType)
</span><span class="lines">@@ -422,6 +423,8 @@
</span><span class="cx">     m_style = nullptr;
</span><span class="cx">     m_pendingImageProperties.clear();
</span><span class="cx">     m_fontDirty = false;
</span><ins>+
+    m_cssToLengthConversionData = CSSToLengthConversionData(m_style.get(), m_rootElementStyle);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static const unsigned cStyleSearchThreshold = 10;
</span><span class="lines">@@ -1448,14 +1451,14 @@
</span><span class="cx"> // -------------------------------------------------------------------------------------
</span><span class="cx"> // this is mostly boring stuff on how to apply a certain rule to the renderstyle...
</span><span class="cx"> 
</span><del>-Length StyleResolver::convertToIntLength(const CSSPrimitiveValue* primitiveValue, const RenderStyle* style, const RenderStyle* rootStyle, double multiplier)
</del><ins>+Length StyleResolver::convertToIntLength(const CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData&amp; conversionData)
</ins><span class="cx"> {
</span><del>-    return primitiveValue ? primitiveValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion | FractionConversion | ViewportPercentageConversion&gt;(style, rootStyle, multiplier) : Length(Undefined);
</del><ins>+    return primitiveValue ? primitiveValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion | FractionConversion | ViewportPercentageConversion&gt;(conversionData) : Length(Undefined);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-Length StyleResolver::convertToFloatLength(const CSSPrimitiveValue* primitiveValue, const RenderStyle* style, const RenderStyle* rootStyle, double multiplier)
</del><ins>+Length StyleResolver::convertToFloatLength(const CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData&amp; conversionData)
</ins><span class="cx"> {
</span><del>-    return primitiveValue ? primitiveValue-&gt;convertToLength&lt;FixedFloatConversion | PercentConversion | CalculatedConversion | FractionConversion | ViewportPercentageConversion&gt;(style, rootStyle, multiplier) : Length(Undefined);
</del><ins>+    return primitiveValue ? primitiveValue-&gt;convertToLength&lt;FixedFloatConversion | PercentConversion | CalculatedConversion | FractionConversion | ViewportPercentageConversion&gt;(conversionData) : Length(Undefined);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool shouldApplyPropertyInParseOrder(CSSPropertyID propertyID)
</span><span class="lines">@@ -1856,7 +1859,7 @@
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    workingLength = primitiveValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | ViewportPercentageConversion | CalculatedConversion | AutoConversion&gt;(state.style(), state.rootElementStyle(), state.style()-&gt;effectiveZoom());
</del><ins>+    workingLength = primitiveValue-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | ViewportPercentageConversion | CalculatedConversion | AutoConversion&gt;(state.cssToLengthConversionData());
</ins><span class="cx">     if (workingLength.length().isUndefined())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -2022,8 +2025,6 @@
</span><span class="cx"> 
</span><span class="cx">     CSSPrimitiveValue* primitiveValue = value-&gt;isPrimitiveValue() ? toCSSPrimitiveValue(value) : 0;
</span><span class="cx"> 
</span><del>-    float zoomFactor = state.style()-&gt;effectiveZoom();
-
</del><span class="cx">     // What follows is a list that maps the CSS properties into their corresponding front-end
</span><span class="cx">     // RenderStyle values.
</span><span class="cx">     switch (id) {
</span><span class="lines">@@ -2301,16 +2302,16 @@
</span><span class="cx">             if (!currValue-&gt;isShadowValue())
</span><span class="cx">                 continue;
</span><span class="cx">             CSSShadowValue* item = toCSSShadowValue(currValue);
</span><del>-            int x = item-&gt;x-&gt;computeLength&lt;int&gt;(state.style(), state.rootElementStyle(), zoomFactor);
</del><ins>+            int x = item-&gt;x-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData());
</ins><span class="cx">             if (item-&gt;x-&gt;isViewportPercentageLength())
</span><span class="cx">                 x = viewportPercentageValue(*item-&gt;x, x);
</span><del>-            int y = item-&gt;y-&gt;computeLength&lt;int&gt;(state.style(), state.rootElementStyle(), zoomFactor);
</del><ins>+            int y = item-&gt;y-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData());
</ins><span class="cx">             if (item-&gt;y-&gt;isViewportPercentageLength())
</span><span class="cx">                 y = viewportPercentageValue(*item-&gt;y, y);
</span><del>-            int blur = item-&gt;blur ? item-&gt;blur-&gt;computeLength&lt;int&gt;(state.style(), state.rootElementStyle(), zoomFactor) : 0;
</del><ins>+            int blur = item-&gt;blur ? item-&gt;blur-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData()) : 0;
</ins><span class="cx">             if (item-&gt;blur &amp;&amp; item-&gt;blur-&gt;isViewportPercentageLength())
</span><span class="cx">                 blur = viewportPercentageValue(*item-&gt;blur, blur);
</span><del>-            int spread = item-&gt;spread ? item-&gt;spread-&gt;computeLength&lt;int&gt;(state.style(), state.rootElementStyle(), zoomFactor) : 0;
</del><ins>+            int spread = item-&gt;spread ? item-&gt;spread-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData()) : 0;
</ins><span class="cx">             if (item-&gt;spread &amp;&amp; item-&gt;spread-&gt;isViewportPercentageLength())
</span><span class="cx">                 spread = viewportPercentageValue(*item-&gt;spread, spread);
</span><span class="cx">             ShadowStyle shadowStyle = item-&gt;style &amp;&amp; item-&gt;style-&gt;getValueID() == CSSValueInset ? Inset : Normal;
</span><span class="lines">@@ -2342,7 +2343,7 @@
</span><span class="cx">         RefPtr&lt;StyleReflection&gt; reflection = StyleReflection::create();
</span><span class="cx">         reflection-&gt;setDirection(*reflectValue-&gt;direction());
</span><span class="cx">         if (reflectValue-&gt;offset())
</span><del>-            reflection-&gt;setOffset(reflectValue-&gt;offset()-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion&gt;(state.style(), state.rootElementStyle(), zoomFactor));
</del><ins>+            reflection-&gt;setOffset(reflectValue-&gt;offset()-&gt;convertToLength&lt;FixedIntegerConversion | PercentConversion | CalculatedConversion&gt;(state.cssToLengthConversionData()));
</ins><span class="cx">         NinePieceImage mask;
</span><span class="cx">         mask.setMaskDefaults();
</span><span class="cx">         m_styleMap.mapNinePieceImage(id, reflectValue-&gt;mask(), mask);
</span><span class="lines">@@ -2403,10 +2404,10 @@
</span><span class="cx"> 
</span><span class="cx">         DashboardRegion* first = region;
</span><span class="cx">         while (region) {
</span><del>-            Length top = convertToIntLength(region-&gt;top(), state.style(), state.rootElementStyle());
-            Length right = convertToIntLength(region-&gt;right(), state.style(), state.rootElementStyle());
-            Length bottom = convertToIntLength(region-&gt;bottom(), state.style(), state.rootElementStyle());
-            Length left = convertToIntLength(region-&gt;left(), state.style(), state.rootElementStyle());
</del><ins>+            Length top = convertToIntLength(region-&gt;top(), state.cssToLengthConversionData().copyWithAdjustedZoom(1.0f));
+            Length right = convertToIntLength(region-&gt;right(), state.cssToLengthConversionData().copyWithAdjustedZoom(1.0f));
+            Length bottom = convertToIntLength(region-&gt;bottom(), state.cssToLengthConversionData().copyWithAdjustedZoom(1.0f));
+            Length left = convertToIntLength(region-&gt;left(), state.cssToLengthConversionData().copyWithAdjustedZoom(1.0f));
</ins><span class="cx"> 
</span><span class="cx">             if (top.isUndefined())
</span><span class="cx">                 top = Length();
</span><span class="lines">@@ -2442,11 +2443,11 @@
</span><span class="cx">             else if (primitiveValue-&gt;getValueID() == CSSValueThick)
</span><span class="cx">                 result *= 5;
</span><span class="cx">             Ref&lt;CSSPrimitiveValue&gt; value(CSSPrimitiveValue::create(result, CSSPrimitiveValue::CSS_EMS));
</span><del>-            width = value.get().computeLength&lt;float&gt;(state.style(), state.rootElementStyle(), zoomFactor);
</del><ins>+            width = value.get().computeLength&lt;float&gt;(state.cssToLengthConversionData());
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         default:
</span><del>-            width = primitiveValue-&gt;computeLength&lt;float&gt;(state.style(), state.rootElementStyle(), zoomFactor);
</del><ins>+            width = primitiveValue-&gt;computeLength&lt;float&gt;(state.cssToLengthConversionData());
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">         state.style()-&gt;setTextStrokeWidth(width);
</span><span class="lines">@@ -2455,7 +2456,7 @@
</span><span class="cx">     case CSSPropertyWebkitTransform: {
</span><span class="cx">         HANDLE_INHERIT_AND_INITIAL(transform, Transform);
</span><span class="cx">         TransformOperations operations;
</span><del>-        transformsForValue(state.style(), state.rootElementStyle(), value, operations);
</del><ins>+        transformsForValue(value, state.cssToLengthConversionData(), operations);
</ins><span class="cx">         state.style()-&gt;setTransform(operations);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -2472,11 +2473,11 @@
</span><span class="cx"> 
</span><span class="cx">         float perspectiveValue;
</span><span class="cx">         if (primitiveValue-&gt;isLength())
</span><del>-            perspectiveValue = primitiveValue-&gt;computeLength&lt;float&gt;(state.style(), state.rootElementStyle(), zoomFactor);
</del><ins>+            perspectiveValue = primitiveValue-&gt;computeLength&lt;float&gt;(state.cssToLengthConversionData());
</ins><span class="cx">         else if (primitiveValue-&gt;isNumber()) {
</span><span class="cx">             // For backward compatibility, treat valueless numbers as px.
</span><span class="cx">             Ref&lt;CSSPrimitiveValue&gt; value(CSSPrimitiveValue::create(primitiveValue-&gt;getDoubleValue(), CSSPrimitiveValue::CSS_PX));
</span><del>-            perspectiveValue = value.get().computeLength&lt;float&gt;(state.style(), state.rootElementStyle(), zoomFactor);
</del><ins>+            perspectiveValue = value.get().computeLength&lt;float&gt;(state.cssToLengthConversionData());
</ins><span class="cx">         } else
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="lines">@@ -3314,8 +3315,6 @@
</span><span class="cx"> bool StyleResolver::createFilterOperations(CSSValue* inValue, FilterOperations&amp; outOperations)
</span><span class="cx"> {
</span><span class="cx">     State&amp; state = m_state;
</span><del>-    RenderStyle* style = state.style();
-    RenderStyle* rootStyle = state.rootElementStyle();
</del><span class="cx">     ASSERT(outOperations.isEmpty());
</span><span class="cx">     
</span><span class="cx">     if (!inValue)
</span><span class="lines">@@ -3330,7 +3329,6 @@
</span><span class="cx">     if (!inValue-&gt;isValueList())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    float zoomFactor = style ? style-&gt;effectiveZoom() : 1;
</del><span class="cx">     FilterOperations operations;
</span><span class="cx">     for (CSSValueListIterator i = inValue; i.hasMore(); i.advance()) {
</span><span class="cx">         CSSValue* currValue = i.value();
</span><span class="lines">@@ -3416,7 +3414,7 @@
</span><span class="cx">         case WebKitCSSFilterValue::BlurFilterOperation: {
</span><span class="cx">             Length stdDeviation = Length(0, Fixed);
</span><span class="cx">             if (filterValue-&gt;length() &gt;= 1)
</span><del>-                stdDeviation = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
</del><ins>+                stdDeviation = convertToFloatLength(firstValue, state.cssToLengthConversionData());
</ins><span class="cx">             if (stdDeviation.isUndefined())
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="lines">@@ -3432,14 +3430,14 @@
</span><span class="cx">                 continue;
</span><span class="cx"> 
</span><span class="cx">             CSSShadowValue* item = toCSSShadowValue(cssValue);
</span><del>-            int x = item-&gt;x-&gt;computeLength&lt;int&gt;(style, rootStyle, zoomFactor);
</del><ins>+            int x = item-&gt;x-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData());
</ins><span class="cx">             if (item-&gt;x-&gt;isViewportPercentageLength())
</span><span class="cx">                 x = viewportPercentageValue(*item-&gt;x, x);
</span><del>-            int y = item-&gt;y-&gt;computeLength&lt;int&gt;(style, rootStyle, zoomFactor);
</del><ins>+            int y = item-&gt;y-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData());
</ins><span class="cx">             if (item-&gt;y-&gt;isViewportPercentageLength())
</span><span class="cx">                 y = viewportPercentageValue(*item-&gt;y, y);
</span><span class="cx">             IntPoint location(x, y);
</span><del>-            int blur = item-&gt;blur ? item-&gt;blur-&gt;computeLength&lt;int&gt;(style, rootStyle, zoomFactor) : 0;
</del><ins>+            int blur = item-&gt;blur ? item-&gt;blur-&gt;computeLength&lt;int&gt;(state.cssToLengthConversionData()) : 0;
</ins><span class="cx">             if (item-&gt;blur &amp;&amp; item-&gt;blur-&gt;isViewportPercentageLength())
</span><span class="cx">                 blur = viewportPercentageValue(*item-&gt;blur, blur);
</span><span class="cx">             Color color;
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolverh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.h (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.h        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/StyleResolver.h        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> #ifndef StyleResolver_h
</span><span class="cx"> #define StyleResolver_h
</span><span class="cx"> 
</span><ins>+#include &quot;CSSToLengthConversionData.h&quot;
</ins><span class="cx"> #include &quot;CSSToStyleMap.h&quot;
</span><span class="cx"> #include &quot;CSSValueList.h&quot;
</span><span class="cx"> #include &quot;DocumentRuleSets.h&quot;
</span><span class="lines">@@ -354,7 +355,11 @@
</span><span class="cx">         Document&amp; document() const { return m_element-&gt;document(); }
</span><span class="cx">         Element* element() const { return m_element; }
</span><span class="cx">         StyledElement* styledElement() const { return m_styledElement; }
</span><del>-        void setStyle(PassRef&lt;RenderStyle&gt; style) { m_style = std::move(style); }
</del><ins>+        void setStyle(PassRef&lt;RenderStyle&gt; style)
+        {
+            m_style = std::move(style);
+            m_cssToLengthConversionData = CSSToLengthConversionData(m_style.get(), m_rootElementStyle);
+        }
</ins><span class="cx">         RenderStyle* style() const { return m_style.get(); }
</span><span class="cx">         PassRef&lt;RenderStyle&gt; takeStyle() { return m_style.releaseNonNull(); }
</span><span class="cx"> 
</span><span class="lines">@@ -397,6 +402,8 @@
</span><span class="cx"> 
</span><span class="cx">         bool useSVGZoomRules() const { return m_element &amp;&amp; m_element-&gt;isSVGElement(); }
</span><span class="cx"> 
</span><ins>+        CSSToLengthConversionData cssToLengthConversionData() const { return m_cssToLengthConversionData; }
+
</ins><span class="cx">     private:
</span><span class="cx">         // FIXME(bug 108563): to make it easier to review, these member
</span><span class="cx">         // variables are public. However we should add methods to access
</span><span class="lines">@@ -428,6 +435,8 @@
</span><span class="cx">         BorderData m_borderData;
</span><span class="cx">         FillLayer m_backgroundData;
</span><span class="cx">         Color m_backgroundColor;
</span><ins>+
+        CSSToLengthConversionData m_cssToLengthConversionData;
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     State&amp; state() { return m_state; }
</span><span class="lines">@@ -445,8 +454,8 @@
</span><span class="cx">     bool applyPropertyToRegularStyle() const { return m_state.applyPropertyToRegularStyle(); }
</span><span class="cx">     bool applyPropertyToVisitedLinkStyle() const { return m_state.applyPropertyToVisitedLinkStyle(); }
</span><span class="cx"> 
</span><del>-    static Length convertToIntLength(const CSSPrimitiveValue*, const RenderStyle*, const RenderStyle* rootStyle, double multiplier = 1);
-    static Length convertToFloatLength(const CSSPrimitiveValue*, const RenderStyle*, const RenderStyle* rootStyle, double multiplier = 1);
</del><ins>+    static Length convertToIntLength(const CSSPrimitiveValue*, const CSSToLengthConversionData&amp;);
+    static Length convertToFloatLength(const CSSPrimitiveValue*, const CSSToLengthConversionData&amp;);
</ins><span class="cx"> 
</span><span class="cx">     CSSToStyleMap* styleMap() { return &amp;m_styleMap; }
</span><span class="cx">     InspectorCSSOMWrappers&amp; inspectorCSSOMWrappers() { return m_inspectorCSSOMWrappers; }
</span></span></pre></div>
<a id="trunkSourceWebCorecssTransformFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/TransformFunctions.cpp (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/TransformFunctions.cpp        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/TransformFunctions.cpp        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -76,19 +76,18 @@
</span><span class="cx">     return TransformOperation::NONE;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Length convertToFloatLength(const CSSPrimitiveValue* primitiveValue, const RenderStyle* style, const RenderStyle* rootStyle, double multiplier)
</del><ins>+static Length convertToFloatLength(const CSSPrimitiveValue* primitiveValue, const CSSToLengthConversionData&amp; conversionData)
</ins><span class="cx"> {
</span><del>-    return primitiveValue ? primitiveValue-&gt;convertToLength&lt;FixedFloatConversion | PercentConversion | CalculatedConversion | FractionConversion | ViewportPercentageConversion&gt;(style, rootStyle, multiplier) : Length(Undefined);
</del><ins>+    return primitiveValue ? primitiveValue-&gt;convertToLength&lt;FixedFloatConversion | PercentConversion | CalculatedConversion | FractionConversion | ViewportPercentageConversion&gt;(conversionData) : Length(Undefined);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool transformsForValue(const RenderStyle* style, const RenderStyle* rootStyle, CSSValue* value, TransformOperations&amp; outOperations)
</del><ins>+bool transformsForValue(CSSValue* value, const CSSToLengthConversionData&amp; conversionData, TransformOperations&amp; outOperations)
</ins><span class="cx"> {
</span><span class="cx">     if (!value || !value-&gt;isValueList()) {
</span><span class="cx">         outOperations.clear();
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    float zoomFactor = style ? style-&gt;effectiveZoom() : 1;
</del><span class="cx">     TransformOperations operations;
</span><span class="cx">     for (CSSValueListIterator i = value; i.hasMore(); i.advance()) {
</span><span class="cx">         CSSValue* currValue = i.value();
</span><span class="lines">@@ -165,13 +164,13 @@
</span><span class="cx">             Length tx = Length(0, Fixed);
</span><span class="cx">             Length ty = Length(0, Fixed);
</span><span class="cx">             if (transformValue-&gt;operationType() == WebKitCSSTransformValue::TranslateYTransformOperation)
</span><del>-                ty = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
</del><ins>+                ty = convertToFloatLength(firstValue, conversionData);
</ins><span class="cx">             else {
</span><del>-                tx = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
</del><ins>+                tx = convertToFloatLength(firstValue, conversionData);
</ins><span class="cx">                 if (transformValue-&gt;operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
</span><span class="cx">                     if (transformValue-&gt;length() &gt; 1) {
</span><span class="cx">                         CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(1));
</span><del>-                        ty = convertToFloatLength(secondValue, style, rootStyle, zoomFactor);
</del><ins>+                        ty = convertToFloatLength(secondValue, conversionData);
</ins><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="lines">@@ -188,19 +187,19 @@
</span><span class="cx">             Length ty = Length(0, Fixed);
</span><span class="cx">             Length tz = Length(0, Fixed);
</span><span class="cx">             if (transformValue-&gt;operationType() == WebKitCSSTransformValue::TranslateZTransformOperation)
</span><del>-                tz = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
</del><ins>+                tz = convertToFloatLength(firstValue, conversionData);
</ins><span class="cx">             else if (transformValue-&gt;operationType() == WebKitCSSTransformValue::TranslateYTransformOperation)
</span><del>-                ty = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
</del><ins>+                ty = convertToFloatLength(firstValue, conversionData);
</ins><span class="cx">             else {
</span><del>-                tx = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
</del><ins>+                tx = convertToFloatLength(firstValue, conversionData);
</ins><span class="cx">                 if (transformValue-&gt;operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
</span><span class="cx">                     if (transformValue-&gt;length() &gt; 2) {
</span><span class="cx">                         CSSPrimitiveValue* thirdValue = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(2));
</span><del>-                        tz = convertToFloatLength(thirdValue, style, rootStyle, zoomFactor);
</del><ins>+                        tz = convertToFloatLength(thirdValue, conversionData);
</ins><span class="cx">                     }
</span><span class="cx">                     if (transformValue-&gt;length() &gt; 1) {
</span><span class="cx">                         CSSPrimitiveValue* secondValue = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(1));
</span><del>-                        ty = convertToFloatLength(secondValue, style, rootStyle, zoomFactor);
</del><ins>+                        ty = convertToFloatLength(secondValue, conversionData);
</ins><span class="cx">                     }
</span><span class="cx">                 }
</span><span class="cx">             }
</span><span class="lines">@@ -273,8 +272,8 @@
</span><span class="cx">             double b = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(1))-&gt;getDoubleValue();
</span><span class="cx">             double c = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(2))-&gt;getDoubleValue();
</span><span class="cx">             double d = toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(3))-&gt;getDoubleValue();
</span><del>-            double e = zoomFactor * toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(4))-&gt;getDoubleValue();
-            double f = zoomFactor * toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(5))-&gt;getDoubleValue();
</del><ins>+            double e = conversionData.zoom() * toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(4))-&gt;getDoubleValue();
+            double f = conversionData.zoom() * toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(5))-&gt;getDoubleValue();
</ins><span class="cx">             operations.operations().append(MatrixTransformOperation::create(a, b, c, d, e, f));
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="lines">@@ -293,8 +292,8 @@
</span><span class="cx">                 toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(9))-&gt;getDoubleValue(),
</span><span class="cx">                 toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(10))-&gt;getDoubleValue(),
</span><span class="cx">                 toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(11))-&gt;getDoubleValue(),
</span><del>-                zoomFactor * toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(12))-&gt;getDoubleValue(),
-                zoomFactor * toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(13))-&gt;getDoubleValue(),
</del><ins>+                conversionData.zoom() * toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(12))-&gt;getDoubleValue(),
+                conversionData.zoom() * toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(13))-&gt;getDoubleValue(),
</ins><span class="cx">                 toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(14))-&gt;getDoubleValue(),
</span><span class="cx">                 toCSSPrimitiveValue(transformValue-&gt;itemWithoutBoundsCheck(15))-&gt;getDoubleValue());
</span><span class="cx">             operations.operations().append(Matrix3DTransformOperation::create(matrix));
</span><span class="lines">@@ -303,7 +302,7 @@
</span><span class="cx">         case WebKitCSSTransformValue::PerspectiveTransformOperation: {
</span><span class="cx">             Length p = Length(0, Fixed);
</span><span class="cx">             if (firstValue-&gt;isLength())
</span><del>-                p = convertToFloatLength(firstValue, style, rootStyle, zoomFactor);
</del><ins>+                p = convertToFloatLength(firstValue, conversionData);
</ins><span class="cx">             else {
</span><span class="cx">                 // This is a quirk that should go away when 3d transforms are finalized.
</span><span class="cx">                 double val = firstValue-&gt;getDoubleValue();
</span></span></pre></div>
<a id="trunkSourceWebCorecssTransformFunctionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/TransformFunctions.h (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/TransformFunctions.h        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/TransformFunctions.h        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -34,11 +34,12 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class CSSToLengthConversionData;
</ins><span class="cx"> class CSSValue;
</span><span class="cx"> class RenderStyle;
</span><span class="cx"> class WebKitCSSTransformValue;
</span><span class="cx"> 
</span><del>-bool transformsForValue(const RenderStyle*, const RenderStyle* rootStyle, CSSValue*, TransformOperations&amp;);
</del><ins>+bool transformsForValue(CSSValue*, const CSSToLengthConversionData&amp;, TransformOperations&amp;);
</ins><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorecssWebKitCSSMatrixcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/WebKitCSSMatrix.cpp (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/WebKitCSSMatrix.cpp        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/css/WebKitCSSMatrix.cpp        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CSSParser.h&quot;
</span><span class="cx"> #include &quot;CSSPropertyNames.h&quot;
</span><ins>+#include &quot;CSSToLengthConversionData.h&quot;
</ins><span class="cx"> #include &quot;CSSValueKeywords.h&quot;
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;StyleProperties.h&quot;
</span><span class="lines">@@ -66,7 +67,7 @@
</span><span class="cx">             return;
</span><span class="cx"> 
</span><span class="cx">         TransformOperations operations;
</span><del>-        if (!transformsForValue(0, 0, value.get(), operations)) {
</del><ins>+        if (!transformsForValue(value.get(), CSSToLengthConversionData(), operations)) {
</ins><span class="cx">             ec = SYNTAX_ERR;
</span><span class="cx">             return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (167936 => 167937)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm        2014-04-29 16:17:09 UTC (rev 167936)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm        2014-04-29 16:36:43 UTC (rev 167937)
</span><span class="lines">@@ -526,7 +526,7 @@
</span><span class="cx"> {
</span><span class="cx">     Document&amp; document = element-&gt;document();
</span><span class="cx">     RefPtr&lt;CSSPrimitiveValue&gt; emSize = CSSPrimitiveValue::create(0.5, CSSPrimitiveValue::CSS_EMS);
</span><del>-    int pixels = emSize-&gt;computeLength&lt;int&gt;(style, document.renderStyle(), document.frame()-&gt;pageZoomFactor());
</del><ins>+    int pixels = emSize-&gt;computeLength&lt;int&gt;(CSSToLengthConversionData(style, document.renderStyle(), document.frame()-&gt;pageZoomFactor()));
</ins><span class="cx">     style-&gt;setPaddingBox(LengthBox(0, pixels, 0, pixels));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -934,7 +934,7 @@
</span><span class="cx">     // CSSPrimitiveValue::computeLengthInt only needs the element's style to calculate em lengths.
</span><span class="cx">     // Since the element might not be in a document, just pass nullptr for the root element style.
</span><span class="cx">     RefPtr&lt;CSSPrimitiveValue&gt; emSize = CSSPrimitiveValue::create(1.0, CSSPrimitiveValue::CSS_EMS);
</span><del>-    int pixels = emSize-&gt;computeLength&lt;int&gt;(style, nullptr);
</del><ins>+    int pixels = emSize-&gt;computeLength&lt;int&gt;(CSSToLengthConversionData(style, nullptr, 1.0));
</ins><span class="cx">     style-&gt;setPaddingBox(LengthBox(0, pixels, 0, pixels));
</span><span class="cx"> 
</span><span class="cx">     if (!element)
</span></span></pre>
</div>
</div>

</body>
</html>