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

Unified Diff: Source/core/css/resolver/StyleBuilderCustom.h

Issue 64293008: Wrap CSS length conversion arguments in an object (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: erm.. use DEFINE_STATIC_REF Created 7 years, 1 month 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
Index: Source/core/css/resolver/StyleBuilderCustom.h
diff --git a/Source/core/css/resolver/StyleBuilderCustom.h b/Source/core/css/resolver/StyleBuilderCustom.h
index 006f1c817d7cc420f20e971ac520dc8653e63e07..3887623dd7b7bf9ce13fa958004f8c8885b59b20 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.h
+++ b/Source/core/css/resolver/StyleBuilderCustom.h
@@ -59,8 +59,7 @@ public:
template <typename T>
T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, CSSValue* value)
{
- float zoom = state.style()->effectiveZoom();
- return toCSSPrimitiveValue(value)->computeLength<T>(state.style(), state.rootElementStyle(), zoom);
+ return toCSSPrimitiveValue(value)->computeLength<T>(state.cssToLengthConversionData());
}
template <typename T>
@@ -77,12 +76,11 @@ T StyleBuilderConverter::convertLineWidth(StyleResolverState& state, CSSValue* v
if (primitiveValue->isViewportPercentageLength())
return intValueForLength(primitiveValue->viewportPercentageLength(), 0, state.document().renderView());
if (valueID == CSSValueInvalid) {
- float zoom = state.style()->effectiveZoom();
// Any original result that was >= 1 should not be allowed to fall below 1.
// This keeps border lines from vanishing.
- T result = primitiveValue->computeLength<T>(state.style(), state.rootElementStyle(), zoom);
- if (zoom < 1.0f && result < 1.0) {
- T originalLength = primitiveValue->computeLength<T>(state.style(), state.rootElementStyle(), 1.0);
+ T result = primitiveValue->computeLength<T>(state.cssToLengthConversionData());
+ if (state.style()->effectiveZoom() < 1.0f && result < 1.0) {
+ T originalLength = primitiveValue->computeLength<T>(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0));
if (originalLength >= 1.0)
return 1.0;
}

Powered by Google App Engine
This is Rietveld 408576698