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

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

Issue 252743004: A thread safe CSS calc parser for sizes (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed CSSCalc tests that assert Created 6 years, 8 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/MediaValues.h ('k') | Source/core/css/MediaValuesCached.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/MediaValues.cpp
diff --git a/Source/core/css/MediaValues.cpp b/Source/core/css/MediaValues.cpp
index 1dd27f4d7a54f4ef37013d1536533e9b95694bf5..5ae52fcc6400fbc02adce688168532e0f54cf749 100644
--- a/Source/core/css/MediaValues.cpp
+++ b/Source/core/css/MediaValues.cpp
@@ -138,7 +138,7 @@ MediaValues::PointerDeviceType MediaValues::calculateLeastCapablePrimaryPointerD
return MediaValues::UnknownPointer;
}
-bool MediaValues::computeLength(double value, CSSPrimitiveValue::UnitTypes type, unsigned defaultFontSize, unsigned viewportWidth, unsigned viewportHeight, int& result)
+bool MediaValues::computeLengthImpl(double value, CSSPrimitiveValue::UnitTypes type, unsigned defaultFontSize, unsigned viewportWidth, unsigned viewportHeight, double& result)
{
// The logic in this function is duplicated from CSSPrimitiveValue::computeLengthDouble
// because MediaValues::computeLength needs nearly identical logic, but we haven't found a way to make
@@ -196,9 +196,10 @@ bool MediaValues::computeLength(double value, CSSPrimitiveValue::UnitTypes type,
return false;
}
- ASSERT(factor > 0);
- result = roundForImpreciseConversion<int>(value*factor);
+ result = value * factor;
return true;
+
+ ASSERT(factor > 0);
}
} // namespace
« no previous file with comments | « Source/core/css/MediaValues.h ('k') | Source/core/css/MediaValuesCached.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698