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 12 matching lines...) Expand all Loading... |
23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR |
25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
27 * SUCH DAMAGE. | 27 * SUCH DAMAGE. |
28 */ | 28 */ |
29 | 29 |
30 #include "config.h" | 30 #include "config.h" |
31 #include "core/css/resolver/ViewportStyleResolver.h" | 31 #include "core/css/resolver/ViewportStyleResolver.h" |
32 | 32 |
33 #if ENABLE(CSS_DEVICE_ADAPTATION) | |
34 | |
35 #include "CSSValueKeywords.h" | 33 #include "CSSValueKeywords.h" |
36 #include "core/css/StylePropertySet.h" | 34 #include "core/css/StylePropertySet.h" |
37 #include "core/css/StyleRule.h" | 35 #include "core/css/StyleRule.h" |
38 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
| 37 #include "core/dom/NodeRenderStyle.h" |
39 #include "core/dom/ViewportArguments.h" | 38 #include "core/dom/ViewportArguments.h" |
40 #include "core/page/Page.h" | 39 #include "core/page/Page.h" |
41 #include "core/rendering/RenderView.h" | 40 #include "core/rendering/RenderView.h" |
42 | 41 |
43 namespace WebCore { | 42 namespace WebCore { |
44 | 43 |
45 ViewportStyleResolver::ViewportStyleResolver(Document* document) | 44 ViewportStyleResolver::ViewportStyleResolver(Document* document) |
46 : m_document(document) | 45 : m_document(document) |
47 { | 46 { |
48 ASSERT(m_document); | 47 ASSERT(m_document); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 case CSSPropertyMaxZoom: | 134 case CSSPropertyMaxZoom: |
136 case CSSPropertyMinZoom: | 135 case CSSPropertyMinZoom: |
137 case CSSPropertyZoom: | 136 case CSSPropertyZoom: |
138 return percentValue; | 137 return percentValue; |
139 default: | 138 default: |
140 ASSERT_NOT_REACHED(); | 139 ASSERT_NOT_REACHED(); |
141 break; | 140 break; |
142 } | 141 } |
143 } | 142 } |
144 | 143 |
145 switch (primitiveValue->getIdent()) { | 144 switch (primitiveValue->getValueID()) { |
146 case CSSValueAuto: | 145 case CSSValueAuto: |
147 return defaultValue; | 146 return defaultValue; |
148 case CSSValueDeviceHeight: | 147 case CSSValueDeviceHeight: |
149 return ViewportArguments::ValueDeviceHeight; | 148 return ViewportArguments::ValueDeviceHeight; |
150 case CSSValueDeviceWidth: | 149 case CSSValueDeviceWidth: |
151 return ViewportArguments::ValueDeviceWidth; | 150 return ViewportArguments::ValueDeviceWidth; |
152 case CSSValueLandscape: | 151 case CSSValueLandscape: |
153 return ViewportArguments::ValueLandscape; | 152 return ViewportArguments::ValueLandscape; |
154 case CSSValuePortrait: | 153 case CSSValuePortrait: |
155 return ViewportArguments::ValuePortrait; | 154 return ViewportArguments::ValuePortrait; |
156 case CSSValueZoom: | 155 case CSSValueZoom: |
157 return defaultValue; | 156 return defaultValue; |
158 case CSSValueFixed: | 157 case CSSValueFixed: |
159 return 0; | 158 return 0; |
160 default: | 159 default: |
161 return defaultValue; | 160 return defaultValue; |
162 } | 161 } |
163 } | 162 } |
164 | 163 |
165 } // namespace WebCore | 164 } // namespace WebCore |
166 | |
167 #endif // ENABLE(CSS_DEVICE_ADAPTATION) | |
OLD | NEW |