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

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

Issue 809343002: ScopedStyleResolver should be cleared when ShadowRoot is removed from document. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Imported test from https://codereview.chromium.org/808333002/ Created 6 years 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 * (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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleFontFace> > fontFaceR ules = authorRules.fontFaceRules(); 247 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleFontFace> > fontFaceR ules = authorRules.fontFaceRules();
248 for (unsigned i = 0; i < fontFaceRules.size(); ++i) 248 for (unsigned i = 0; i < fontFaceRules.size(); ++i)
249 addFontFaceRule(m_document, document().styleEngine()->fontSelector() , fontFaceRules[i]); 249 addFontFaceRule(m_document, document().styleEngine()->fontSelector() , fontFaceRules[i]);
250 if (fontFaceRules.size()) 250 if (fontFaceRules.size())
251 invalidateMatchedPropertiesCache(); 251 invalidateMatchedPropertiesCache();
252 } 252 }
253 } 253 }
254 254
255 void StyleResolver::resetAuthorStyle(TreeScope& treeScope) 255 void StyleResolver::resetAuthorStyle(TreeScope& treeScope)
256 { 256 {
257 m_treeBoundaryCrossingRules.reset(&treeScope.rootNode());
258 resetRuleFeatures();
259
257 ScopedStyleResolver* resolver = treeScope.scopedStyleResolver(); 260 ScopedStyleResolver* resolver = treeScope.scopedStyleResolver();
258 if (!resolver) 261 if (!resolver)
259 return; 262 return;
260 263
261 m_treeBoundaryCrossingRules.reset(&treeScope.rootNode());
262 resolver->resetAuthorStyle(); 264 resolver->resetAuthorStyle();
263 resetRuleFeatures();
264 if (treeScope.rootNode().isDocumentNode()) 265 if (treeScope.rootNode().isDocumentNode())
265 return; 266 return;
266 267
267 // resolver is going to be freed below. 268 // resolver is going to be freed below.
268 treeScope.clearScopedStyleResolver(); 269 treeScope.clearScopedStyleResolver();
269 } 270 }
270 271
271 static PassOwnPtrWillBeRawPtr<RuleSet> makeRuleSet(const WillBeHeapVector<RuleFe ature>& rules) 272 static PassOwnPtrWillBeRawPtr<RuleSet> makeRuleSet(const WillBeHeapVector<RuleFe ature>& rules)
272 { 273 {
273 size_t size = rules.size(); 274 size_t size = rules.size();
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after
1602 visitor->trace(m_uncommonAttributeRuleSet); 1603 visitor->trace(m_uncommonAttributeRuleSet);
1603 visitor->trace(m_watchedSelectorsRules); 1604 visitor->trace(m_watchedSelectorsRules);
1604 visitor->trace(m_treeBoundaryCrossingRules); 1605 visitor->trace(m_treeBoundaryCrossingRules);
1605 visitor->trace(m_styleSharingLists); 1606 visitor->trace(m_styleSharingLists);
1606 visitor->trace(m_pendingStyleSheets); 1607 visitor->trace(m_pendingStyleSheets);
1607 visitor->trace(m_document); 1608 visitor->trace(m_document);
1608 #endif 1609 #endif
1609 } 1610 }
1610 1611
1611 } // namespace blink 1612 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/html/resources/marquee-crash.svg ('k') | Source/core/dom/shadow/ShadowRoot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698