Chromium Code Reviews| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 CSSValueID valueID = primitiveValue.getValueID(); | 130 CSSValueID valueID = primitiveValue.getValueID(); |
| 131 if (valueID == CSSValueThin) | 131 if (valueID == CSSValueThin) |
| 132 return 1; | 132 return 1; |
| 133 if (valueID == CSSValueMedium) | 133 if (valueID == CSSValueMedium) |
| 134 return 3; | 134 return 3; |
| 135 if (valueID == CSSValueThick) | 135 if (valueID == CSSValueThick) |
| 136 return 5; | 136 return 5; |
| 137 if (valueID == CSSValueInvalid) { | 137 if (valueID == CSSValueInvalid) { |
| 138 // Any original result that was >= 1 should not be allowed to fall below 1. | 138 // Any original result that was >= 1 should not be allowed to fall below 1. |
| 139 // This keeps border lines from vanishing. | 139 // This keeps border lines from vanishing. |
| 140 T result = primitiveValue.computeLength<T>(state.cssToLengthConversionDa ta()); | 140 double result = primitiveValue.computeLength<double>(state.cssToLengthCo nversionData()); |
| 141 if (state.style()->effectiveZoom() < 1.0f && result < 1.0) { | 141 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.
| |
| 142 T originalLength = primitiveValue.computeLength<T>(state.cssToLength ConversionData().copyWithAdjustedZoom(1.0)); | 142 T originalLength = primitiveValue.computeLength<T>(state.cssToLength ConversionData().copyWithAdjustedZoom(1.0)); |
| 143 if (originalLength >= 1.0) | 143 if (originalLength >= 1.0) |
| 144 return 1.0; | 144 return 1.0; |
| 145 } | 145 } |
| 146 return result; | 146 if (result > 0.0 && result < 1.0) |
| 147 return 1.0; | |
| 148 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.
| |
| 147 } | 149 } |
| 148 ASSERT_NOT_REACHED(); | 150 ASSERT_NOT_REACHED(); |
| 149 return 0; | 151 return 0; |
| 150 } | 152 } |
| 151 | 153 |
| 152 template <CSSValueID IdForNone> | 154 template <CSSValueID IdForNone> |
| 153 AtomicString StyleBuilderConverter::convertString(StyleResolverState&, const CSS Value& value) | 155 AtomicString StyleBuilderConverter::convertString(StyleResolverState&, const CSS Value& value) |
| 154 { | 156 { |
| 155 if (value.isStringValue()) | 157 if (value.isStringValue()) |
| 156 return AtomicString(toCSSStringValue(value).value()); | 158 return AtomicString(toCSSStringValue(value).value()); |
| 157 ASSERT(toCSSPrimitiveValue(value).getValueID() == IdForNone); | 159 ASSERT(toCSSPrimitiveValue(value).getValueID() == IdForNone); |
| 158 return nullAtom; | 160 return nullAtom; |
| 159 } | 161 } |
| 160 | 162 |
| 161 } // namespace blink | 163 } // namespace blink |
| 162 | 164 |
| 163 #endif | 165 #endif |
| OLD | NEW |