| 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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 keyframes[i]->setPropertyValue(id, CSSAnimatableValueFactory::create
(id, *state.style()).get()); | 811 keyframes[i]->setPropertyValue(id, CSSAnimatableValueFactory::create
(id, *state.style()).get()); |
| 812 } | 812 } |
| 813 } | 813 } |
| 814 return KeyframeEffectModel::create(keyframes); | 814 return KeyframeEffectModel::create(keyframes); |
| 815 } | 815 } |
| 816 | 816 |
| 817 PassRefPtr<PseudoElement> StyleResolver::createPseudoElementIfNeeded(Element& pa
rent, PseudoId pseudoId) | 817 PassRefPtr<PseudoElement> StyleResolver::createPseudoElementIfNeeded(Element& pa
rent, PseudoId pseudoId) |
| 818 { | 818 { |
| 819 RenderObject* parentRenderer = parent.renderer(); | 819 RenderObject* parentRenderer = parent.renderer(); |
| 820 if (!parentRenderer) | 820 if (!parentRenderer) |
| 821 return 0; | 821 return nullptr; |
| 822 | 822 |
| 823 if (pseudoId < FIRST_INTERNAL_PSEUDOID && !parentRenderer->style()->hasPseud
oStyle(pseudoId)) | 823 if (pseudoId < FIRST_INTERNAL_PSEUDOID && !parentRenderer->style()->hasPseud
oStyle(pseudoId)) |
| 824 return 0; | 824 return nullptr; |
| 825 | 825 |
| 826 if (pseudoId == BACKDROP && !parent.isInTopLayer()) | 826 if (pseudoId == BACKDROP && !parent.isInTopLayer()) |
| 827 return 0; | 827 return nullptr; |
| 828 | 828 |
| 829 if (!parentRenderer->canHaveGeneratedChildren()) | 829 if (!parentRenderer->canHaveGeneratedChildren()) |
| 830 return 0; | 830 return nullptr; |
| 831 | 831 |
| 832 RenderStyle* parentStyle = parentRenderer->style(); | 832 RenderStyle* parentStyle = parentRenderer->style(); |
| 833 StyleResolverState state(document(), &parent, parentStyle); | 833 StyleResolverState state(document(), &parent, parentStyle); |
| 834 if (!pseudoStyleForElementInternal(parent, pseudoId, parentStyle, state)) | 834 if (!pseudoStyleForElementInternal(parent, pseudoId, parentStyle, state)) |
| 835 return 0; | 835 return nullptr; |
| 836 RefPtr<RenderStyle> style = state.takeStyle(); | 836 RefPtr<RenderStyle> style = state.takeStyle(); |
| 837 ASSERT(style); | 837 ASSERT(style); |
| 838 | 838 |
| 839 if (!pseudoElementRendererIsNeeded(style.get())) | 839 if (!pseudoElementRendererIsNeeded(style.get())) |
| 840 return 0; | 840 return nullptr; |
| 841 | 841 |
| 842 parentStyle->addCachedPseudoStyle(style.release()); | 842 parentStyle->addCachedPseudoStyle(style.release()); |
| 843 RefPtr<PseudoElement> pseudo = PseudoElement::create(&parent, pseudoId); | 843 RefPtr<PseudoElement> pseudo = PseudoElement::create(&parent, pseudoId); |
| 844 | 844 |
| 845 setAnimationUpdateIfNeeded(state, *pseudo); | 845 setAnimationUpdateIfNeeded(state, *pseudo); |
| 846 if (ActiveAnimations* activeAnimations = pseudo->activeAnimations()) | 846 if (ActiveAnimations* activeAnimations = pseudo->activeAnimations()) |
| 847 activeAnimations->cssAnimations().maybeApplyPendingUpdate(pseudo.get()); | 847 activeAnimations->cssAnimations().maybeApplyPendingUpdate(pseudo.get()); |
| 848 return pseudo.release(); | 848 return pseudo.release(); |
| 849 } | 849 } |
| 850 | 850 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 if (state.style()->hasViewportUnits()) | 901 if (state.style()->hasViewportUnits()) |
| 902 document().setHasViewportUnits(); | 902 document().setHasViewportUnits(); |
| 903 | 903 |
| 904 return true; | 904 return true; |
| 905 } | 905 } |
| 906 | 906 |
| 907 PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(Element* element, c
onst PseudoStyleRequest& pseudoStyleRequest, RenderStyle* parentStyle) | 907 PassRefPtr<RenderStyle> StyleResolver::pseudoStyleForElement(Element* element, c
onst PseudoStyleRequest& pseudoStyleRequest, RenderStyle* parentStyle) |
| 908 { | 908 { |
| 909 ASSERT(parentStyle); | 909 ASSERT(parentStyle); |
| 910 if (!element) | 910 if (!element) |
| 911 return 0; | 911 return nullptr; |
| 912 | 912 |
| 913 StyleResolverState state(document(), element, parentStyle); | 913 StyleResolverState state(document(), element, parentStyle); |
| 914 if (!pseudoStyleForElementInternal(*element, pseudoStyleRequest, parentStyle
, state)) | 914 if (!pseudoStyleForElementInternal(*element, pseudoStyleRequest, parentStyle
, state)) |
| 915 return 0; | 915 return nullptr; |
| 916 | 916 |
| 917 if (PseudoElement* pseudoElement = element->pseudoElement(pseudoStyleRequest
.pseudoId)) | 917 if (PseudoElement* pseudoElement = element->pseudoElement(pseudoStyleRequest
.pseudoId)) |
| 918 setAnimationUpdateIfNeeded(state, *pseudoElement); | 918 setAnimationUpdateIfNeeded(state, *pseudoElement); |
| 919 | 919 |
| 920 // Now return the style. | 920 // Now return the style. |
| 921 return state.takeStyle(); | 921 return state.takeStyle(); |
| 922 } | 922 } |
| 923 | 923 |
| 924 PassRefPtr<RenderStyle> StyleResolver::styleForPage(int pageIndex) | 924 PassRefPtr<RenderStyle> StyleResolver::styleForPage(int pageIndex) |
| 925 { | 925 { |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1411 bool StyleResolver::mediaQueryAffectedByViewportChange() const | 1411 bool StyleResolver::mediaQueryAffectedByViewportChange() const |
| 1412 { | 1412 { |
| 1413 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { | 1413 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { |
| 1414 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio
n) != m_viewportDependentMediaQueryResults[i]->m_result) | 1414 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio
n) != m_viewportDependentMediaQueryResults[i]->m_result) |
| 1415 return true; | 1415 return true; |
| 1416 } | 1416 } |
| 1417 return false; | 1417 return false; |
| 1418 } | 1418 } |
| 1419 | 1419 |
| 1420 } // namespace WebCore | 1420 } // namespace WebCore |
| OLD | NEW |