Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Side by Side Diff: Source/core/css/resolver/ViewportStyleResolver.cpp

Issue 1303173007: Oilpan: Unship Oilpan from CSSValues Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/resolver/ElementStyleResources.h ('k') | Source/core/editing/EditingStyle.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 float ViewportStyleResolver::viewportArgumentValue(CSSPropertyID id) const 130 float ViewportStyleResolver::viewportArgumentValue(CSSPropertyID id) const
131 { 131 {
132 float defaultValue = ViewportDescription::ValueAuto; 132 float defaultValue = ViewportDescription::ValueAuto;
133 133
134 // UserZoom default value is CSSValueZoom, which maps to true, meaning that 134 // UserZoom default value is CSSValueZoom, which maps to true, meaning that
135 // yes, it is user scalable. When the value is set to CSSValueFixed, we 135 // yes, it is user scalable. When the value is set to CSSValueFixed, we
136 // return false. 136 // return false.
137 if (id == CSSPropertyUserZoom) 137 if (id == CSSPropertyUserZoom)
138 defaultValue = 1; 138 defaultValue = 1;
139 139
140 RefPtrWillBeRawPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(id); 140 RefPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(id);
141 if (!value || !value->isPrimitiveValue()) 141 if (!value || !value->isPrimitiveValue())
142 return defaultValue; 142 return defaultValue;
143 143
144 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get()); 144 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get());
145 145
146 if (primitiveValue->isNumber() || primitiveValue->isPx()) 146 if (primitiveValue->isNumber() || primitiveValue->isPx())
147 return primitiveValue->getFloatValue(); 147 return primitiveValue->getFloatValue();
148 148
149 if (primitiveValue->isFontRelativeLength()) 149 if (primitiveValue->isFontRelativeLength())
150 return primitiveValue->getFloatValue() * m_document->computedStyle()->fo ntDescription().computedSize(); 150 return primitiveValue->getFloatValue() * m_document->computedStyle()->fo ntDescription().computedSize();
(...skipping 29 matching lines...) Expand all
180 } 180 }
181 } 181 }
182 182
183 Length ViewportStyleResolver::viewportLengthValue(CSSPropertyID id) const 183 Length ViewportStyleResolver::viewportLengthValue(CSSPropertyID id) const
184 { 184 {
185 ASSERT(id == CSSPropertyMaxHeight 185 ASSERT(id == CSSPropertyMaxHeight
186 || id == CSSPropertyMinHeight 186 || id == CSSPropertyMinHeight
187 || id == CSSPropertyMaxWidth 187 || id == CSSPropertyMaxWidth
188 || id == CSSPropertyMinWidth); 188 || id == CSSPropertyMinWidth);
189 189
190 RefPtrWillBeRawPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(id); 190 RefPtr<CSSValue> value = m_propertySet->getPropertyCSSValue(id);
191 if (!value || !value->isPrimitiveValue()) 191 if (!value || !value->isPrimitiveValue())
192 return Length(); // auto 192 return Length(); // auto
193 193
194 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get()); 194 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get());
195 195
196 if (primitiveValue->getValueID() == CSSValueInternalExtendToZoom) 196 if (primitiveValue->getValueID() == CSSValueInternalExtendToZoom)
197 return Length(ExtendToZoom); 197 return Length(ExtendToZoom);
198 198
199 ComputedStyle* documentStyle = m_document->mutableComputedStyle(); 199 ComputedStyle* documentStyle = m_document->mutableComputedStyle();
200 200
(...skipping 19 matching lines...) Expand all
220 return result; 220 return result;
221 } 221 }
222 222
223 DEFINE_TRACE(ViewportStyleResolver) 223 DEFINE_TRACE(ViewportStyleResolver)
224 { 224 {
225 visitor->trace(m_propertySet); 225 visitor->trace(m_propertySet);
226 visitor->trace(m_document); 226 visitor->trace(m_document);
227 } 227 }
228 228
229 } // namespace blink 229 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/ElementStyleResources.h ('k') | Source/core/editing/EditingStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698