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

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

Issue 1574933002: Changed type of border-width longhands from unsigned to float. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added trivial tests safe to rebaseline to TestExpectations Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * * Redistributions of source code must retain the above copyright 4 * * Redistributions of source code must retain the above copyright
5 * notice, this list of conditions and the following disclaimer. 5 * notice, this list of conditions and the following disclaimer.
6 * * Redistributions in binary form must reproduce the above 6 * * Redistributions in binary form must reproduce the above
7 * copyright notice, this list of conditions and the following disclaimer 7 * copyright notice, this list of conditions and the following disclaimer
8 * in the documentation and/or other materials provided with the 8 * in the documentation and/or other materials provided with the
9 * distribution. 9 * distribution.
10 * * Neither the name of Google Inc. nor the names of its 10 * * Neither the name of Google Inc. nor the names of its
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 return 5; 141 return 5;
142 if (valueID == CSSValueInvalid) { 142 if (valueID == CSSValueInvalid) {
143 // FIXME: We are moving to use the full page zoom implementation to hand le high-dpi. 143 // FIXME: We are moving to use the full page zoom implementation to hand le high-dpi.
144 // In that case specyfing a border-width of less than 1px would result i n a border that is one device pixel thick. 144 // In that case specyfing a border-width of less than 1px would result i n a border that is one device pixel thick.
145 // With this change that would instead be rounded up to 2 device pixels. 145 // With this change that would instead be rounded up to 2 device pixels.
146 // Consider clamping it to device pixels or zoom adjusted CSS pixels ins tead of raw CSS pixels. 146 // Consider clamping it to device pixels or zoom adjusted CSS pixels ins tead of raw CSS pixels.
147 // Reference crbug.com/485650 and crbug.com/382483 147 // Reference crbug.com/485650 and crbug.com/382483
148 double result = primitiveValue.computeLength<double>(state.cssToLengthCo nversionData()); 148 double result = primitiveValue.computeLength<double>(state.cssToLengthCo nversionData());
149 if (result > 0.0 && result < 1.0) 149 if (result > 0.0 && result < 1.0)
150 return 1.0; 150 return 1.0;
151 return clampTo<T>(roundForImpreciseConversion<T>(result), defaultMinimum ForClamp<T>(), defaultMaximumForClamp<T>()); 151 return clampTo<T>(roundForImpreciseConversion<T>(result), 0, defaultMaxi mumForClamp<T>());
152 } 152 }
153 ASSERT_NOT_REACHED(); 153 ASSERT_NOT_REACHED();
154 return 0; 154 return 0;
155 } 155 }
156 156
157 template <CSSValueID IdForNone> 157 template <CSSValueID IdForNone>
158 AtomicString StyleBuilderConverter::convertString(StyleResolverState&, const CSS Value& value) 158 AtomicString StyleBuilderConverter::convertString(StyleResolverState&, const CSS Value& value)
159 { 159 {
160 if (value.isStringValue()) 160 if (value.isStringValue())
161 return AtomicString(toCSSStringValue(value).value()); 161 return AtomicString(toCSSStringValue(value).value());
162 ASSERT(toCSSPrimitiveValue(value).getValueID() == IdForNone); 162 ASSERT(toCSSPrimitiveValue(value).getValueID() == IdForNone);
163 return nullAtom; 163 return nullAtom;
164 } 164 }
165 165
166 } // namespace blink 166 } // namespace blink
167 167
168 #endif 168 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698