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

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

Issue 1038193002: Clear baseLayoutStyle when the font selector version has increased. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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
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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 LayoutStyle* ElementAnimations::validateBaseLayoutStyle()
94 { 94 {
95 #if !ENABLE(ASSERT) 95 if (!m_baseLayoutStyle)
96 if (isAnimationStyleChange()) 96 return nullptr;
97 return m_baseLayoutStyle.get(); 97
98 if (!isAnimationStyleChange() || !m_baseLayoutStyle->font().isFallbackValid( )) {
99 setAnimationStyleChange(false);
esprehn 2015/03/26 23:28:15 This bit may be read in a bunch of places, this wo
rune 2015/03/27 07:14:22 Yep. Doing this made the patch a lot simpler. Don
100 clearBaseLayoutStyle();
101 }
102 #if ENABLE(ASSERT)
103 return nullptr;
104 #else
105 return m_baseLayoutStyle.get();
98 #endif 106 #endif
99 return nullptr;
100 } 107 }
101 108
102 void ElementAnimations::updateBaseLayoutStyle(const LayoutStyle* layoutStyle) 109 void ElementAnimations::updateBaseLayoutStyle(const LayoutStyle* layoutStyle)
103 { 110 {
104 if (!isAnimationStyleChange()) { 111 if (!isAnimationStyleChange()) {
105 m_baseLayoutStyle = nullptr; 112 m_baseLayoutStyle = nullptr;
106 return; 113 return;
107 } 114 }
108 #if ENABLE(ASSERT) 115 #if ENABLE(ASSERT)
109 if (m_baseLayoutStyle && layoutStyle) 116 if (m_baseLayoutStyle && layoutStyle)
110 ASSERT(*m_baseLayoutStyle == *layoutStyle); 117 ASSERT(*m_baseLayoutStyle == *layoutStyle);
111 #endif 118 #endif
112 m_baseLayoutStyle = LayoutStyle::clone(*layoutStyle); 119 m_baseLayoutStyle = LayoutStyle::clone(*layoutStyle);
113 } 120 }
114 121
115 void ElementAnimations::clearBaseLayoutStyle() 122 void ElementAnimations::clearBaseLayoutStyle()
116 { 123 {
117 m_baseLayoutStyle = nullptr; 124 m_baseLayoutStyle = nullptr;
118 } 125 }
119 126
120 } // namespace blink 127 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698