OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012-2013 Intel Corporation. All rights reserved. | 2 * Copyright (C) 2012-2013 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 RenderStyle* documentStyle = m_document->renderStyle(); | 182 RenderStyle* documentStyle = m_document->renderStyle(); |
183 | 183 |
184 // If we have viewport units the conversion will mark the document style as
having viewport units. | 184 // If we have viewport units the conversion will mark the document style as
having viewport units. |
185 bool documentStyleHasViewportUnits = documentStyle->hasViewportUnits(); | 185 bool documentStyleHasViewportUnits = documentStyle->hasViewportUnits(); |
186 documentStyle->setHasViewportUnits(false); | 186 documentStyle->setHasViewportUnits(false); |
187 | 187 |
188 FrameView* view = m_document->view(); | 188 FrameView* view = m_document->view(); |
189 float width = view ? view->width() : 0; | 189 float width = view ? view->width() : 0; |
190 float height = view ? view->height() : 0; | 190 float height = view ? view->height() : 0; |
191 | 191 |
192 Length result = primitiveValue->convertToLength<AnyConversion>(CSSToLengthCo
nversionData(documentStyle, documentStyle, width, height, 1.0f)); | 192 CSSToLengthConversionData::FontSizes fontSizes(documentStyle, documentStyle)
; |
| 193 CSSToLengthConversionData::ViewportSize viewportSize(width, height); |
| 194 Length result = primitiveValue->convertToLength<AnyConversion>(CSSToLengthCo
nversionData(documentStyle, fontSizes, viewportSize, 1.0f)); |
193 if (documentStyle->hasViewportUnits()) | 195 if (documentStyle->hasViewportUnits()) |
194 m_document->setHasViewportUnits(); | 196 m_document->setHasViewportUnits(); |
195 documentStyle->setHasViewportUnits(documentStyleHasViewportUnits); | 197 documentStyle->setHasViewportUnits(documentStyleHasViewportUnits); |
196 | 198 |
197 return result; | 199 return result; |
198 } | 200 } |
199 | 201 |
200 void ViewportStyleResolver::trace(Visitor* visitor) | 202 void ViewportStyleResolver::trace(Visitor* visitor) |
201 { | 203 { |
202 visitor->trace(m_propertySet); | 204 visitor->trace(m_propertySet); |
203 visitor->trace(m_document); | 205 visitor->trace(m_document); |
204 } | 206 } |
205 | 207 |
206 } // namespace blink | 208 } // namespace blink |
OLD | NEW |