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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h

Issue 1412103005: Make sure line widths in the range of 0px and 1px are rounded up to 1px for visibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
Index: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h
index e404ef65c614cd2cb476a38b9f45699938cc5675..0f7707acfb889cdd7bd2c5a175950a2aaff5ff34 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.h
@@ -137,13 +137,15 @@ T StyleBuilderConverter::convertLineWidth(StyleResolverState& state, const CSSVa
if (valueID == CSSValueInvalid) {
// 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.cssToLengthConversionData());
+ double result = primitiveValue.computeLength<double>(state.cssToLengthConversionData());
if (state.style()->effectiveZoom() < 1.0f && result < 1.0) {
alancutter (OOO until 2018) 2015/10/27 04:10:32 Is this code path redundant now?
nainar 2015/10/27 05:30:18 Done.
T originalLength = primitiveValue.computeLength<T>(state.cssToLengthConversionData().copyWithAdjustedZoom(1.0));
if (originalLength >= 1.0)
return 1.0;
}
- return result;
+ if (result > 0.0 && result < 1.0)
+ return 1.0;
+ return primitiveValue.computeLength<T>(state.cssToLengthConversionData());
alancutter (OOO until 2018) 2015/10/27 04:10:32 Can we just call clampTo<T>() instead of calling c
nainar 2015/10/27 05:30:18 Done.
}
ASSERT_NOT_REACHED();
return 0;

Powered by Google App Engine
This is Rietveld 408576698