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

Side by Side Diff: Source/core/css/resolver/ScopedStyleResolver.cpp

Issue 814083003: Update animation when changes in animation keyframes are detected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase again Created 5 years, 11 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2012 Google Inc. All rights reserved. 4 * Copyright (C) 2012 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 features.add(contents->ruleSet().features()); 83 features.add(contents->ruleSet().features());
84 } 84 }
85 } 85 }
86 86
87 void ScopedStyleResolver::resetAuthorStyle() 87 void ScopedStyleResolver::resetAuthorStyle()
88 { 88 {
89 m_authorStyleSheets.clear(); 89 m_authorStyleSheets.clear();
90 m_keyframesRuleMap.clear(); 90 m_keyframesRuleMap.clear();
91 } 91 }
92 92
93 const StyleRuleKeyframes* ScopedStyleResolver::keyframeStylesForAnimation(const StringImpl* animationName) 93 PassRefPtrWillBeRawPtr<StyleRuleKeyframes> ScopedStyleResolver::keyframeStylesFo rAnimation(const StringImpl* animationName)
94 { 94 {
95 if (m_keyframesRuleMap.isEmpty()) 95 if (m_keyframesRuleMap.isEmpty())
96 return 0; 96 return nullptr;
97 97
98 KeyframesRuleMap::iterator it = m_keyframesRuleMap.find(animationName); 98 KeyframesRuleMap::iterator it = m_keyframesRuleMap.find(animationName);
99 if (it == m_keyframesRuleMap.end()) 99 if (it == m_keyframesRuleMap.end())
100 return 0; 100 return nullptr;
101 101
102 return it->value.get(); 102 return it->value;
103 } 103 }
104 104
105 void ScopedStyleResolver::addKeyframeStyle(PassRefPtrWillBeRawPtr<StyleRuleKeyfr ames> rule) 105 void ScopedStyleResolver::addKeyframeStyle(PassRefPtrWillBeRawPtr<StyleRuleKeyfr ames> rule)
106 { 106 {
107 AtomicString s(rule->name()); 107 AtomicString s(rule->name());
108
109 rule->styleChanged();
esprehn 2015/01/29 04:23:19 I don't think you need this. This is just filling
shend 2015/01/30 00:03:10 Done.
110
108 if (rule->isVendorPrefixed()) { 111 if (rule->isVendorPrefixed()) {
109 KeyframesRuleMap::iterator it = m_keyframesRuleMap.find(rule->name().imp l()); 112 KeyframesRuleMap::iterator it = m_keyframesRuleMap.find(s.impl());
110 if (it == m_keyframesRuleMap.end()) 113 if (it == m_keyframesRuleMap.end())
111 m_keyframesRuleMap.set(s.impl(), rule); 114 m_keyframesRuleMap.set(s.impl(), rule);
112 else if (it->value->isVendorPrefixed()) 115 else if (it->value->isVendorPrefixed())
113 m_keyframesRuleMap.set(s.impl(), rule); 116 m_keyframesRuleMap.set(s.impl(), rule);
114 } else { 117 } else {
115 m_keyframesRuleMap.set(s.impl(), rule); 118 m_keyframesRuleMap.set(s.impl(), rule);
116 } 119 }
117 } 120 }
118 121
119 void ScopedStyleResolver::collectMatchingAuthorRules(ElementRuleCollector& colle ctor, bool includeEmptyRules, CascadeOrder cascadeOrder) 122 void ScopedStyleResolver::collectMatchingAuthorRules(ElementRuleCollector& colle ctor, bool includeEmptyRules, CascadeOrder cascadeOrder)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 void ScopedStyleResolver::trace(Visitor* visitor) 162 void ScopedStyleResolver::trace(Visitor* visitor)
160 { 163 {
161 #if ENABLE(OILPAN) 164 #if ENABLE(OILPAN)
162 visitor->trace(m_scope); 165 visitor->trace(m_scope);
163 visitor->trace(m_authorStyleSheets); 166 visitor->trace(m_authorStyleSheets);
164 visitor->trace(m_keyframesRuleMap); 167 visitor->trace(m_keyframesRuleMap);
165 #endif 168 #endif
166 } 169 }
167 170
168 } // namespace blink 171 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698