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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 { | 62 { |
| 63 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 63 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 64 CSSValueID valueID = primitiveValue->getValueID(); | 64 CSSValueID valueID = primitiveValue->getValueID(); |
| 65 if (valueID == CSSValueThin) | 65 if (valueID == CSSValueThin) |
| 66 return 1; | 66 return 1; |
| 67 if (valueID == CSSValueMedium) | 67 if (valueID == CSSValueMedium) |
| 68 return 3; | 68 return 3; |
| 69 if (valueID == CSSValueThick) | 69 if (valueID == CSSValueThick) |
| 70 return 5; | 70 return 5; |
| 71 if (primitiveValue->isViewportPercentageLength()) | 71 if (primitiveValue->isViewportPercentageLength()) |
| 72 return primitiveValue->viewportPercentageLength().value(); | 72 return intValueForLength(primitiveValue->viewportPercentageLength(), 0, state.document().renderView()); |
|
rune
2013/10/10 11:59:45
To reviewer:
I should have converted to float ins
eae
2013/10/10 15:25:01
Ints is right for borders. Good catch.
| |
| 73 if (valueID == CSSValueInvalid) { | 73 if (valueID == CSSValueInvalid) { |
| 74 float zoom = state.style()->effectiveZoom(); | 74 float zoom = state.style()->effectiveZoom(); |
| 75 // Any original result that was >= 1 should not be allowed to fall below 1. | 75 // Any original result that was >= 1 should not be allowed to fall below 1. |
| 76 // This keeps border lines from vanishing. | 76 // This keeps border lines from vanishing. |
| 77 T result = primitiveValue->computeLength<T>(state.style(), state.rootEle mentStyle(), zoom); | 77 T result = primitiveValue->computeLength<T>(state.style(), state.rootEle mentStyle(), zoom); |
| 78 if (zoom < 1.0f && result < 1.0) { | 78 if (zoom < 1.0f && result < 1.0) { |
| 79 T originalLength = primitiveValue->computeLength<T>(state.style(), s tate.rootElementStyle(), 1.0); | 79 T originalLength = primitiveValue->computeLength<T>(state.style(), s tate.rootElementStyle(), 1.0); |
| 80 if (originalLength >= 1.0) | 80 if (originalLength >= 1.0) |
| 81 return 1.0; | 81 return 1.0; |
| 82 } | 82 } |
| 83 return result; | 83 return result; |
| 84 } | 84 } |
| 85 ASSERT_NOT_REACHED(); | 85 ASSERT_NOT_REACHED(); |
| 86 return 0; | 86 return 0; |
| 87 } | 87 } |
| 88 | 88 |
| 89 template <CSSValueID IdForNone> | 89 template <CSSValueID IdForNone> |
| 90 AtomicString StyleBuilderConverter::convertString(StyleResolverState&, CSSValue* value) | 90 AtomicString StyleBuilderConverter::convertString(StyleResolverState&, CSSValue* value) |
| 91 { | 91 { |
| 92 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 92 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 93 if (primitiveValue->getValueID() == IdForNone) | 93 if (primitiveValue->getValueID() == IdForNone) |
| 94 return nullAtom; | 94 return nullAtom; |
| 95 return primitiveValue->getStringValue(); | 95 return primitiveValue->getStringValue(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace WebCore | 98 } // namespace WebCore |
| 99 | 99 |
| 100 #endif | 100 #endif |
| OLD | NEW |