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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 return primitiveValue->getFloatValue(); | 116 return primitiveValue->getFloatValue(); |
117 | 117 |
118 if (primitiveValue->isFontRelativeLength()) | 118 if (primitiveValue->isFontRelativeLength()) |
119 return primitiveValue->getFloatValue() * m_document->renderStyle()->font
Description().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); | |
127 return percentValue * m_document->initialViewportSize().height(); | 126 return percentValue * m_document->initialViewportSize().height(); |
128 case CSSPropertyMaxWidth: | 127 case CSSPropertyMaxWidth: |
129 case CSSPropertyMinWidth: | 128 case CSSPropertyMinWidth: |
130 ASSERT(m_document->initialViewportSize().width() > 0); | |
131 return percentValue * m_document->initialViewportSize().width(); | 129 return percentValue * m_document->initialViewportSize().width(); |
132 case CSSPropertyMaxZoom: | 130 case CSSPropertyMaxZoom: |
133 case CSSPropertyMinZoom: | 131 case CSSPropertyMinZoom: |
134 case CSSPropertyZoom: | 132 case CSSPropertyZoom: |
135 return percentValue; | 133 return percentValue; |
136 default: | 134 default: |
137 ASSERT_NOT_REACHED(); | 135 ASSERT_NOT_REACHED(); |
138 break; | 136 break; |
139 } | 137 } |
140 } | 138 } |
141 | 139 |
142 switch (primitiveValue->getValueID()) { | 140 switch (primitiveValue->getValueID()) { |
143 case CSSValueAuto: | 141 case CSSValueAuto: |
144 return defaultValue; | 142 return defaultValue; |
145 case CSSValueLandscape: | 143 case CSSValueLandscape: |
146 return ViewportArguments::ValueLandscape; | 144 return ViewportArguments::ValueLandscape; |
147 case CSSValuePortrait: | 145 case CSSValuePortrait: |
148 return ViewportArguments::ValuePortrait; | 146 return ViewportArguments::ValuePortrait; |
149 case CSSValueZoom: | 147 case CSSValueZoom: |
150 return defaultValue; | 148 return defaultValue; |
151 case CSSValueFixed: | 149 case CSSValueFixed: |
152 return 0; | 150 return 0; |
153 default: | 151 default: |
154 return defaultValue; | 152 return defaultValue; |
155 } | 153 } |
156 } | 154 } |
157 | 155 |
158 } // namespace WebCore | 156 } // namespace WebCore |
OLD | NEW |