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

Side by Side Diff: third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollection.cpp

Issue 1854423002: ASSERT -> {DCHECK|DCHECK_XX}, ENABLE(ASSERT) -> DCHECK_IS_ON() in dom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mark svg/as-image/svg-nested.html crash on win Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2013 Google Inc. All rights reserved. 9 * Copyright (C) 2013 Google Inc. All rights reserved.
10 * 10 *
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 if (!node->inShadowIncludingDocument()) 49 if (!node->inShadowIncludingDocument())
50 return; 50 return;
51 51
52 m_styleSheetCandidateNodes.add(node); 52 m_styleSheetCandidateNodes.add(node);
53 } 53 }
54 54
55 TreeScopeStyleSheetCollection::StyleResolverUpdateType TreeScopeStyleSheetCollec tion::compareStyleSheets(const HeapVector<Member<CSSStyleSheet>>& oldStyleSheets , const HeapVector<Member<CSSStyleSheet>>& newStylesheets, HeapVector<Member<Sty leSheetContents>>& addedSheets) 55 TreeScopeStyleSheetCollection::StyleResolverUpdateType TreeScopeStyleSheetCollec tion::compareStyleSheets(const HeapVector<Member<CSSStyleSheet>>& oldStyleSheets , const HeapVector<Member<CSSStyleSheet>>& newStylesheets, HeapVector<Member<Sty leSheetContents>>& addedSheets)
56 { 56 {
57 unsigned newStyleSheetCount = newStylesheets.size(); 57 unsigned newStyleSheetCount = newStylesheets.size();
58 unsigned oldStyleSheetCount = oldStyleSheets.size(); 58 unsigned oldStyleSheetCount = oldStyleSheets.size();
59 ASSERT(newStyleSheetCount >= oldStyleSheetCount); 59 DCHECK_GE(newStyleSheetCount, oldStyleSheetCount);
60 60
61 if (!newStyleSheetCount) 61 if (!newStyleSheetCount)
62 return Reconstruct; 62 return Reconstruct;
63 63
64 unsigned newIndex = 0; 64 unsigned newIndex = 0;
65 for (unsigned oldIndex = 0; oldIndex < oldStyleSheetCount; ++oldIndex) { 65 for (unsigned oldIndex = 0; oldIndex < oldStyleSheetCount; ++oldIndex) {
66 while (oldStyleSheets[oldIndex] != newStylesheets[newIndex]) { 66 while (oldStyleSheets[oldIndex] != newStylesheets[newIndex]) {
67 addedSheets.append(newStylesheets[newIndex]->contents()); 67 addedSheets.append(newStylesheets[newIndex]->contents());
68 if (++newIndex == newStyleSheetCount) 68 if (++newIndex == newStyleSheetCount)
69 return Reconstruct; 69 return Reconstruct;
(...skipping 26 matching lines...) Expand all
96 } 96 }
97 m_hadActiveLoadingStylesheet = hasActiveLoadingStylesheet; 97 m_hadActiveLoadingStylesheet = hasActiveLoadingStylesheet;
98 return false; 98 return false;
99 } 99 }
100 100
101 static bool findFontFaceRulesFromStyleSheetContents(const HeapVector<Member<Styl eSheetContents>>& sheets, HeapVector<Member<const StyleRuleFontFace>>& fontFaceR ules) 101 static bool findFontFaceRulesFromStyleSheetContents(const HeapVector<Member<Styl eSheetContents>>& sheets, HeapVector<Member<const StyleRuleFontFace>>& fontFaceR ules)
102 { 102 {
103 bool hasFontFaceRule = false; 103 bool hasFontFaceRule = false;
104 104
105 for (unsigned i = 0; i < sheets.size(); ++i) { 105 for (unsigned i = 0; i < sheets.size(); ++i) {
106 ASSERT(sheets[i]); 106 DCHECK(sheets[i]);
107 if (sheets[i]->hasFontFaceRule()) { 107 if (sheets[i]->hasFontFaceRule()) {
108 // FIXME: We don't need this for styles in shadow tree. 108 // FIXME: We don't need this for styles in shadow tree.
109 sheets[i]->findFontFaceRules(fontFaceRules); 109 sheets[i]->findFontFaceRules(fontFaceRules);
110 hasFontFaceRule = true; 110 hasFontFaceRule = true;
111 } 111 }
112 } 112 }
113 return hasFontFaceRule; 113 return hasFontFaceRule;
114 } 114 }
115 115
116 void TreeScopeStyleSheetCollection::analyzeStyleSheetChange(StyleResolverUpdateM ode updateMode, const StyleSheetCollection& newCollection, StyleSheetChange& cha nge) 116 void TreeScopeStyleSheetCollection::analyzeStyleSheetChange(StyleResolverUpdateM ode updateMode, const StyleSheetCollection& newCollection, StyleSheetChange& cha nge)
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 168 }
169 169
170 DEFINE_TRACE(TreeScopeStyleSheetCollection) 170 DEFINE_TRACE(TreeScopeStyleSheetCollection)
171 { 171 {
172 visitor->trace(m_treeScope); 172 visitor->trace(m_treeScope);
173 visitor->trace(m_styleSheetCandidateNodes); 173 visitor->trace(m_styleSheetCandidateNodes);
174 StyleSheetCollection::trace(visitor); 174 StyleSheetCollection::trace(visitor);
175 } 175 }
176 176
177 } // namespace blink 177 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/TreeScopeAdopter.cpp ('k') | third_party/WebKit/Source/core/dom/TreeShared.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698