Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(532)

Unified Diff: Source/core/css/CSSPrimitiveValue.cpp

Issue 963733002: [svg2] Make 'width' and 'height' presentation attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaseline some EX tests [Mac Win] Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | Source/core/layout/svg/LayoutSVGForeignObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSPrimitiveValue.cpp
diff --git a/Source/core/css/CSSPrimitiveValue.cpp b/Source/core/css/CSSPrimitiveValue.cpp
index fd40ac79468f8935f59f8ccc83407c0ffec23529..9299d43012029c77eeef69572dd97b1ff7af3e10 100644
--- a/Source/core/css/CSSPrimitiveValue.cpp
+++ b/Source/core/css/CSSPrimitiveValue.cpp
@@ -152,6 +152,11 @@ StringToUnitTable& unitTable()
} // namespace
+float CSSPrimitiveValue::clampToCSSLengthRange(double value)
+{
+ return clampTo<float>(value, minValueForCssLength, maxValueForCssLength);
+}
+
void CSSPrimitiveValue::initUnitTable()
{
// Make sure we initialize this during blink initialization
@@ -586,7 +591,7 @@ template<> unsigned CSSPrimitiveValue::computeLength(const CSSToLengthConversion
template<> Length CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
{
- return Length(clampTo<float>(computeLengthDouble(conversionData), minValueForCssLength, maxValueForCssLength), Fixed);
+ return Length(clampToCSSLengthRange(computeLengthDouble(conversionData)), Fixed);
}
template<> short CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | Source/core/layout/svg/LayoutSVGForeignObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698