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

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

Issue 15405006: Modify AnimationEffect::sample() to return a CompositableValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix rebase Created 7 years, 7 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/core.gypi ('k') | no next file » | 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) 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 18 matching lines...) Expand all
29 #include "config.h" 29 #include "config.h"
30 #include "core/css/resolver/StyleResolver.h" 30 #include "core/css/resolver/StyleResolver.h"
31 31
32 #include "CSSPropertyNames.h" 32 #include "CSSPropertyNames.h"
33 #include "HTMLNames.h" 33 #include "HTMLNames.h"
34 #include "MathMLNames.h" 34 #include "MathMLNames.h"
35 #include "RuntimeEnabledFeatures.h" 35 #include "RuntimeEnabledFeatures.h"
36 #include "UserAgentStyleSheets.h" 36 #include "UserAgentStyleSheets.h"
37 #include "WebKitFontFamilyNames.h" 37 #include "WebKitFontFamilyNames.h"
38 #include "XMLNames.h" 38 #include "XMLNames.h"
39 #include "core/animation/AnimatableValue.h"
39 #include "core/animation/Animation.h" 40 #include "core/animation/Animation.h"
40 #include "core/css/CSSBorderImage.h" 41 #include "core/css/CSSBorderImage.h"
41 #include "core/css/CSSCalculationValue.h" 42 #include "core/css/CSSCalculationValue.h"
42 #include "core/css/CSSCursorImageValue.h" 43 #include "core/css/CSSCursorImageValue.h"
43 #include "core/css/CSSDefaultStyleSheets.h" 44 #include "core/css/CSSDefaultStyleSheets.h"
44 #include "core/css/CSSFontFaceRule.h" 45 #include "core/css/CSSFontFaceRule.h"
45 #include "core/css/CSSFontSelector.h" 46 #include "core/css/CSSFontSelector.h"
46 #include "core/css/CSSLineBoxContainValue.h" 47 #include "core/css/CSSLineBoxContainValue.h"
47 #include "core/css/CSSPageRule.h" 48 #include "core/css/CSSPageRule.h"
48 #include "core/css/CSSParser.h" 49 #include "core/css/CSSParser.h"
(...skipping 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after
1835 template <StyleResolver::StyleApplicationPass pass> 1836 template <StyleResolver::StyleApplicationPass pass>
1836 void StyleResolver::applyAnimatedProperties(const Element* target) 1837 void StyleResolver::applyAnimatedProperties(const Element* target)
1837 { 1838 {
1838 if (!target->hasActiveAnimations()) 1839 if (!target->hasActiveAnimations())
1839 return; 1840 return;
1840 1841
1841 Vector<Animation*>* animations = target->activeAnimations(); 1842 Vector<Animation*>* animations = target->activeAnimations();
1842 1843
1843 for (size_t i = 0; i < animations->size(); ++i) { 1844 for (size_t i = 0; i < animations->size(); ++i) {
1844 RefPtr<Animation> animation = animations->at(i); 1845 RefPtr<Animation> animation = animations->at(i);
1845 RefPtr<StylePropertySet> properties = animation->cachedStyle(); 1846 const AnimationEffect::CompositableValueMap* compositableValues = animat ion->compositableValues();
1846 for (unsigned j = 0; j < properties->propertyCount(); ++j) { 1847 for (AnimationEffect::CompositableValueMap::const_iterator iter = compos itableValues->begin(); iter != compositableValues->end(); ++iter) {
1847 StylePropertySet::PropertyReference current = properties->propertyAt (j); 1848 CSSPropertyID property = iter->key;
1848 CSSPropertyID property = current.id(); 1849 // FIXME: Composite onto the underlying value.
1850 RefPtr<CSSValue> value = iter->value->composite(AnimatableValue()).t oCSSValue();
1849 switch (pass) { 1851 switch (pass) {
1850 case VariableDefinitions: 1852 case VariableDefinitions:
1851 ASSERT_NOT_REACHED(); 1853 ASSERT_NOT_REACHED();
1852 continue; 1854 continue;
1853 case HighPriorityProperties: 1855 case HighPriorityProperties:
1854 if (property < CSSPropertyLineHeight) 1856 if (property < CSSPropertyLineHeight)
1855 applyProperty(current.id(), current.value()); 1857 applyProperty(property, value.get());
1856 else if (property == CSSPropertyLineHeight) 1858 else if (property == CSSPropertyLineHeight)
1857 m_state.setLineHeightValue(current.value()); 1859 m_state.setLineHeightValue(value.get());
1858 continue; 1860 continue;
1859 case LowPriorityProperties: 1861 case LowPriorityProperties:
1860 if (property > CSSPropertyLineHeight) 1862 if (property > CSSPropertyLineHeight)
1861 applyProperty(current.id(), current.value()); 1863 applyProperty(property, value.get());
1862 continue; 1864 continue;
1863 } 1865 }
1864 } 1866 }
1865 } 1867 }
1866
1867 } 1868 }
1868 1869
1869 template <StyleResolver::StyleApplicationPass pass> 1870 template <StyleResolver::StyleApplicationPass pass>
1870 void StyleResolver::applyProperties(const StylePropertySet* properties, StyleRul e* rule, bool isImportant, bool inheritedOnly, PropertyWhitelistType propertyWhi telistType) 1871 void StyleResolver::applyProperties(const StylePropertySet* properties, StyleRul e* rule, bool isImportant, bool inheritedOnly, PropertyWhitelistType propertyWhi telistType)
1871 { 1872 {
1872 ASSERT((propertyWhitelistType != PropertyWhitelistRegion) || m_state.regionF orStyling()); 1873 ASSERT((propertyWhitelistType != PropertyWhitelistRegion) || m_state.regionF orStyling());
1873 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willProces sRule(document(), rule, this); 1874 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willProces sRule(document(), rule, this);
1874 1875
1875 unsigned propertyCount = properties->propertyCount(); 1876 unsigned propertyCount = properties->propertyCount();
1876 for (unsigned i = 0; i < propertyCount; ++i) { 1877 for (unsigned i = 0; i < propertyCount; ++i) {
(...skipping 2008 matching lines...) Expand 10 before | Expand all | Expand 10 after
3885 info.addMember(m_state, "state"); 3886 info.addMember(m_state, "state");
3886 3887
3887 // FIXME: move this to a place where it would be called only once? 3888 // FIXME: move this to a place where it would be called only once?
3888 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle"); 3889 info.addMember(CSSDefaultStyleSheets::defaultStyle, "defaultStyle");
3889 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl e"); 3890 info.addMember(CSSDefaultStyleSheets::defaultQuirksStyle, "defaultQuirksStyl e");
3890 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle, "defaultPrintStyle" ); 3891 info.addMember(CSSDefaultStyleSheets::defaultPrintStyle, "defaultPrintStyle" );
3891 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo urceStyle"); 3892 info.addMember(CSSDefaultStyleSheets::defaultViewSourceStyle, "defaultViewSo urceStyle");
3892 } 3893 }
3893 3894
3894 } // namespace WebCore 3895 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698