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

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

Issue 137583005: resolveScopedKeyframesRules should check @keyframes declared in shadow trees. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added layout test Created 6 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
« no previous file with comments | « LayoutTests/fast/dom/shadow/shadowhost-keyframes-expected.txt ('k') | no next file » | 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) 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 break; 131 break;
132 } 132 }
133 } 133 }
134 134
135 void ScopedStyleTree::resolveScopedKeyframesRules(const Element* element, Vector <ScopedStyleResolver*, 8>& resolvers) 135 void ScopedStyleTree::resolveScopedKeyframesRules(const Element* element, Vector <ScopedStyleResolver*, 8>& resolvers)
136 { 136 {
137 Document& document = element->document(); 137 Document& document = element->document();
138 TreeScope& treeScope = element->treeScope(); 138 TreeScope& treeScope = element->treeScope();
139 bool applyAuthorStyles = treeScope.applyAuthorStyles(); 139 bool applyAuthorStyles = treeScope.applyAuthorStyles();
140 140
141 // Add resolvers for shadow roots hosted by the given element.
142 collectScopedResolversForHostedShadowTrees(element, resolvers);
143
144 // Add resolvers while walking up DOM tree from the given element.
141 for (ScopedStyleResolver* scopedResolver = scopedResolverFor(element); scope dResolver; scopedResolver = scopedResolver->parent()) { 145 for (ScopedStyleResolver* scopedResolver = scopedResolverFor(element); scope dResolver; scopedResolver = scopedResolver->parent()) {
142 if (scopedResolver->treeScope() == treeScope || (applyAuthorStyles && sc opedResolver->treeScope() == document)) 146 if (scopedResolver->treeScope() == treeScope || (applyAuthorStyles && sc opedResolver->treeScope() == document))
143 resolvers.append(scopedResolver); 147 resolvers.append(scopedResolver);
144 } 148 }
145 } 149 }
146 150
147 inline ScopedStyleResolver* ScopedStyleTree::enclosingScopedStyleResolverFor(con st ContainerNode* scopingNode) 151 inline ScopedStyleResolver* ScopedStyleTree::enclosingScopedStyleResolverFor(con st ContainerNode* scopingNode)
148 { 152 {
149 for (; scopingNode; scopingNode = scopingNode->parentOrShadowHostNode()) { 153 for (; scopingNode; scopingNode = scopingNode->parentOrShadowHostNode()) {
150 if (ScopedStyleResolver* scopedStyleResolver = scopedStyleResolverFor(*s copingNode)) 154 if (ScopedStyleResolver* scopedStyleResolver = scopedStyleResolverFor(*s copingNode))
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 return; 214 return;
211 215
212 reparentNodes(resolverRemoved, resolverRemoved->parent()); 216 reparentNodes(resolverRemoved, resolverRemoved->parent());
213 if (m_cache.scopedResolver == resolverRemoved) 217 if (m_cache.scopedResolver == resolverRemoved)
214 m_cache.clear(); 218 m_cache.clear();
215 219
216 m_authorStyles.remove(scopingNode); 220 m_authorStyles.remove(scopingNode);
217 } 221 }
218 222
219 } // namespace WebCore 223 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/shadow/shadowhost-keyframes-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698