| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 CSSValueID valueID = primitiveValue->getValueID(); | 88 CSSValueID valueID = primitiveValue->getValueID(); |
| 89 if (valueID == CSSValueThin) | 89 if (valueID == CSSValueThin) |
| 90 return 1; | 90 return 1; |
| 91 if (valueID == CSSValueMedium) | 91 if (valueID == CSSValueMedium) |
| 92 return 3; | 92 return 3; |
| 93 if (valueID == CSSValueThick) | 93 if (valueID == CSSValueThick) |
| 94 return 5; | 94 return 5; |
| 95 if (valueID == CSSValueInvalid) { | 95 if (valueID == CSSValueInvalid) { |
| 96 // Any original result that was >= 1 should not be allowed to fall below
1. | 96 // Any original result that was >= 1 should not be allowed to fall below
1. |
| 97 // This keeps border lines from vanishing. | 97 // This keeps border lines from vanishing. |
| 98 T result = primitiveValue->computeLength<T>(state.cssToLengthConversionD
ata()); | 98 return primitiveValue->computeLength<T>(state.cssToLengthConversionData(
)); |
| 99 if (state.style()->effectiveZoom() < 1.0f && result < 1.0) { | |
| 100 T originalLength = primitiveValue->computeLength<T>(state.cssToLengt
hConversionData().copyWithAdjustedZoom(1.0)); | |
| 101 if (originalLength >= 1.0) | |
| 102 return 1.0; | |
| 103 } | |
| 104 return result; | |
| 105 } | 99 } |
| 106 ASSERT_NOT_REACHED(); | 100 ASSERT_NOT_REACHED(); |
| 107 return 0; | 101 return 0; |
| 108 } | 102 } |
| 109 | 103 |
| 110 template <CSSValueID IdForNone> | 104 template <CSSValueID IdForNone> |
| 111 AtomicString StyleBuilderConverter::convertString(StyleResolverState&, CSSValue*
value) | 105 AtomicString StyleBuilderConverter::convertString(StyleResolverState&, CSSValue*
value) |
| 112 { | 106 { |
| 113 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 107 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 114 if (primitiveValue->getValueID() == IdForNone) | 108 if (primitiveValue->getValueID() == IdForNone) |
| 115 return nullAtom; | 109 return nullAtom; |
| 116 return AtomicString(primitiveValue->getStringValue()); | 110 return AtomicString(primitiveValue->getStringValue()); |
| 117 } | 111 } |
| 118 | 112 |
| 119 } // namespace blink | 113 } // namespace blink |
| 120 | 114 |
| 121 #endif | 115 #endif |
| OLD | NEW |