Chromium Code Reviews| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 m_propertySet->addParsedProperty(propertySet->propertyAt(i).toCSSPropert y()); | 68 m_propertySet->addParsedProperty(propertySet->propertyAt(i).toCSSPropert y()); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void ViewportStyleResolver::clearDocument() | 71 void ViewportStyleResolver::clearDocument() |
| 72 { | 72 { |
| 73 m_document = 0; | 73 m_document = 0; |
| 74 } | 74 } |
| 75 | 75 |
| 76 void ViewportStyleResolver::resolve() | 76 void ViewportStyleResolver::resolve() |
| 77 { | 77 { |
| 78 if (!m_document || !m_propertySet) | 78 if (!m_document) |
| 79 return; | 79 return; |
| 80 | 80 |
| 81 if (!m_propertySet) { | |
| 82 // FIXME: This is not entirely correct. If the doctype is XHTML MP, or t here is a Meta | |
| 83 // element for setting the viewport, the viewport arguments should fall back to those | |
| 84 // settings when the @viewport rules are all removed. For now, reset to implicit when | |
| 85 // there was an @viewport rule which has now been removed. | |
| 86 if (m_document->viewportArguments().type == ViewportArguments::CSSDevice Adaptation) { | |
|
kenneth.r.christiansen
2013/08/21 08:28:35
Did you test if this is also an issue after my ->@
| |
| 87 m_document->setViewportArguments(ViewportArguments()); | |
| 88 m_document->updateViewportArguments(); | |
| 89 } | |
| 90 return; | |
| 91 } | |
| 92 | |
| 81 ViewportArguments arguments(ViewportArguments::CSSDeviceAdaptation); | 93 ViewportArguments arguments(ViewportArguments::CSSDeviceAdaptation); |
| 82 | 94 |
| 83 arguments.userZoom = getViewportArgumentValue(CSSPropertyUserZoom); | 95 arguments.userZoom = getViewportArgumentValue(CSSPropertyUserZoom); |
| 84 arguments.zoom = getViewportArgumentValue(CSSPropertyZoom); | 96 arguments.zoom = getViewportArgumentValue(CSSPropertyZoom); |
| 85 arguments.minZoom = getViewportArgumentValue(CSSPropertyMinZoom); | 97 arguments.minZoom = getViewportArgumentValue(CSSPropertyMinZoom); |
| 86 arguments.maxZoom = getViewportArgumentValue(CSSPropertyMaxZoom); | 98 arguments.maxZoom = getViewportArgumentValue(CSSPropertyMaxZoom); |
| 87 arguments.minWidth = getViewportArgumentValue(CSSPropertyMinWidth); | 99 arguments.minWidth = getViewportArgumentValue(CSSPropertyMinWidth); |
| 88 arguments.maxWidth = getViewportArgumentValue(CSSPropertyMaxWidth); | 100 arguments.maxWidth = getViewportArgumentValue(CSSPropertyMaxWidth); |
| 89 arguments.minHeight = getViewportArgumentValue(CSSPropertyMinHeight); | 101 arguments.minHeight = getViewportArgumentValue(CSSPropertyMinHeight); |
| 90 arguments.maxHeight = getViewportArgumentValue(CSSPropertyMaxHeight); | 102 arguments.maxHeight = getViewportArgumentValue(CSSPropertyMaxHeight); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 case CSSValueInternalExtendToZoom: | 161 case CSSValueInternalExtendToZoom: |
| 150 return ViewportArguments::ValueExtendToZoom; | 162 return ViewportArguments::ValueExtendToZoom; |
| 151 case CSSValueFixed: | 163 case CSSValueFixed: |
| 152 return 0; | 164 return 0; |
| 153 default: | 165 default: |
| 154 return defaultValue; | 166 return defaultValue; |
| 155 } | 167 } |
| 156 } | 168 } |
| 157 | 169 |
| 158 } // namespace WebCore | 170 } // namespace WebCore |
| OLD | NEW |