OLD | NEW |
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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 if (valueID == CSSValueThin) | 216 if (valueID == CSSValueThin) |
217 return 1; | 217 return 1; |
218 if (valueID == CSSValueMedium) | 218 if (valueID == CSSValueMedium) |
219 return 3; | 219 return 3; |
220 if (valueID == CSSValueThick) | 220 if (valueID == CSSValueThick) |
221 return 5; | 221 return 5; |
222 NOTREACHED(); | 222 NOTREACHED(); |
223 return 0; | 223 return 0; |
224 } | 224 } |
225 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | 225 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); |
226 // FIXME: We are moving to use the full page zoom implementation to handle hig
h-dpi. | 226 // FIXME: We are moving to use the full page zoom implementation to handle |
227 // In that case specyfing a border-width of less than 1px would result in a bo
rder that is one device pixel thick. | 227 // high-dpi. In that case specyfing a border-width of less than 1px would |
228 // With this change that would instead be rounded up to 2 device pixels. | 228 // result in a border that is one device pixel thick. With this change that |
229 // Consider clamping it to device pixels or zoom adjusted CSS pixels instead o
f raw CSS pixels. | 229 // would instead be rounded up to 2 device pixels. Consider clamping it to |
| 230 // device pixels or zoom adjusted CSS pixels instead of raw CSS pixels. |
230 // Reference crbug.com/485650 and crbug.com/382483 | 231 // Reference crbug.com/485650 and crbug.com/382483 |
231 double result = | 232 double result = |
232 primitiveValue.computeLength<double>(state.cssToLengthConversionData()); | 233 primitiveValue.computeLength<double>(state.cssToLengthConversionData()); |
233 if (result > 0.0 && result < 1.0) | 234 if (result > 0.0 && result < 1.0) |
234 return 1.0; | 235 return 1.0; |
235 return clampTo<T>(roundForImpreciseConversion<T>(result), | 236 return clampTo<T>(roundForImpreciseConversion<T>(result), |
236 defaultMinimumForClamp<T>(), defaultMaximumForClamp<T>()); | 237 defaultMinimumForClamp<T>(), defaultMaximumForClamp<T>()); |
237 } | 238 } |
238 | 239 |
239 template <CSSValueID IdForNone> | 240 template <CSSValueID IdForNone> |
240 AtomicString StyleBuilderConverter::convertString(StyleResolverState&, | 241 AtomicString StyleBuilderConverter::convertString(StyleResolverState&, |
241 const CSSValue& value) { | 242 const CSSValue& value) { |
242 if (value.isStringValue()) | 243 if (value.isStringValue()) |
243 return AtomicString(toCSSStringValue(value).value()); | 244 return AtomicString(toCSSStringValue(value).value()); |
244 DCHECK_EQ(toCSSIdentifierValue(value).getValueID(), IdForNone); | 245 DCHECK_EQ(toCSSIdentifierValue(value).getValueID(), IdForNone); |
245 return nullAtom; | 246 return nullAtom; |
246 } | 247 } |
247 | 248 |
248 } // namespace blink | 249 } // namespace blink |
249 | 250 |
250 #endif | 251 #endif |
OLD | NEW |