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 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 851 hundredPercentKeyframe = StyleKeyframe::create().leakRef(); | 851 hundredPercentKeyframe = StyleKeyframe::create().leakRef(); |
| 852 hundredPercentKeyframe->setKeyText("100%"); | 852 hundredPercentKeyframe->setKeyText("100%"); |
| 853 } | 853 } |
| 854 KeyframeValue keyframeValue(1, 0); | 854 KeyframeValue keyframeValue(1, 0); |
| 855 keyframeValue.setStyle(styleForKeyframe(e, elementStyle, hundredPercentK eyframe, name)); | 855 keyframeValue.setStyle(styleForKeyframe(e, elementStyle, hundredPercentK eyframe, name)); |
| 856 keyframeValue.addProperties(hundredPercentKeyframe->properties()); | 856 keyframeValue.addProperties(hundredPercentKeyframe->properties()); |
| 857 list.insert(keyframeValue); | 857 list.insert(keyframeValue); |
| 858 } | 858 } |
| 859 } | 859 } |
| 860 | 860 |
| 861 // This function is used by the WebAnimations JavaScript API method animate(). | |
| 862 PassRefPtr<KeyframeAnimationEffect> StyleResolver::setKeyframePropertyValues(Ele ment* element, const Vector<RefPtr<MutableStylePropertySet> >& propertySetVector , KeyframeAnimationEffect::KeyframeVector& keyframes) | |
|
esprehn
2013/12/10 03:49:00
createKeyframeAnimationEffect().
This is not a se
rjwright
2013/12/11 02:16:38
Done.
| |
| 863 { | |
| 864 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | |
| 865 ASSERT(propertySetVector.size() == keyframes.size()); | |
| 866 | |
| 867 StyleResolverState state(element->document(), element); | |
| 868 state.setStyle(RenderStyle::create()); | |
| 869 | |
| 870 for (unsigned i = 0; i < propertySetVector.size(); ++i) { | |
| 871 for (unsigned j = 0; j < propertySetVector[i]->propertyCount(); ++j) { | |
| 872 CSSPropertyID id = propertySetVector[i]->propertyAt(j).id(); | |
| 873 StyleBuilder::applyProperty(id, state, propertySetVector[i]->getProp ertyCSSValue(id).get()); | |
| 874 keyframes[i]->setPropertyValue(id, CSSAnimatableValueFactory::create (id, *state.style()).get()); | |
| 875 } | |
| 876 } | |
| 877 return KeyframeAnimationEffect::create(keyframes); | |
| 878 } | |
| 879 | |
| 861 PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(Element* element, c onst PseudoStyleRequest& pseudoStyleRequest, RenderStyle* parentStyle) | 880 PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(Element* element, c onst PseudoStyleRequest& pseudoStyleRequest, RenderStyle* parentStyle) |
| 862 { | 881 { |
| 863 ASSERT(document().frame()); | 882 ASSERT(document().frame()); |
| 864 ASSERT(documentSettings()); | 883 ASSERT(documentSettings()); |
| 865 ASSERT(parentStyle); | 884 ASSERT(parentStyle); |
| 866 if (!element) | 885 if (!element) |
| 867 return 0; | 886 return 0; |
| 868 | 887 |
| 869 StyleResolverState state(document(), element, parentStyle); | 888 StyleResolverState state(document(), element, parentStyle); |
| 870 | 889 |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1426 bool StyleResolver::affectedByViewportChange() const | 1445 bool StyleResolver::affectedByViewportChange() const |
| 1427 { | 1446 { |
| 1428 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { | 1447 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { |
| 1429 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio n) != m_viewportDependentMediaQueryResults[i]->m_result) | 1448 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio n) != m_viewportDependentMediaQueryResults[i]->m_result) |
| 1430 return true; | 1449 return true; |
| 1431 } | 1450 } |
| 1432 return false; | 1451 return false; |
| 1433 } | 1452 } |
| 1434 | 1453 |
| 1435 } // namespace WebCore | 1454 } // namespace WebCore |
| OLD | NEW |