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

Side by Side Diff: Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 33483002: Have Frame::animation() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 PassRefPtr<RenderStyle> CSSComputedStyleDeclaration::computeRenderStyle(CSSPrope rtyID propertyID) const 1616 PassRefPtr<RenderStyle> CSSComputedStyleDeclaration::computeRenderStyle(CSSPrope rtyID propertyID) const
1617 { 1617 {
1618 Node* styledNode = this->styledNode(); 1618 Node* styledNode = this->styledNode();
1619 ASSERT(styledNode); 1619 ASSERT(styledNode);
1620 RenderObject* renderer = styledNode->renderer(); 1620 RenderObject* renderer = styledNode->renderer();
1621 if (renderer && renderer->compositingState() == PaintsIntoOwnBacking 1621 if (renderer && renderer->compositingState() == PaintsIntoOwnBacking
1622 && !RuntimeEnabledFeatures::webAnimationsCSSEnabled() && AnimationContro ller::supportsAcceleratedAnimationOfProperty(propertyID)) { 1622 && !RuntimeEnabledFeatures::webAnimationsCSSEnabled() && AnimationContro ller::supportsAcceleratedAnimationOfProperty(propertyID)) {
1623 AnimationUpdateBlock animationUpdateBlock(renderer->animation()); 1623 AnimationUpdateBlock animationUpdateBlock(renderer->animation());
1624 if (m_pseudoElementSpecifier && !styledNode->isPseudoElement()) { 1624 if (m_pseudoElementSpecifier && !styledNode->isPseudoElement()) {
1625 // FIXME: This cached pseudo style will only exist if the animation has been run at least once. 1625 // FIXME: This cached pseudo style will only exist if the animation has been run at least once.
1626 return renderer->animation()->getAnimatedStyleForRenderer(renderer)- >getCachedPseudoStyle(m_pseudoElementSpecifier); 1626 return renderer->animation().getAnimatedStyleForRenderer(renderer)-> getCachedPseudoStyle(m_pseudoElementSpecifier);
1627 } 1627 }
1628 return renderer->animation()->getAnimatedStyleForRenderer(renderer); 1628 return renderer->animation().getAnimatedStyleForRenderer(renderer);
1629 } 1629 }
1630 return styledNode->computedStyle(styledNode->isPseudoElement() ? NOPSEUDO : m_pseudoElementSpecifier); 1630 return styledNode->computedStyle(styledNode->isPseudoElement() ? NOPSEUDO : m_pseudoElementSpecifier);
1631 } 1631 }
1632 1632
1633 Node* CSSComputedStyleDeclaration::styledNode() const 1633 Node* CSSComputedStyleDeclaration::styledNode() const
1634 { 1634 {
1635 if (!m_node) 1635 if (!m_node)
1636 return 0; 1636 return 0;
1637 if (m_node->isElementNode()) { 1637 if (m_node->isElementNode()) {
1638 if (PseudoElement* element = toElement(m_node.get())->pseudoElement(m_ps eudoElementSpecifier)) 1638 if (PseudoElement* element = toElement(m_node.get())->pseudoElement(m_ps eudoElementSpecifier))
(...skipping 1605 matching lines...) Expand 10 before | Expand all | Expand 10 after
3244 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 3244 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
3245 CSSPropertyB ackgroundClip }; 3245 CSSPropertyB ackgroundClip };
3246 3246
3247 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 3247 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
3248 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); 3248 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator))));
3249 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); 3249 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator))));
3250 return list.release(); 3250 return list.release();
3251 } 3251 }
3252 3252
3253 } // namespace WebCore 3253 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/Document.cpp » ('j') | Source/core/frame/animation/AnimationController.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698