OLD | NEW |
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 DCHECK(*m_baseComputedStyle == *computedStyle); | 104 DCHECK(*m_baseComputedStyle == *computedStyle); |
105 #endif | 105 #endif |
106 m_baseComputedStyle = ComputedStyle::clone(*computedStyle); | 106 m_baseComputedStyle = ComputedStyle::clone(*computedStyle); |
107 } | 107 } |
108 | 108 |
109 void ElementAnimations::clearBaseComputedStyle() { | 109 void ElementAnimations::clearBaseComputedStyle() { |
110 m_baseComputedStyle = nullptr; | 110 m_baseComputedStyle = nullptr; |
111 } | 111 } |
112 | 112 |
113 bool ElementAnimations::isAnimationStyleChange() const { | 113 bool ElementAnimations::isAnimationStyleChange() const { |
114 // TODO(rune@opera.com): The FontFaceCache version number may be increased wit
hout forcing | 114 // TODO(rune@opera.com): The FontFaceCache version number may be increased |
115 // a style recalc (see crbug.com/471079). ComputedStyle objects created with d
ifferent cache | 115 // without forcing a style recalc (see crbug.com/471079). ComputedStyle |
116 // versions will not be considered equal as Font::operator== will compare vers
ions, hence | 116 // objects created with different cache versions will not be considered equal |
117 // ComputedStyle::operator== will return false. We avoid using baseComputedSty
le (the check for | 117 // as Font::operator== will compare versions, hence ComputedStyle::operator== |
118 // isFallbackValid()) in that case to avoid triggering the ComputedStyle compa
rison ASSERT | 118 // will return false. We avoid using baseComputedStyle (the check for |
119 // in updateBaseComputedStyle. | 119 // isFallbackValid()) in that case to avoid triggering the ComputedStyle |
| 120 // comparison ASSERT in updateBaseComputedStyle. |
120 return m_animationStyleChange && | 121 return m_animationStyleChange && |
121 (!m_baseComputedStyle || | 122 (!m_baseComputedStyle || |
122 m_baseComputedStyle->font().isFallbackValid()); | 123 m_baseComputedStyle->font().isFallbackValid()); |
123 } | 124 } |
124 | 125 |
125 } // namespace blink | 126 } // namespace blink |
OLD | NEW |