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

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

Issue 721103002: Fix lfiespan of ScopedStyleResolver (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix for hayato's review comments 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 | 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 * (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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 m_features.clear(); 233 m_features.clear();
234 m_siblingRuleSet.clear(); 234 m_siblingRuleSet.clear();
235 m_uncommonAttributeRuleSet.clear(); 235 m_uncommonAttributeRuleSet.clear();
236 m_needCollectFeatures = true; 236 m_needCollectFeatures = true;
237 } 237 }
238 238
239 void StyleResolver::processScopedRules(const RuleSet& authorRules, CSSStyleSheet * parentStyleSheet, unsigned parentIndex, ContainerNode& scope) 239 void StyleResolver::processScopedRules(const RuleSet& authorRules, CSSStyleSheet * parentStyleSheet, unsigned parentIndex, ContainerNode& scope)
240 { 240 {
241 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleKeyframes> > keyframesRul es = authorRules.keyframesRules(); 241 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleKeyframes> > keyframesRul es = authorRules.keyframesRules();
242 ScopedStyleResolver* resolver = &scope.treeScope().ensureScopedStyleResolver (); 242 ScopedStyleResolver* resolver = &scope.treeScope().ensureScopedStyleResolver ();
243 document().styleEngine()->addScopedStyleResolver(resolver);
244 for (unsigned i = 0; i < keyframesRules.size(); ++i) 243 for (unsigned i = 0; i < keyframesRules.size(); ++i)
245 resolver->addKeyframeStyle(keyframesRules[i]); 244 resolver->addKeyframeStyle(keyframesRules[i]);
246 245
247 m_treeBoundaryCrossingRules.addTreeBoundaryCrossingRules(authorRules, parent StyleSheet, parentIndex, scope); 246 m_treeBoundaryCrossingRules.addTreeBoundaryCrossingRules(authorRules, parent StyleSheet, parentIndex, scope);
248 247
249 // FIXME(BUG 72461): We don't add @font-face rules of scoped style sheets fo r the moment. 248 // FIXME(BUG 72461): We don't add @font-face rules of scoped style sheets fo r the moment.
250 if (scope.isDocumentNode()) { 249 if (scope.isDocumentNode()) {
251 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleFontFace> > fontFaceR ules = authorRules.fontFaceRules(); 250 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleFontFace> > fontFaceR ules = authorRules.fontFaceRules();
252 for (unsigned i = 0; i < fontFaceRules.size(); ++i) 251 for (unsigned i = 0; i < fontFaceRules.size(); ++i)
253 addFontFaceRule(m_document, document().styleEngine()->fontSelector() , fontFaceRules[i]); 252 addFontFaceRule(m_document, document().styleEngine()->fontSelector() , fontFaceRules[i]);
(...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 visitor->trace(m_uncommonAttributeRuleSet); 1607 visitor->trace(m_uncommonAttributeRuleSet);
1609 visitor->trace(m_watchedSelectorsRules); 1608 visitor->trace(m_watchedSelectorsRules);
1610 visitor->trace(m_treeBoundaryCrossingRules); 1609 visitor->trace(m_treeBoundaryCrossingRules);
1611 visitor->trace(m_styleSharingLists); 1610 visitor->trace(m_styleSharingLists);
1612 visitor->trace(m_pendingStyleSheets); 1611 visitor->trace(m_pendingStyleSheets);
1613 visitor->trace(m_document); 1612 visitor->trace(m_document);
1614 #endif 1613 #endif
1615 } 1614 }
1616 1615
1617 } // namespace blink 1616 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698