| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
| 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r
ights reserved. |
| 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
| 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
| 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
| 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 24 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 25 * Boston, MA 02110-1301, USA. | 25 * Boston, MA 02110-1301, USA. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #include "config.h" | 28 #include "config.h" |
| 29 #include "core/css/resolver/CSSToStyleMap.h" | 29 #include "core/css/resolver/CSSToStyleMap.h" |
| 30 | 30 |
| 31 #include "core/CSSValueKeywords.h" | 31 #include "core/CSSValueKeywords.h" |
| 32 #include "core/animation/css/CSSAnimationData.h" | 32 #include "core/animation/css/CSSAnimationData.h" |
| 33 #include "core/css/CSSBorderImageSliceValue.h" | 33 #include "core/css/CSSBorderImageSliceValue.h" |
| 34 #include "core/css/CSSCustomIdentValue.h" |
| 34 #include "core/css/CSSPrimitiveValue.h" | 35 #include "core/css/CSSPrimitiveValue.h" |
| 35 #include "core/css/CSSPrimitiveValueMappings.h" | 36 #include "core/css/CSSPrimitiveValueMappings.h" |
| 36 #include "core/css/CSSQuadValue.h" | 37 #include "core/css/CSSQuadValue.h" |
| 37 #include "core/css/CSSTimingFunctionValue.h" | 38 #include "core/css/CSSTimingFunctionValue.h" |
| 38 #include "core/css/CSSValuePair.h" | 39 #include "core/css/CSSValuePair.h" |
| 39 #include "core/css/resolver/StyleBuilderConverter.h" | 40 #include "core/css/resolver/StyleBuilderConverter.h" |
| 40 #include "core/css/resolver/StyleResolverState.h" | 41 #include "core/css/resolver/StyleResolverState.h" |
| 41 #include "core/style/BorderImageLengthBox.h" | 42 #include "core/style/BorderImageLengthBox.h" |
| 42 #include "core/style/FillLayer.h" | 43 #include "core/style/FillLayer.h" |
| 43 | 44 |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | 340 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); |
| 340 if (primitiveValue.getValueID() == CSSValueInfinite) | 341 if (primitiveValue.getValueID() == CSSValueInfinite) |
| 341 return std::numeric_limits<double>::infinity(); | 342 return std::numeric_limits<double>::infinity(); |
| 342 return primitiveValue.getFloatValue(); | 343 return primitiveValue.getFloatValue(); |
| 343 } | 344 } |
| 344 | 345 |
| 345 AtomicString CSSToStyleMap::mapAnimationName(const CSSValue& value) | 346 AtomicString CSSToStyleMap::mapAnimationName(const CSSValue& value) |
| 346 { | 347 { |
| 347 if (value.isInitialValue()) | 348 if (value.isInitialValue()) |
| 348 return CSSAnimationData::initialName(); | 349 return CSSAnimationData::initialName(); |
| 349 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | 350 if (value.isCustomIdentValue()) |
| 350 if (primitiveValue.getValueID() == CSSValueNone) | 351 return AtomicString(toCSSCustomIdentValue(value).value()); |
| 351 return CSSAnimationData::initialName(); | 352 ASSERT(toCSSPrimitiveValue(value).getValueID() == CSSValueNone); |
| 352 return AtomicString(primitiveValue.getStringValue()); | 353 return CSSAnimationData::initialName(); |
| 353 } | 354 } |
| 354 | 355 |
| 355 EAnimPlayState CSSToStyleMap::mapAnimationPlayState(const CSSValue& value) | 356 EAnimPlayState CSSToStyleMap::mapAnimationPlayState(const CSSValue& value) |
| 356 { | 357 { |
| 357 if (value.isInitialValue()) | 358 if (value.isInitialValue()) |
| 358 return CSSAnimationData::initialPlayState(); | 359 return CSSAnimationData::initialPlayState(); |
| 359 if (toCSSPrimitiveValue(value).getValueID() == CSSValuePaused) | 360 if (toCSSPrimitiveValue(value).getValueID() == CSSValuePaused) |
| 360 return AnimPlayStatePaused; | 361 return AnimPlayStatePaused; |
| 361 ASSERT(toCSSPrimitiveValue(value).getValueID() == CSSValueRunning); | 362 ASSERT(toCSSPrimitiveValue(value).getValueID() == CSSValueRunning); |
| 362 return AnimPlayStatePlaying; | 363 return AnimPlayStatePlaying; |
| 363 } | 364 } |
| 364 | 365 |
| 365 CSSTransitionData::TransitionProperty CSSToStyleMap::mapAnimationProperty(const
CSSValue& value) | 366 CSSTransitionData::TransitionProperty CSSToStyleMap::mapAnimationProperty(const
CSSValue& value) |
| 366 { | 367 { |
| 367 if (value.isInitialValue()) | 368 if (value.isInitialValue()) |
| 368 return CSSTransitionData::initialProperty(); | 369 return CSSTransitionData::initialProperty(); |
| 370 if (value.isCustomIdentValue()) |
| 371 return CSSTransitionData::TransitionProperty(toCSSCustomIdentValue(value
).value()); |
| 369 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | 372 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); |
| 370 if (primitiveValue.isCustomIdent()) | |
| 371 return CSSTransitionData::TransitionProperty(primitiveValue.getStringVal
ue()); | |
| 372 if (primitiveValue.getValueID() == CSSValueNone) | 373 if (primitiveValue.getValueID() == CSSValueNone) |
| 373 return CSSTransitionData::TransitionProperty(CSSTransitionData::Transiti
onNone); | 374 return CSSTransitionData::TransitionProperty(CSSTransitionData::Transiti
onNone); |
| 374 return CSSTransitionData::TransitionProperty(primitiveValue.getPropertyID())
; | 375 return CSSTransitionData::TransitionProperty(primitiveValue.getPropertyID())
; |
| 375 } | 376 } |
| 376 | 377 |
| 377 PassRefPtr<TimingFunction> CSSToStyleMap::mapAnimationTimingFunction(const CSSVa
lue& value, bool allowStepMiddle) | 378 PassRefPtr<TimingFunction> CSSToStyleMap::mapAnimationTimingFunction(const CSSVa
lue& value, bool allowStepMiddle) |
| 378 { | 379 { |
| 379 // FIXME: We should probably only call into this function with a valid | 380 // FIXME: We should probably only call into this function with a valid |
| 380 // single timing function value which isn't initial or inherit. We can | 381 // single timing function value which isn't initial or inherit. We can |
| 381 // currently get into here with initial since the parser expands unset | 382 // currently get into here with initial since the parser expands unset |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 verticalRule = SpaceImageRule; | 580 verticalRule = SpaceImageRule; |
| 580 break; | 581 break; |
| 581 default: // CSSValueRepeat | 582 default: // CSSValueRepeat |
| 582 verticalRule = RepeatImageRule; | 583 verticalRule = RepeatImageRule; |
| 583 break; | 584 break; |
| 584 } | 585 } |
| 585 image.setVerticalRule(verticalRule); | 586 image.setVerticalRule(verticalRule); |
| 586 } | 587 } |
| 587 | 588 |
| 588 }; | 589 }; |
| OLD | NEW |