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

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

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 | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index 09e6023e619cc06e2061952426da8199b9a32c10..aedf11027a24dc5cfa9a9215552689f78ead0496 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -25,6 +25,7 @@
#include "core/animation/css/CSSAnimationData.h"
#include "core/animation/css/CSSTransitionData.h"
#include "core/css/CSSPaintValue.h"
+#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSPropertyEquality.h"
#include "core/css/resolver/StyleResolver.h"
#include "core/layout/LayoutTheme.h"
@@ -1862,4 +1863,20 @@ bool ComputedStyle::shadowListHasCurrentColor(const ShadowList* shadowList)
return false;
}
+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);
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698