| 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 // FIXME: Remove this when animate() switches away from resolution-dependent par
sing. |
| 863 PassRefPtr<KeyframeAnimationEffect> StyleResolver::createKeyframeAnimationEffect
(Element& element, const Vector<RefPtr<MutableStylePropertySet> >& propertySetVe
ctor, KeyframeAnimationEffect::KeyframeVector& keyframes) |
| 864 { |
| 865 ASSERT(RuntimeEnabledFeatures::webAnimationsAPIEnabled()); |
| 866 ASSERT(propertySetVector.size() == keyframes.size()); |
| 867 |
| 868 StyleResolverState state(element.document(), &element); |
| 869 state.setStyle(RenderStyle::create()); |
| 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, *state.style()).get()); |
| 876 } |
| 877 } |
| 878 return KeyframeAnimationEffect::create(keyframes); |
| 879 } |
| 880 |
| 861 PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(Element* element, c
onst PseudoStyleRequest& pseudoStyleRequest, RenderStyle* parentStyle) | 881 PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(Element* element, c
onst PseudoStyleRequest& pseudoStyleRequest, RenderStyle* parentStyle) |
| 862 { | 882 { |
| 863 ASSERT(document().frame()); | 883 ASSERT(document().frame()); |
| 864 ASSERT(documentSettings()); | 884 ASSERT(documentSettings()); |
| 865 ASSERT(parentStyle); | 885 ASSERT(parentStyle); |
| 866 if (!element) | 886 if (!element) |
| 867 return 0; | 887 return 0; |
| 868 | 888 |
| 869 StyleResolverState state(document(), element, parentStyle); | 889 StyleResolverState state(document(), element, parentStyle); |
| 870 | 890 |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1426 bool StyleResolver::affectedByViewportChange() const | 1446 bool StyleResolver::affectedByViewportChange() const |
| 1427 { | 1447 { |
| 1428 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { | 1448 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) | 1449 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio
n) != m_viewportDependentMediaQueryResults[i]->m_result) |
| 1430 return true; | 1450 return true; |
| 1431 } | 1451 } |
| 1432 return false; | 1452 return false; |
| 1433 } | 1453 } |
| 1434 | 1454 |
| 1435 } // namespace WebCore | 1455 } // namespace WebCore |
| OLD | NEW |