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

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

Issue 730513002: Should remove ScopedStyleResolver when ShadowRoot is removed from docoument. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: WIP: Fixed the issue. Tested manually. Need layout test Created 6 years, 1 month 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 | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/dom/ProcessingInstruction.cpp » ('j') | 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 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 m_features.clear(); 232 m_features.clear();
233 m_siblingRuleSet.clear(); 233 m_siblingRuleSet.clear();
234 m_uncommonAttributeRuleSet.clear(); 234 m_uncommonAttributeRuleSet.clear();
235 m_needCollectFeatures = true; 235 m_needCollectFeatures = true;
236 } 236 }
237 237
238 void StyleResolver::processScopedRules(const RuleSet& authorRules, CSSStyleSheet * parentStyleSheet, unsigned parentIndex, ContainerNode& scope) 238 void StyleResolver::processScopedRules(const RuleSet& authorRules, CSSStyleSheet * parentStyleSheet, unsigned parentIndex, ContainerNode& scope)
239 { 239 {
240 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleKeyframes> > keyframesRul es = authorRules.keyframesRules(); 240 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleKeyframes> > keyframesRul es = authorRules.keyframesRules();
241 ScopedStyleResolver* resolver = &scope.treeScope().ensureScopedStyleResolver (); 241 ScopedStyleResolver* resolver = &scope.treeScope().ensureScopedStyleResolver ();
242 document().styleEngine()->addScopedStyleResolver(resolver);
243 for (unsigned i = 0; i < keyframesRules.size(); ++i) 242 for (unsigned i = 0; i < keyframesRules.size(); ++i)
244 resolver->addKeyframeStyle(keyframesRules[i]); 243 resolver->addKeyframeStyle(keyframesRules[i]);
245 244
246 m_treeBoundaryCrossingRules.addTreeBoundaryCrossingRules(authorRules, parent StyleSheet, parentIndex, scope); 245 m_treeBoundaryCrossingRules.addTreeBoundaryCrossingRules(authorRules, parent StyleSheet, parentIndex, scope);
247 246
248 // FIXME(BUG 72461): We don't add @font-face rules of scoped style sheets fo r the moment. 247 // FIXME(BUG 72461): We don't add @font-face rules of scoped style sheets fo r the moment.
249 if (scope.isDocumentNode()) { 248 if (scope.isDocumentNode()) {
250 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleFontFace> > fontFaceR ules = authorRules.fontFaceRules(); 249 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleFontFace> > fontFaceR ules = authorRules.fontFaceRules();
251 for (unsigned i = 0; i < fontFaceRules.size(); ++i) 250 for (unsigned i = 0; i < fontFaceRules.size(); ++i)
252 addFontFaceRule(m_document, document().styleEngine()->fontSelector() , fontFaceRules[i]); 251 addFontFaceRule(m_document, document().styleEngine()->fontSelector() , fontFaceRules[i]);
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 visitor->trace(m_uncommonAttributeRuleSet); 1591 visitor->trace(m_uncommonAttributeRuleSet);
1593 visitor->trace(m_watchedSelectorsRules); 1592 visitor->trace(m_watchedSelectorsRules);
1594 visitor->trace(m_treeBoundaryCrossingRules); 1593 visitor->trace(m_treeBoundaryCrossingRules);
1595 visitor->trace(m_styleSharingLists); 1594 visitor->trace(m_styleSharingLists);
1596 visitor->trace(m_pendingStyleSheets); 1595 visitor->trace(m_pendingStyleSheets);
1597 visitor->trace(m_document); 1596 visitor->trace(m_document);
1598 #endif 1597 #endif
1599 } 1598 }
1600 1599
1601 } // namespace blink 1600 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/dom/ProcessingInstruction.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698