| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 293 |
| 294 void CSSPrimitiveValue::init(PassRefPtrWillBeRawPtr<CSSCalcValue> c) | 294 void CSSPrimitiveValue::init(PassRefPtrWillBeRawPtr<CSSCalcValue> c) |
| 295 { | 295 { |
| 296 init(UnitType::Calc); | 296 init(UnitType::Calc); |
| 297 m_hasCachedCSSText = false; | 297 m_hasCachedCSSText = false; |
| 298 m_value.calc = c.leakRef(); | 298 m_value.calc = c.leakRef(); |
| 299 } | 299 } |
| 300 | 300 |
| 301 CSSPrimitiveValue::~CSSPrimitiveValue() | 301 CSSPrimitiveValue::~CSSPrimitiveValue() |
| 302 { | 302 { |
| 303 cleanup(); | 303 #if !ENABLE(OILPAN) |
| 304 } | |
| 305 | |
| 306 void CSSPrimitiveValue::cleanup() | |
| 307 { | |
| 308 switch (type()) { | 304 switch (type()) { |
| 309 case UnitType::Calc: | 305 case UnitType::Calc: |
| 310 // We must not call deref() when oilpan is enabled because m_value.calc
is traced. | 306 // We must not call deref() when oilpan is enabled because m_value.calc
is traced. |
| 311 #if !ENABLE(OILPAN) | |
| 312 m_value.calc->deref(); | 307 m_value.calc->deref(); |
| 313 #endif | |
| 314 break; | 308 break; |
| 315 case UnitType::CalcPercentageWithNumber: | 309 case UnitType::CalcPercentageWithNumber: |
| 316 case UnitType::CalcPercentageWithLength: | 310 case UnitType::CalcPercentageWithLength: |
| 317 ASSERT_NOT_REACHED(); | 311 ASSERT_NOT_REACHED(); |
| 318 break; | 312 break; |
| 319 case UnitType::Number: | 313 case UnitType::Number: |
| 320 case UnitType::Integer: | 314 case UnitType::Integer: |
| 321 case UnitType::Percentage: | 315 case UnitType::Percentage: |
| 322 case UnitType::Ems: | 316 case UnitType::Ems: |
| 323 case UnitType::QuirkyEms: | 317 case UnitType::QuirkyEms: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 348 case UnitType::DotsPerCentimeter: | 342 case UnitType::DotsPerCentimeter: |
| 349 case UnitType::Fraction: | 343 case UnitType::Fraction: |
| 350 case UnitType::Unknown: | 344 case UnitType::Unknown: |
| 351 case UnitType::ValueID: | 345 case UnitType::ValueID: |
| 352 break; | 346 break; |
| 353 } | 347 } |
| 354 if (m_hasCachedCSSText) { | 348 if (m_hasCachedCSSText) { |
| 355 cssTextCache().remove(this); | 349 cssTextCache().remove(this); |
| 356 m_hasCachedCSSText = false; | 350 m_hasCachedCSSText = false; |
| 357 } | 351 } |
| 352 #endif |
| 358 } | 353 } |
| 359 | 354 |
| 360 double CSSPrimitiveValue::computeSeconds() const | 355 double CSSPrimitiveValue::computeSeconds() const |
| 361 { | 356 { |
| 362 ASSERT(isTime() || (isCalculated() && cssCalcValue()->category() == CalcTime
)); | 357 ASSERT(isTime() || (isCalculated() && cssCalcValue()->category() == CalcTime
)); |
| 363 UnitType currentType = isCalculated() ? cssCalcValue()->expressionNode()->ty
peWithCalcResolved() : type(); | 358 UnitType currentType = isCalculated() ? cssCalcValue()->expressionNode()->ty
peWithCalcResolved() : type(); |
| 364 if (currentType == UnitType::Seconds) | 359 if (currentType == UnitType::Seconds) |
| 365 return getDoubleValue(); | 360 return getDoubleValue(); |
| 366 if (currentType == UnitType::Milliseconds) | 361 if (currentType == UnitType::Milliseconds) |
| 367 return getDoubleValue() / 1000; | 362 return getDoubleValue() / 1000; |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 visitor->trace(m_value.calc); | 838 visitor->trace(m_value.calc); |
| 844 break; | 839 break; |
| 845 default: | 840 default: |
| 846 break; | 841 break; |
| 847 } | 842 } |
| 848 #endif | 843 #endif |
| 849 CSSValue::traceAfterDispatch(visitor); | 844 CSSValue::traceAfterDispatch(visitor); |
| 850 } | 845 } |
| 851 | 846 |
| 852 } // namespace blink | 847 } // namespace blink |
| OLD | NEW |