OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv
ed. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 196 |
197 static AtomicString* keywordStrings = new AtomicString[numCSSValueKeywords];
// Leaked intentionally. | 197 static AtomicString* keywordStrings = new AtomicString[numCSSValueKeywords];
// Leaked intentionally. |
198 AtomicString& keywordString = keywordStrings[valueID]; | 198 AtomicString& keywordString = keywordStrings[valueID]; |
199 if (keywordString.isNull()) | 199 if (keywordString.isNull()) |
200 keywordString = getValueName(valueID); | 200 keywordString = getValueName(valueID); |
201 return keywordString; | 201 return keywordString; |
202 } | 202 } |
203 | 203 |
204 CSSPrimitiveValue::CSSPrimitiveValue(CSSValueID valueID) | 204 CSSPrimitiveValue::CSSPrimitiveValue(CSSValueID valueID) |
205 : CSSValue(PrimitiveClass) | 205 : CSSValue(PrimitiveClass) |
| 206 , m_primitiveUnitType(0) |
| 207 , m_hasCachedCSSText(false) |
206 { | 208 { |
207 init(UnitType::ValueID); | 209 init(UnitType::ValueID); |
208 // TODO(sashab): Add a DCHECK_NE(valueID, CSSValueInvalid). | 210 // TODO(sashab): Add a DCHECK_NE(valueID, CSSValueInvalid). |
209 m_value.valueID = valueID; | 211 m_value.valueID = valueID; |
210 } | 212 } |
211 | 213 |
212 CSSPrimitiveValue::CSSPrimitiveValue(double num, UnitType type) | 214 CSSPrimitiveValue::CSSPrimitiveValue(double num, UnitType type) |
213 : CSSValue(PrimitiveClass) | 215 : CSSValue(PrimitiveClass) |
| 216 , m_primitiveUnitType(0) |
| 217 , m_hasCachedCSSText(false) |
214 { | 218 { |
215 init(type); | 219 init(type); |
216 ASSERT(std::isfinite(num)); | 220 ASSERT(std::isfinite(num)); |
217 m_value.num = num; | 221 m_value.num = num; |
218 } | 222 } |
219 | 223 |
220 CSSPrimitiveValue::CSSPrimitiveValue(const Length& length, float zoom) | 224 CSSPrimitiveValue::CSSPrimitiveValue(const Length& length, float zoom) |
221 : CSSValue(PrimitiveClass) | 225 : CSSValue(PrimitiveClass) |
| 226 , m_primitiveUnitType(0) |
| 227 , m_hasCachedCSSText(false) |
222 { | 228 { |
223 switch (length.type()) { | 229 switch (length.type()) { |
224 case Auto: | 230 case Auto: |
225 init(UnitType::ValueID); | 231 init(UnitType::ValueID); |
226 m_value.valueID = CSSValueAuto; | 232 m_value.valueID = CSSValueAuto; |
227 break; | 233 break; |
228 case MinContent: | 234 case MinContent: |
229 init(UnitType::ValueID); | 235 init(UnitType::ValueID); |
230 m_value.valueID = CSSValueMinContent; | 236 m_value.valueID = CSSValueMinContent; |
231 break; | 237 break; |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 case UnitType::Calc: | 773 case UnitType::Calc: |
768 visitor->trace(m_value.calc); | 774 visitor->trace(m_value.calc); |
769 break; | 775 break; |
770 default: | 776 default: |
771 break; | 777 break; |
772 } | 778 } |
773 CSSValue::traceAfterDispatch(visitor); | 779 CSSValue::traceAfterDispatch(visitor); |
774 } | 780 } |
775 | 781 |
776 } // namespace blink | 782 } // namespace blink |
OLD | NEW |