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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |