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

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

Issue 210953003: Make style independent of the presence of the <shadow> element. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 ElementShadow* shadow = element->shadow(); 122 ElementShadow* shadow = element->shadow();
123 if (!shadow) 123 if (!shadow)
124 return; 124 return;
125 125
126 // Adding scoped resolver for active shadow roots for shadow host styling. 126 // Adding scoped resolver for active shadow roots for shadow host styling.
127 for (ShadowRoot* shadowRoot = shadow->youngestShadowRoot(); shadowRoot; shad owRoot = shadowRoot->olderShadowRoot()) { 127 for (ShadowRoot* shadowRoot = shadow->youngestShadowRoot(); shadowRoot; shad owRoot = shadowRoot->olderShadowRoot()) {
128 if (shadowRoot->hasScopedHTMLStyleChild()) { 128 if (shadowRoot->hasScopedHTMLStyleChild()) {
129 if (ScopedStyleResolver* resolver = scopedStyleResolverFor(*shadowRo ot)) 129 if (ScopedStyleResolver* resolver = scopedStyleResolverFor(*shadowRo ot))
130 resolvers.append(resolver); 130 resolvers.append(resolver);
131 } 131 }
132 if (!shadowRoot->containsShadowElements())
133 break;
134 } 132 }
135 } 133 }
136 134
137 void ScopedStyleTree::resolveScopedKeyframesRules(const Element* element, Vector <ScopedStyleResolver*, 8>& resolvers) 135 void ScopedStyleTree::resolveScopedKeyframesRules(const Element* element, Vector <ScopedStyleResolver*, 8>& resolvers)
138 { 136 {
139 Document& document = element->document(); 137 Document& document = element->document();
140 TreeScope& treeScope = element->treeScope(); 138 TreeScope& treeScope = element->treeScope();
141 bool applyAuthorStyles = treeScope.applyAuthorStyles(); 139 bool applyAuthorStyles = treeScope.applyAuthorStyles();
142 140
143 // Add resolvers for shadow roots hosted by the given element. 141 // Add resolvers for shadow roots hosted by the given element.
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 return; 215 return;
218 216
219 reparentNodes(resolverRemoved, resolverRemoved->parent()); 217 reparentNodes(resolverRemoved, resolverRemoved->parent());
220 if (m_cache.scopedResolver == resolverRemoved) 218 if (m_cache.scopedResolver == resolverRemoved)
221 m_cache.clear(); 219 m_cache.clear();
222 220
223 m_authorStyles.remove(scopingNode); 221 m_authorStyles.remove(scopingNode);
224 } 222 }
225 223
226 } // namespace WebCore 224 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/shadow/style-with-hat-expected.txt ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698