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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 2013833002: ComputedStyle.h doesn't need CSSPrimitiveValue.h if adjustForAbsoluteZoom(int, float) isn't inline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/style/ComputedStyle.h
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h
index 8360972465e99b15a1f6a040bfa7889f872fc2e9..2a68ba027a241c617a5c1acde2a6768732f803be 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -27,7 +27,6 @@
#include "core/CSSPropertyNames.h"
#include "core/CoreExport.h"
-#include "core/css/CSSPrimitiveValue.h"
#include "core/style/BorderValue.h"
#include "core/style/CounterDirectives.h"
#include "core/style/DataRef.h"
@@ -1932,25 +1931,14 @@ private:
// FIXME: Reduce/remove the dependency on zoom adjusted int values.
// The float or LayoutUnit versions of layout values should be used.
-inline int adjustForAbsoluteZoom(int value, float zoomFactor)
-{
- if (zoomFactor == 1)
- return value;
- // Needed because computeLengthInt truncates (rather than rounds) when scaling up.
- float fvalue = value;
- if (zoomFactor > 1) {
- if (value < 0)
- fvalue -= 0.5f;
- else
- fvalue += 0.5f;
- }
-
- return roundForImpreciseConversion<int>(fvalue / zoomFactor);
-}
+int adjustForAbsoluteZoom(int value, float zoomFactor);
inline int adjustForAbsoluteZoom(int value, const ComputedStyle* style)
{
- return adjustForAbsoluteZoom(value, style->effectiveZoom());
+ float zoomFactor = style->effectiveZoom();
+ if (zoomFactor == 1)
+ return value;
+ return adjustForAbsoluteZoom(value, zoomFactor);
}
inline float adjustFloatForAbsoluteZoom(float value, const ComputedStyle& style)
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698