| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 2 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
| 9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
| 10 * disclaimer. | 10 * disclaimer. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 RefPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(id); | 109 RefPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(id); |
| 110 if (!value || !value->isPrimitiveValue()) | 110 if (!value || !value->isPrimitiveValue()) |
| 111 return defaultValue; | 111 return defaultValue; |
| 112 | 112 |
| 113 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get()); | 113 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get()); |
| 114 | 114 |
| 115 if (primitiveValue->isNumber() || primitiveValue->isPx()) | 115 if (primitiveValue->isNumber() || primitiveValue->isPx()) |
| 116 return primitiveValue->getFloatValue(); | 116 return primitiveValue->getFloatValue(); |
| 117 | 117 |
| 118 if (primitiveValue->isFontRelativeLength()) | 118 if (primitiveValue->isFontRelativeLength()) |
| 119 return primitiveValue->getFloatValue() * m_document->documentElement()->
renderStyle()->fontDescription().computedSize(); | 119 return primitiveValue->getFloatValue() * m_document->renderStyle()->font
Description().computedSize(); |
| 120 | 120 |
| 121 if (primitiveValue->isPercentage()) { | 121 if (primitiveValue->isPercentage()) { |
| 122 float percentValue = primitiveValue->getFloatValue() / 100.0f; | 122 float percentValue = primitiveValue->getFloatValue() / 100.0f; |
| 123 switch (id) { | 123 switch (id) { |
| 124 case CSSPropertyMaxHeight: | 124 case CSSPropertyMaxHeight: |
| 125 case CSSPropertyMinHeight: | 125 case CSSPropertyMinHeight: |
| 126 ASSERT(m_document->initialViewportSize().height() > 0); | 126 ASSERT(m_document->initialViewportSize().height() > 0); |
| 127 return percentValue * m_document->initialViewportSize().height(); | 127 return percentValue * m_document->initialViewportSize().height(); |
| 128 case CSSPropertyMaxWidth: | 128 case CSSPropertyMaxWidth: |
| 129 case CSSPropertyMinWidth: | 129 case CSSPropertyMinWidth: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 149 case CSSValueZoom: | 149 case CSSValueZoom: |
| 150 return defaultValue; | 150 return defaultValue; |
| 151 case CSSValueFixed: | 151 case CSSValueFixed: |
| 152 return 0; | 152 return 0; |
| 153 default: | 153 default: |
| 154 return defaultValue; | 154 return defaultValue; |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace WebCore | 158 } // namespace WebCore |
| OLD | NEW |