Chromium Code Reviews| 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, 2013 Apple Inc. All rights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights 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 19 matching lines...) Expand all Loading... | |
| 30 #include "core/css/resolver/StyleResolver.h" | 30 #include "core/css/resolver/StyleResolver.h" |
| 31 | 31 |
| 32 // FIXME: This include list is way more than we need! | 32 // FIXME: This include list is way more than we need! |
| 33 #include "CSSPropertyNames.h" | 33 #include "CSSPropertyNames.h" |
| 34 #include "HTMLNames.h" | 34 #include "HTMLNames.h" |
| 35 #include "RuntimeEnabledFeatures.h" | 35 #include "RuntimeEnabledFeatures.h" |
| 36 #include "SVGNames.h" | 36 #include "SVGNames.h" |
| 37 #include "XMLNames.h" | 37 #include "XMLNames.h" |
| 38 #include "core/animation/AnimatableValue.h" | 38 #include "core/animation/AnimatableValue.h" |
| 39 #include "core/animation/Animation.h" | 39 #include "core/animation/Animation.h" |
| 40 #include "core/animation/DocumentTimeline.h" | |
| 40 #include "core/css/CSSCalculationValue.h" | 41 #include "core/css/CSSCalculationValue.h" |
| 41 #include "core/css/CSSCursorImageValue.h" | 42 #include "core/css/CSSCursorImageValue.h" |
| 42 #include "core/css/CSSDefaultStyleSheets.h" | 43 #include "core/css/CSSDefaultStyleSheets.h" |
| 43 #include "core/css/CSSFontSelector.h" | 44 #include "core/css/CSSFontSelector.h" |
| 44 #include "core/css/CSSImageSetValue.h" | 45 #include "core/css/CSSImageSetValue.h" |
| 45 #include "core/css/CSSKeyframeRule.h" | 46 #include "core/css/CSSKeyframeRule.h" |
| 46 #include "core/css/CSSKeyframesRule.h" | 47 #include "core/css/CSSKeyframesRule.h" |
| 47 #include "core/css/CSSLineBoxContainValue.h" | 48 #include "core/css/CSSLineBoxContainValue.h" |
| 48 #include "core/css/CSSParser.h" | 49 #include "core/css/CSSParser.h" |
| 49 #include "core/css/CSSPrimitiveValueMappings.h" | 50 #include "core/css/CSSPrimitiveValueMappings.h" |
| (...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1047 } | 1048 } |
| 1048 | 1049 |
| 1049 // ----------------------------------------------------------------------------- -------- | 1050 // ----------------------------------------------------------------------------- -------- |
| 1050 // this is mostly boring stuff on how to apply a certain rule to the renderstyle ... | 1051 // this is mostly boring stuff on how to apply a certain rule to the renderstyle ... |
| 1051 | 1052 |
| 1052 template <StyleResolver::StyleApplicationPass pass> | 1053 template <StyleResolver::StyleApplicationPass pass> |
| 1053 void StyleResolver::applyAnimatedProperties(const Element* target) | 1054 void StyleResolver::applyAnimatedProperties(const Element* target) |
| 1054 { | 1055 { |
| 1055 ASSERT(pass != VariableDefinitions); | 1056 ASSERT(pass != VariableDefinitions); |
| 1056 ASSERT(pass != AnimationProperties); | 1057 ASSERT(pass != AnimationProperties); |
| 1057 if (!target->hasActiveAnimations()) | 1058 AnimationStack animationStack = target->document()->timeline()->animationSta ck(); |
| 1059 if (!animationStack.hasActiveAnimations(target)) | |
|
esprehn
2013/07/17 06:48:01
This requires two hash lookups now for every eleme
dstockwell
2013/07/17 13:10:19
I think we should still proceed with this for now.
| |
| 1058 return; | 1060 return; |
| 1059 | 1061 |
| 1060 Vector<Animation*>* animations = target->activeAnimations(); | 1062 const Vector<Animation*>& animations = animationStack.activeAnimations(targe t); |
| 1061 | 1063 |
| 1062 for (size_t i = 0; i < animations->size(); ++i) { | 1064 for (size_t i = 0; i < animations.size(); ++i) { |
| 1063 RefPtr<Animation> animation = animations->at(i); | 1065 RefPtr<Animation> animation = animations.at(i); |
| 1064 const AnimationEffect::CompositableValueMap* compositableValues = animat ion->compositableValues(); | 1066 const AnimationEffect::CompositableValueMap* compositableValues = animat ion->compositableValues(); |
| 1065 for (AnimationEffect::CompositableValueMap::const_iterator iter = compos itableValues->begin(); iter != compositableValues->end(); ++iter) { | 1067 for (AnimationEffect::CompositableValueMap::const_iterator iter = compos itableValues->begin(); iter != compositableValues->end(); ++iter) { |
| 1066 CSSPropertyID property = iter->key; | 1068 CSSPropertyID property = iter->key; |
| 1067 if (!isPropertyForPass<pass>(property)) | 1069 if (!isPropertyForPass<pass>(property)) |
| 1068 continue; | 1070 continue; |
| 1069 RefPtr<CSSValue> value = iter->value->compositeOnto(AnimatableValue: :neutralValue())->toCSSValue(); | 1071 RefPtr<CSSValue> value = iter->value->compositeOnto(AnimatableValue: :neutralValue())->toCSSValue(); |
| 1070 if (pass == HighPriorityProperties && property == CSSPropertyLineHei ght) | 1072 if (pass == HighPriorityProperties && property == CSSPropertyLineHei ght) |
| 1071 m_state.setLineHeightValue(value.get()); | 1073 m_state.setLineHeightValue(value.get()); |
| 1072 else | 1074 else |
| 1073 applyProperty(property, value.get()); | 1075 applyProperty(property, value.get()); |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1573 info.addMember(m_state, "state"); | 1575 info.addMember(m_state, "state"); |
| 1574 | 1576 |
| 1575 // FIXME: move this to a place where it would be called only once? | 1577 // FIXME: move this to a place where it would be called only once? |
| 1576 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); | 1578 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); |
| 1577 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl e"); | 1579 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl e"); |
| 1578 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle, "defaultPrintStyle" ); | 1580 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle, "defaultPrintStyle" ); |
| 1579 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo urceStyle"); | 1581 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo urceStyle"); |
| 1580 } | 1582 } |
| 1581 | 1583 |
| 1582 } // namespace WebCore | 1584 } // namespace WebCore |
| OLD | NEW |