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

Side by Side Diff: Source/core/animation/ElementAnimations.cpp

Issue 1033943002: Rename LayoutStyle to papayawhip (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ensureComputedStyle Created 5 years, 8 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
« no previous file with comments | « Source/core/animation/ElementAnimations.h ('k') | Source/core/animation/InterpolationEffect.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 ElementAnimations::~ElementAnimations() 43 ElementAnimations::~ElementAnimations()
44 { 44 {
45 #if !ENABLE(OILPAN) 45 #if !ENABLE(OILPAN)
46 for (Animation* animation : m_animations) 46 for (Animation* animation : m_animations)
47 animation->notifyElementDestroyed(); 47 animation->notifyElementDestroyed();
48 m_animations.clear(); 48 m_animations.clear();
49 #endif 49 #endif
50 } 50 }
51 51
52 void ElementAnimations::updateAnimationFlags(LayoutStyle& style) 52 void ElementAnimations::updateAnimationFlags(ComputedStyle& style)
53 { 53 {
54 for (const auto& entry : m_players) { 54 for (const auto& entry : m_players) {
55 const AnimationPlayer& player = *entry.key; 55 const AnimationPlayer& player = *entry.key;
56 ASSERT(player.source()); 56 ASSERT(player.source());
57 // FIXME: Needs to consider AnimationGroup once added. 57 // FIXME: Needs to consider AnimationGroup once added.
58 ASSERT(player.source()->isAnimation()); 58 ASSERT(player.source()->isAnimation());
59 const Animation& animation = *toAnimation(player.source()); 59 const Animation& animation = *toAnimation(player.source());
60 if (animation.isCurrent()) { 60 if (animation.isCurrent()) {
61 if (animation.affects(CSSPropertyOpacity)) 61 if (animation.affects(CSSPropertyOpacity))
62 style.setHasCurrentOpacityAnimation(true); 62 style.setHasCurrentOpacityAnimation(true);
(...skipping 20 matching lines...) Expand all
83 83
84 DEFINE_TRACE(ElementAnimations) 84 DEFINE_TRACE(ElementAnimations)
85 { 85 {
86 #if ENABLE(OILPAN) 86 #if ENABLE(OILPAN)
87 visitor->trace(m_cssAnimations); 87 visitor->trace(m_cssAnimations);
88 visitor->trace(m_defaultStack); 88 visitor->trace(m_defaultStack);
89 visitor->trace(m_players); 89 visitor->trace(m_players);
90 #endif 90 #endif
91 } 91 }
92 92
93 const LayoutStyle* ElementAnimations::baseLayoutStyle() const 93 const ComputedStyle* ElementAnimations::baseComputedStyle() const
94 { 94 {
95 #if !ENABLE(ASSERT) 95 #if !ENABLE(ASSERT)
96 if (isAnimationStyleChange()) 96 if (isAnimationStyleChange())
97 return m_baseLayoutStyle.get(); 97 return m_baseComputedStyle.get();
98 #endif 98 #endif
99 return nullptr; 99 return nullptr;
100 } 100 }
101 101
102 void ElementAnimations::updateBaseLayoutStyle(const LayoutStyle* layoutStyle) 102 void ElementAnimations::updateBaseComputedStyle(const ComputedStyle* computedSty le)
103 { 103 {
104 if (!isAnimationStyleChange()) { 104 if (!isAnimationStyleChange()) {
105 m_baseLayoutStyle = nullptr; 105 m_baseComputedStyle = nullptr;
106 return; 106 return;
107 } 107 }
108 #if ENABLE(ASSERT) 108 #if ENABLE(ASSERT)
109 if (m_baseLayoutStyle && layoutStyle) 109 if (m_baseComputedStyle && computedStyle)
110 ASSERT(*m_baseLayoutStyle == *layoutStyle); 110 ASSERT(*m_baseComputedStyle == *computedStyle);
111 #endif 111 #endif
112 m_baseLayoutStyle = LayoutStyle::clone(*layoutStyle); 112 m_baseComputedStyle = ComputedStyle::clone(*computedStyle);
113 } 113 }
114 114
115 void ElementAnimations::clearBaseLayoutStyle() 115 void ElementAnimations::clearBaseComputedStyle()
116 { 116 {
117 m_baseLayoutStyle = nullptr; 117 m_baseComputedStyle = nullptr;
118 } 118 }
119 119
120 bool ElementAnimations::isAnimationStyleChange() const 120 bool ElementAnimations::isAnimationStyleChange() const
121 { 121 {
122 // TODO(rune@opera.com): The FontFaceCache version number may be increased w ithout forcing 122 // TODO(rune@opera.com): The FontFaceCache version number may be increased w ithout forcing
123 // a style recalc (see crbug.com/471079). LayoutStyle objects created with d ifferent cache 123 // a style recalc (see crbug.com/471079). ComputedStyle objects created with different cache
124 // versions will not be considered equal as Font::operator== will compare ve rsions, hence 124 // versions will not be considered equal as Font::operator== will compare ve rsions, hence
125 // LayoutStyle::operator== will return false. We avoid using baseLayoutStyle (the check for 125 // ComputedStyle::operator== will return false. We avoid using baseComputedS tyle (the check for
126 // isFallbackValid()) in that case to avoid triggering the LayoutStyle compa rison ASSERT 126 // isFallbackValid()) in that case to avoid triggering the ComputedStyle com parison ASSERT
127 // in updateBaseLayoutStyle. 127 // in updateBaseComputedStyle.
128 return m_animationStyleChange && (!m_baseLayoutStyle || m_baseLayoutStyle->f ont().isFallbackValid()); 128 return m_animationStyleChange && (!m_baseComputedStyle || m_baseComputedStyl e->font().isFallbackValid());
129 } 129 }
130 130
131 } // namespace blink 131 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/animation/ElementAnimations.h ('k') | Source/core/animation/InterpolationEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698