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)); | 855 keyframeValue.setStyle(styleForKeyframe(e, elementStyle, hundredPercentK eyframe)); |
| 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 void StyleResolver::setKeyframePropertyValues(KeyframeAnimationEffect::KeyframeV ector& keyframes, Vector<RefPtr<MutableStylePropertySet> >& propertySetVector, E lement* element) | |
|
Steve Block
2013/12/09 03:11:15
Can propertySetVector and element be const? Also,
rjwright
2013/12/09 09:04:02
Done.
propertySetVector yes, element no.
| |
| 863 { | |
| 864 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); | |
| 865 ASSERT(propertySetVector.size() == keyframes.size()); | |
| 866 | |
| 867 StyleResolverState state(element->document(), element); | |
| 868 RefPtr<RenderStyle> style = RenderStyle::clone(element->computedStyle()); | |
|
Steve Block
2013/12/09 03:11:15
As discussed, I don't think this is required - we
rjwright
2013/12/09 09:04:02
Done.
| |
| 869 state.setStyle(style); | |
| 870 | |
| 871 for (unsigned i = 0; i < propertySetVector.size(); ++i) { | |
| 872 for (unsigned j = 0; j < propertySetVector[i]->propertyCount(); ++j) { | |
| 873 CSSPropertyID id = propertySetVector[i]->propertyAt(j).id(); | |
| 874 StyleBuilder::applyProperty(id, state, propertySetVector[i]->getProp ertyCSSValue(id).get()); | |
| 875 keyframes[i]->setPropertyValue(id, CSSAnimatableValueFactory::create (id, *style.get()).get()); | |
| 876 } | |
| 877 } | |
| 878 } | |
| 879 | |
| 861 PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(Element* e, const P seudoStyleRequest& pseudoStyleRequest, RenderStyle* parentStyle) | 880 PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(Element* e, const P seudoStyleRequest& 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 (!e) | 885 if (!e) |
| 867 return 0; | 886 return 0; |
| 868 | 887 |
| 869 StyleResolverState state(document(), e, parentStyle); | 888 StyleResolverState state(document(), e, parentStyle); |
| 870 | 889 |
| (...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1423 bool StyleResolver::affectedByViewportChange() const | 1442 bool StyleResolver::affectedByViewportChange() const |
| 1424 { | 1443 { |
| 1425 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { | 1444 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { |
| 1426 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio n) != m_viewportDependentMediaQueryResults[i]->m_result) | 1445 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio n) != m_viewportDependentMediaQueryResults[i]->m_result) |
| 1427 return true; | 1446 return true; |
| 1428 } | 1447 } |
| 1429 return false; | 1448 return false; |
| 1430 } | 1449 } |
| 1431 | 1450 |
| 1432 } // namespace WebCore | 1451 } // namespace WebCore |
| OLD | NEW |